/* Custom CSS for KD Stock Monitor - Dark Theme */

/* Smooth transitions */
* {
    transition-property: color, background-color, border-color, box-shadow;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

/* Dark Card Base */
.dark-card {
    background-color: #1a1a1a;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dark-card:hover {
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.08);
}

/* Stock Card Styles */
.stock-card {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.stock-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    border-color: #3a3a3a;
}

.stock-card.overbought {
    border-left: 3px solid #ff3333;
}

.stock-card.oversold {
    border-left: 3px solid #00cc66;
}

.stock-card.normal {
    border-left: 3px solid #444444;
}

/* Status Badges */
.status-badge {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-badge.overbought {
    background-color: rgba(255, 51, 51, 0.15);
    color: #ff3333;
}

.status-badge.oversold {
    background-color: rgba(0, 204, 102, 0.15);
    color: #00cc66;
}

.status-badge.normal {
    background-color: rgba(136, 136, 136, 0.15);
    color: #888888;
}

/* KD Value Display */
.kd-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1.125rem;
}

.kd-value.high {
    color: #ff3333;
}

.kd-value.low {
    color: #00cc66;
}

.kd-value.normal {
    color: #e0e0e0;
}

/* Progress Bar for KD */
.kd-progress-bar {
    width: 100%;
    height: 4px;
    background-color: #2a2a2a;
    border-radius: 2px;
    overflow: hidden;
}

.kd-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.kd-progress-fill.high {
    background-color: #ff3333;
}

.kd-progress-fill.low {
    background-color: #00cc66;
}

.kd-progress-fill.normal {
    background-color: #4d96ff;
}

/* Alert Item Styles */
.alert-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background-color: #151515;
    border: 1px solid #2a2a2a;
}

.alert-item.overbought {
    border-left: 3px solid #ff3333;
}

.alert-item.oversold {
    border-left: 3px solid #00cc66;
}

.alert-item.acknowledged {
    opacity: 0.4;
}

/* Tab Styles */
.tab-btn {
    transition: all 0.2s;
    font-size: 0.875rem;
}

.tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    border-bottom-color: #00d4ff;
    color: #00d4ff;
}

/* Timeframe Buttons */
.tf-btn {
    transition: all 0.2s;
    font-size: 0.75rem;
}

.tf-btn.active {
    background-color: #00d4ff !important;
    color: #0a0a0a !important;
    font-weight: 600;
}

.tf-btn:hover:not(.active) {
    background-color: #2a2a2a;
}

/* Chart Section Fullscreen */
#chart-section {
    transition: all 0.3s ease;
}

.chart-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

.chart-fullscreen #stock-chart {
    height: calc(100vh - 60px) !important;
}

@media (max-width: 768px) {
    .chart-fullscreen #stock-chart {
        height: calc(100vh - 100px) !important;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .stock-card {
        font-size: 0.875rem;
    }

    #stock-chart {
        height: 380px !important;
    }

    .chart-fullscreen #stock-chart {
        height: calc(100vh - 100px) !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* Animation for alerts */
@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 51, 51, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 51, 51, 0);
    }
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 204, 102, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 204, 102, 0);
    }
}

.pulse-alert-overbought {
    animation: pulse-red 2s infinite;
}

.pulse-alert-oversold {
    animation: pulse-green 2s infinite;
}

/* Volume Sparkline */
.volume-sparkline {
    display: block;
    width: 100%;
}

.volume-sparkline rect {
    transition: opacity 0.2s;
}

.volume-sparkline:hover rect {
    opacity: 0.7;
}

/* Sparkline SVG */
.sparkline {
    width: 100%;
    height: 2.5rem;
}

.sparkline path {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Price Change Indicator */
.price-change {
    font-size: 0.875rem;
    font-weight: 500;
}

.price-change.up {
    color: #ff3333;
}

.price-change.down {
    color: #00cc66;
}

/* TW/US Market Labels */
.market-badge {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

.market-badge.tw {
    background-color: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
}

.market-badge.us {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

/* Select dropdown dark styling */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23888888' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    appearance: none;
}

/* Focus states */
select:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}
