/* HyperData Dashboard Styles - Using Design System */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--primary-black);
    min-height: 100vh;
    padding: var(--space-md);
    color: var(--text-primary);
}

.layout {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 32px);
    background: var(--secondary-black);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-white);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    overflow: hidden;
}

.sidebar {
    width: 240px;
    background: var(--primary-black);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    padding: var(--space-xl) var(--space-lg);
    border-right: 1px solid var(--border-white);
}

.sidebar-brand {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-white);
}

.brand-title {
    display: block;
    font-size: var(--font-3xl);
    font-weight: var(--font-bold);
    letter-spacing: 0.05em;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-xs);
}

.brand-subtitle {
    font-size: var(--font-sm);
    color: var(--text-light);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-link {
    background: transparent;
    border: 1px solid var(--border-white);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    text-align: left;
    font-size: var(--font-base);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: var(--font-primary);
}

.sidebar-link:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--primary-gold);
    transform: translateX(4px);
    box-shadow: var(--shadow-glow);
}

.sidebar-link.active {
    background: var(--gold-gradient);
    border-color: transparent;
    box-shadow: var(--button-glow-gold);
    color: var(--primary-black);
    font-weight: var(--font-semibold);
}

.main-content {
    flex: 1;
    background: var(--secondary-black);
    padding: 0;
    overflow-y: auto;
}

.container {
    max-width: none;
    margin: 0;
    background: var(--secondary-black);
    border-radius: 0;
    box-shadow: none;
    min-height: 100%;
}

header {
    background: var(--black-gradient);
    color: var(--text-primary);
    padding: var(--space-xl);
    border-bottom: 2px solid var(--border-gold);
    position: relative;
    overflow: hidden;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.header-title {
    flex: 1;
    text-align: center;
    min-width: 300px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

.auth-controls {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.auth-user-label {
    font-size: var(--font-sm);
    color: var(--text-light);
}

.auth-button {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-sm);
    color: var(--text-light);
    font-family: var(--font-primary);
    transition: all var(--transition-normal);
    opacity: 1;
}

.auth-button:hover:not(:disabled) {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.auth-button.secondary {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.btn-lg {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-md);
}

.guest-banner {
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.guest-banner .guest-actions {
    display: flex;
    gap: var(--space-xs);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 98;
}

.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-black);
    border: 1px solid var(--border-white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    z-index: 99;
    width: min(90vw, 420px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-modal-content {
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: var(--font-lg);
    cursor: pointer;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.auth-form label {
    font-size: var(--font-sm);
    color: var(--text-light);
}

.auth-form input {
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-white);
    background: var(--tertiary-black);
    color: var(--text-primary);
    font-size: var(--font-sm);
}

.auth-error {
    min-height: 1.5rem;
    color: var(--accent-red);
    font-size: var(--font-sm);
    margin-bottom: var(--space-sm);
}

.auth-error.success {
    color: var(--accent-green);
}

.auth-modal-footer {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-md);
    font-size: var(--font-sm);
}

.link-button {
    background: none;
    border: none;
    color: var(--primary-gold);
    cursor: pointer;
    font-size: var(--font-sm);
    text-decoration: underline;
    padding: 0;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gold-gradient);
    z-index: 1;
}

header h1 {
    font-size: var(--font-5xl);
    margin: 0 0 var(--space-sm) 0;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    position: relative;
    z-index: 2;
    transition: filter var(--transition-normal);
}

header h1:hover {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

.subtitle {
    font-size: var(--font-lg);
    color: var(--text-light);
    position: relative;
    z-index: 2;
}

.tabs {
    display: flex;
    background: var(--tertiary-black);
    border-bottom: 2px solid var(--border-white);
    align-items: center;
    flex-wrap: wrap;
    padding: 0 var(--space-md);
}

.tabs.hidden {
    display: none;
}

.tab-button {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--font-base);
    font-weight: var(--font-semibold);
    color: var(--text-light);
    transition: all var(--transition-normal);
    font-family: var(--font-primary);
    border-bottom: 3px solid transparent;
}

.language-switcher {
    display: flex;
    gap: var(--space-xs);
}

.lang-button {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-sm);
    color: var(--text-light);
    transition: all var(--transition-normal);
    font-family: var(--font-primary);
}

.lang-button:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.lang-button.active {
    background: var(--gold-gradient);
    color: var(--primary-black);
    border-color: var(--primary-gold);
    box-shadow: var(--button-glow-gold);
    font-weight: var(--font-semibold);
}

.tab-button:hover {
    background: rgba(255, 215, 0, 0.05);
    color: var(--primary-gold);
}

.tab-button.active {
    background: transparent;
    color: var(--primary-gold);
    border-bottom-color: var(--primary-gold);
    text-shadow: none;
    transition: text-shadow var(--transition-normal);
}

.tab-button.active:hover {
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.tab-content {
    display: none;
    padding: var(--space-xl);
    background: var(--secondary-black);
}

.tab-content.active {
    display: block;
}

.section {
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--tertiary-black);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-white);
    position: relative;
    z-index: 0;
    clear: both;
    transition: all var(--transition-normal);
}

.section:hover {
    border-color: var(--primary-gold);
    box-shadow: var(--shadow-glow);
}

.section h2 {
    color: var(--primary-gold);
    margin-bottom: var(--space-lg);
    font-size: var(--font-3xl);
    font-weight: var(--font-bold);
    border-bottom: 2px solid var(--border-gold);
    padding-bottom: var(--space-sm);
    text-shadow: none;
    transition: text-shadow var(--transition-normal);
}

.section h2:hover {
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.overview-section {
    background: var(--tertiary-black);
    border: 1px solid var(--border-white);
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.overview-card {
    cursor: pointer;
    transition: all var(--transition-normal);
    padding: var(--space-md);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    background: var(--black-gradient);
    border: 1px solid var(--border-white);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-height: 110px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gold-gradient);
    z-index: 1;
}

.overview-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover), var(--shadow-glow);
    border-color: var(--primary-gold);
}

.overview-card .card-label {
    font-size: var(--font-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    font-weight: var(--font-medium);
}

.overview-card .card-value {
    font-size: var(--font-4xl);
    font-weight: var(--font-bold);
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    transition: filter var(--transition-normal);
}

.overview-card:hover .card-value {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

.overview-card .card-subtitle {
    font-size: var(--font-sm);
    color: var(--text-light);
}

.overview-card.youtube-card::before {
    background: var(--gold-gradient);
}

.overview-card.heatmap-card::before {
    background: var(--gold-gradient);
}

.overview-card.newsletters-card::before {
    background: var(--gold-gradient);
}

/* Smaller font for newsletters card value (longer text) */
.overview-card.newsletters-card .card-value {
    font-size: var(--font-lg);
    line-height: 1.4;
}

.plot-container {
    background: var(--primary-black);
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-white);
    position: relative;
    z-index: 1;
    overflow: visible;
    clear: both;
    display: block !important;
    visibility: visible !important;
}

/* HyperWind forecast: use a simpler container so it doesn't look double-framed */
.hyperwind-plot-container {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: var(--space-lg);
}

.plot-container:hover {
    border-color: var(--primary-gold);
    box-shadow: var(--card-shadow-hover), var(--shadow-glow);
}

.plot {
    width: 100% !important;
    height: 400px !important;
    min-height: 400px !important;
    position: relative;
    z-index: 1;
    overflow: visible !important;
    display: block !important;
    visibility: visible !important;
}

/* Special styling for heatmap container */
.heatmap-section {
    overflow: visible !important;
    position: relative;
}

.heatmap-container {
    height: 1200px !important;
    max-height: 1200px !important;
    min-height: 1200px !important;
    overflow: visible !important;
    position: relative !important;
    padding: var(--space-sm) !important;
}

.heatmap-plot {
    height: 1200px !important;
    max-height: 1200px !important;
    min-height: 1200px !important;
    width: 100% !important;
    overflow: visible !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Colorscale toggle buttons */
.colorscale-toggle {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.colorscale-btn {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-sm);
    color: var(--text-light);
    transition: all var(--transition-normal);
    font-family: var(--font-primary);
    font-weight: var(--font-medium);
}

.colorscale-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.colorscale-btn.active {
    background: var(--gold-gradient);
    color: var(--primary-black);
    border-color: var(--primary-gold);
    box-shadow: var(--button-glow-gold);
    font-weight: var(--font-semibold);
}

/* Period selector styling */
.period-selector {
    padding: var(--space-xs) var(--space-sm);
    background: var(--tertiary-black);
    border: 1px solid var(--border-white);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-sm);
    cursor: pointer;
    font-family: var(--font-primary);
    transition: all var(--transition-normal);
}

.period-selector:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.period-selector:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: var(--button-glow-gold);
}

/* News color scheme - using gold instead of purple */
#news-tab .section h2 {
    color: var(--primary-gold);
    border-bottom-color: var(--primary-gold);
}

#news-tab .summary-card,
#news-tab .newsletter-card {
    border-left: 4px solid var(--primary-gold);
}

#news-tab .summary-card:hover,
#news-tab .newsletter-card:hover {
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3), var(--shadow-glow);
}

/* YouTube color scheme - using gold instead of green */
#youtube-tab .section h2 {
    color: var(--primary-gold);
    border-bottom-color: var(--primary-gold);
}

#youtube-tab .summary-card,
#youtube-tab .newsletter-card {
    border-left: 4px solid var(--primary-gold);
}

#youtube-tab .summary-card:hover,
#youtube-tab .newsletter-card:hover {
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3), var(--shadow-glow);
}

.summaries-container,
.newsletter-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.summary-card,
.newsletter-card {
    background: var(--tertiary-black);
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-white);
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

.summary-card:hover,
.newsletter-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover), var(--shadow-glow);
    border-color: var(--primary-gold);
}

.summary-card.expanded,
.newsletter-card.expanded {
    max-height: none;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.summary-preview,
.newsletter-preview {
    font-size: var(--font-base);
    color: var(--text-light);
    line-height: var(--leading-relaxed);
    max-height: 60px;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    flex: 1;
}

.summary-card:hover .summary-preview,
.newsletter-card:hover .newsletter-preview {
    max-height: 120px;
}

.summary-timestamp {
    font-size: var(--font-sm);
    color: var(--text-light);
    opacity: 0.7;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: var(--space-md);
    font-family: var(--font-mono);
}

.summary-content,
.newsletter-content {
    display: none;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-white);
    line-height: var(--leading-relaxed);
    color: var(--text-primary);
}

.summary-card.expanded .summary-content,
.newsletter-card.expanded .newsletter-content {
    display: block;
}

.summary-url,
.newsletter-date {
    margin-top: var(--space-md);
    font-size: var(--font-sm);
    color: var(--text-light);
}

.summary-url a {
    color: var(--primary-gold);
    text-decoration: none;
    word-break: break-all;
    transition: all var(--transition-normal);
    text-shadow: none;
}

.summary-url a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

#youtube-tab .summary-url a {
    color: var(--primary-gold);
}

.loading {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: var(--font-lg);
}

.error {
    background: rgba(198, 40, 40, 0.1);
    color: #c62828;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    border-left: 4px solid #c62828;
    border: 1px solid rgba(198, 40, 40, 0.3);
}

footer {
    background: var(--primary-black);
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-light);
    border-top: 1px solid var(--border-white);
}

footer p {
    margin: var(--space-xs) 0;
}

#last-update {
    font-weight: var(--font-semibold);
    color: var(--primary-gold);
}

#refresh-status {
    font-weight: var(--font-semibold);
    color: var(--primary-gold);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: var(--space-md);
    }
    
    .sidebar-brand {
        margin-bottom: 0;
        margin-right: var(--space-lg);
        padding-bottom: 0;
        border-bottom: none;
        border-right: 1px solid var(--border-white);
        padding-right: var(--space-lg);
    }
    
    .sidebar-nav {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-xs);
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-title {
        width: 100%;
    }
    
    .header-controls {
        width: 100%;
        justify-content: center;
    }
    
    .sidebar-link {
        flex: 1 1 auto;
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    body {
        padding: var(--space-sm);
    }
    
    .layout {
        min-height: auto;
        border-radius: var(--radius-lg);
    }
    
    .tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-content {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .header-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .auth-placeholder,
    .language-switcher {
        justify-content: center;
        width: 100%;
    }
    
    .overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    
    header h1 {
        font-size: var(--font-3xl);
    }
    
    .section h2 {
        font-size: var(--font-2xl);
    }
}


/* HyperWind card styles */
.hyperwind-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 140, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.hyperwind-card:hover {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.2);
}

.hyperwind-prediction {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    font-size: var(--font-sm);
}

.hyperwind-prediction > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hyperwind-prediction > div:last-child {
    border-bottom: none;
}

.hyperwind-label {
    color: var(--text-light);
    font-weight: var(--font-medium);
}

.hyperwind-value {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
}

.hyperwind-change.positive .hyperwind-value {
    color: #4ade80;
}

.hyperwind-change.negative .hyperwind-value {
    color: #f87171;
}

.hyperwind-trend.strong-positive .hyperwind-value {
    color: #22c55e;
    font-weight: var(--font-bold);
}

.hyperwind-trend.positive .hyperwind-value {
    color: #4ade80;
}

.hyperwind-trend.strong-negative .hyperwind-value {
    color: #ef4444;
    font-weight: var(--font-bold);
}

.hyperwind-trend.negative .hyperwind-value {
    color: #f87171;
}

.hyperwind-trend.neutral .hyperwind-value {
    color: var(--text-light);
}

.hyperwind-confidence.high .hyperwind-value {
    color: #22c55e;
}

.hyperwind-confidence.medium .hyperwind-value {
    color: #fbbf24;
}

.hyperwind-confidence.low .hyperwind-value {
    color: #f87171;
}

.hyperwind-container {
    padding: var(--space-lg);
}

/* HyperWind forecast chart: override generic .plot height to allow full 500px height */
.hyperwind-plot-container .plot,
#hyperwind-forecast-chart {
    height: 500px !important;
    min-height: 500px !important;
    max-height: none !important;
    overflow: visible !important;
}
