.scb-container {
    width: 100%;
    min-height: 100vh;
    padding: 1.5rem 0 0 0;
    margin: 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    transition: background 0.3s ease;
}

.dashboard-container {
    padding: 20px;
    max-width: none;
}

.header-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #3b82f6 100%);
    color: white;
    padding: 50px 0;
    margin: 0 20px 30px 20px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(30, 60, 114, 0.4);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}



@keyframes float {
    0%, 100% { transform: rotate(-15deg) translateY(0px); }
    50% { transform: rotate(-15deg) translateY(-20px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}



.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 6px 12px;
    margin: 2px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.tech-badge:hover {
    background: rgba(255, 255, 255, 0.25);
}

.chart-animation {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0.15;
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    height: 60px;
    padding: 0 20px;
}

.chart-bar {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 3px 3px 0 0;
    animation: chartGrow 2s ease-in-out infinite;
    flex: 0 0 auto;
    transform-origin: bottom;
}



@keyframes chartGrow {
    0%, 100% { 
        transform: scaleY(0.3); 
        opacity: 0.4; 
        transform-origin: bottom;
    }
    50% { 
        transform: scaleY(1); 
        opacity: 0.8; 
        transform-origin: bottom;
    }
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: white;
    margin-bottom: 20px;
}

.header-section h1 {
    font-weight: 700;
    margin-bottom: 10px;
}

.header-section .lead {
    font-size: 1.1rem;
    opacity: 0.9;
}

.variable-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.variable-section h5 {
    color: var(--section-title-color);
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2a5298;
    transition: color 0.3s ease;
}

.table-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px var(--card-shadow);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.table-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(42, 82, 152, 0.05), transparent);
    transition: left 0.6s;
}

.table-card:hover::before {
    left: 100%;
}

.table-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(42, 82, 152, 0.15);
    border-color: #2a5298;
}

.table-card.selected {
    border-color: #2a5298;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    box-shadow: 0 8px 25px rgba(42, 82, 152, 0.25);
    transform: translateY(-2px);
}

.table-card.selected::before {
    background: linear-gradient(90deg, transparent, rgba(42, 82, 152, 0.1), transparent);
}

.table-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    transition: color 0.3s ease;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.table-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f3f4;
}

.table-id {
    background: #f7fafc;
    color: #4a5568;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.table-period {
    background: #e6fffa;
    color: #234e52;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.badge-custom {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 8px;
    margin-left: auto;
}

.filter-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.filter-section h5 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2a5298;
}

.chart-container {
    position: relative;
    height: 500px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border: none;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-primary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(42, 82, 152, 0.3);
}

.form-select, .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    transition: border-color 0.2s;
}

.form-select:focus, .form-control:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    border-color: #2a5298;
    color: #2a5298;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(42, 82, 152, 0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-color: #2a5298;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(42, 82, 152, 0.4);
}

.filter-btn.active::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.category-group {
    margin-bottom: 24px;
}

.category-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #2a5298;
}

.category-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-count {
    background: #2a5298;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
}

.category-header {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.category-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.category-toggle {
    font-size: 0.8rem;
    margin-right: 8px;
    color: #2a5298;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.category-group.collapsed .category-toggle {
    transform: rotate(-90deg);
}

.chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    text-align: center;
}

.chart-loading h5 {
    color: #495057;
    margin-bottom: 8px;
}

.chart-loading p {
    font-size: 0.9rem;
    margin: 0;
}

.welcome-message {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.welcome-message h3 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

.welcome-message .lead {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.8;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.data-source-panel .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 30px;
}

.data-source-panel .modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.btn-close-modal {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    color: #6c757d;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-close-modal:hover {
    background: #e9ecef;
    color: #495057;
}

.purpose-selection {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.purpose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Stage 3 - Dataset cards (applies to all screen sizes) */
.dataset-card {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dataset-card:hover {
    border-color: #2a5298;
    background: #f8f9fa;
    box-shadow: 0 6px 20px rgba(42, 82, 152, 0.15);
    cursor: pointer;
}

.dataset-card.active {
    border-color: #2a5298;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    box-shadow: 0 8px 25px rgba(42, 82, 152, 0.25);
}

.dataset-card.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(135deg, #2a5298 0%, #3b82f6 100%);
    border-radius: 5px 0 0 5px;
}

.dataset-card.active::after {
    content: '✓';
    position: absolute;
    right: 16px;
    top: 16px;
    width: 24px;
    height: 24px;
    background: #2a5298;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.dataset-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    line-height: 1.3;
    padding-right: 40px; /* Space for checkmark */
}

.dataset-meta {
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.dataset-id {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-weight: 500;
    border: 1px solid #e9ecef;
}

.badge-custom {
    background: linear-gradient(135deg, #2a5298 0%, #3b82f6 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.show-more-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    color: #2a5298;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.show-more-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #2a5298;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.15);
}

.show-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(42, 82, 152, 0.2);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 15px;
    }
    
    .header-section {
        margin: 10px 10px 20px 10px;
        padding: 30px 20px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    .purpose-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .purpose-card {
        padding: 16px;
        margin: 0 5px;
    }
    
    .purpose-icon {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .purpose-title {
        font-size: 1rem;
    }
    
    .purpose-description {
        font-size: 0.85rem;
    }
}

/* Reusable compact button system */
.compact-button {
    width: 80px;
    height: 80px;
    padding: 4px 2px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.compact-button:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.compact-button.active {
    background: linear-gradient(135deg, #2a5298 0%, #3b82f6 100%);
    border-color: #2a5298;
    color: white;
    box-shadow: 0 3px 10px rgba(42, 82, 152, 0.3);
}

.compact-button-icon {
    font-size: 1rem;
    margin-bottom: 4px;
    color: #2a5298;
}

.compact-button.active .compact-button-icon {
    color: white;
}

.compact-button-title {
    font-size: 0.45rem;
    font-weight: 700;
    margin-bottom: 0px;
    text-align: center;
    line-height: 0.9;
    max-width: 100%;
    word-break: break-word;
}

.compact-button-subtitle {
    font-size: 0.35rem;
    margin-top: 1px;
    opacity: 0.8;
    text-align: center;
    line-height: 0.85;
}

/* Responsive category grid */
.category-responsive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 auto;
    justify-items: center;
    max-width: 180px;
}

/* Grid layouts for other uses */
.compact-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
    justify-items: center;
    max-width: 180px;
    margin: 0 auto;
}

/* Desktop plot actions - fully right aligned */
@media (min-width: 576px) {
    .plot-header .d-none.d-md-flex {
        width: 100%;
    }
    
    .plot-header .d-none.d-md-flex .plot-actions {
        margin-left: auto;
    }
}

/* All dark mode styles moved to dark-mode.css */

