/**
 * Holiday Calendar - Professional White Design
 * Matching Volatility Calculator Interface
 */

:root {
    /* Primary White Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    
    /* Professional Accent Colors */
    --accent-primary: #0f172a;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    
    /* Borders & Shadows */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Typography */
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 80px;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    background: var(--bg-secondary);
    min-height: 100vh;
    padding-top: 80px;
}

/* ============================================
   DASHBOARD HEADER
   ============================================ */

.dashboard-header {
    width: 100%;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding-top: 30px;
}

.header-branding {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.platform-tag {
    color: var(--accent-blue);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.header-branding h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

.status-indicator.live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.live-text {
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   CONTROL BAR
   ============================================ */

.control-bar {
    width: 100%;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 140px;
    flex: 1;
}

.control-group label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
}

.control-group select {
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    min-width: 140px;
    transition: all 0.2s;
    cursor: pointer;
}

.control-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.analyze-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
    margin-left: auto;
}

.analyze-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.analyze-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1rem;
}

/* ============================================
   DOWNLOAD SECTION
   ============================================ */

.download-section {
    width: 100%;
    padding: 1.25rem 2rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   RESULTS SECTION
   ============================================ */

.results-section {
    width: 100%;
    padding: 2rem;
    background: var(--bg-secondary);
    min-height: 300px;
}

.loading-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.loading-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.loading-state p {
    font-size: 1rem;
    color: var(--text-tertiary);
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.results-count {
    font-weight: 600;
    color: var(--accent-blue);
    font-size: 1rem;
    font-family: var(--font-mono);
}

/* Table Container */
.scrollable-table {
    max-height: 600px;
    overflow-y: auto;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-medium);
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: top;
}

tr:hover td {
    background: var(--bg-secondary);
}

tr:last-child td {
    border-bottom: none;
}

/* Impact Level Styling */
.impact-high {
    background: rgba(239, 68, 68, 0.05);
    border-left: 4px solid var(--accent-red);
}

.impact-medium {
    background: rgba(245, 158, 11, 0.05);
    border-left: 4px solid var(--accent-amber);
}

.impact-low {
    background: rgba(16, 185, 129, 0.05);
    border-left: 4px solid var(--accent-green);
}

/* Source Styling */
.source-platts {
    background: rgba(59, 130, 246, 0.05);
}

.source-argus {
    background: rgba(16, 185, 129, 0.05);
}

.source-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.platts-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.argus-tag {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem;
    color: var(--text-tertiary);
    font-size: 1rem;
    font-style: italic;
}

/* ============================================
   METHODOLOGY SECTION
   ============================================ */

.methodology-section {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: 3rem 2rem;
    width: 100%;
}

.container-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header-pro {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.tool-overview {
    max-width: 900px;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.lead-text {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-blue);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* How to Use Grid */
.how-to-use-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: start;
}

.usage-steps h3,
.methodology-deep-dive h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-blue);
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.steps-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--accent-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-content strong {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
}

.step-content span {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Methodology Grid */
.method-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.method-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.method-card:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-sm);
}

.method-card h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.method-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.method-card em {
    color: var(--accent-amber);
    font-style: normal;
    font-weight: 600;
}

/* Metrics Reference */
.metrics-reference {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.metrics-reference h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.metrics-list-pro {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-row dt {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.metric-row dd {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.metric-threshold {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* Use Cases */
.use-cases {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.use-cases h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.use-case-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.use-case {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.use-case:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .how-to-use-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 900px) {
    .control-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
    }
    
    .analyze-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .dashboard-header,
    .control-bar,
    .download-section,
    .results-section,
    .methodology-section {
        padding: 1rem;
    }
    
    .header-branding h1 {
        font-size: 1.25rem;
    }
    
    .header-meta {
        display: none;
    }
    
    .results-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .scrollable-table {
        max-height: 400px;
    }
    
    th, td {
        padding: 0.75rem;
        font-size: 0.8125rem;
    }
    
    .metric-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .method-grid-compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.25rem;
    }
    
    .lead-text {
        font-size: 1rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-blue { color: var(--accent-blue); }
.text-green { color: var(--accent-green); }
.text-amber { color: var(--accent-amber); }
.text-red { color: var(--accent-red); }
.text-muted { color: var(--text-muted); }

.font-mono { font-family: var(--font-mono); }
.font-sans { font-family: var(--font-sans); }

/* Smooth transitions */
button, input, select, .feature-card, .method-card, .download-btn {
    transition: all 0.2s ease;
}

/* Focus states for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Selection colors */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
}