/* Quantum Portfolio Optimizer - Professional Styles */

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #fbbf24;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1f2937;
    --gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 0.5rem;
    --transition: all 0.3s ease-in-out;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;
}

/* Dark theme variables */
body.dark-theme {
    --primary-color: #3b82f6;
    --secondary-color: #fbbf24;
    --light-color: #1f2937;
    --dark-color: #f8fafc;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --card-bg: #1f2937;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* Navbar text visibility */
.navbar-brand {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Section */
.hero-section {
    position: relative;
    background: var(--gradient-primary);
    min-height: 100vh;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

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

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
}

.hero-visualization {
    position: relative;
    z-index: 2;
}

/* Performance Highlight */
.performance-highlight {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.performance-card {
    text-align: center;
}

.performance-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--secondary-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.performance-label {
    font-size: 1rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Market Status */
.market-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.market-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.market-indicator.open {
    background-color: var(--success-color);
}

.market-indicator.closed {
    background-color: var(--danger-color);
}

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

/* Benefit Cards */
.benefit-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.benefit-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.benefit-metric {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Performance Stats */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Process Steps */
.process-step {
    text-align: center;
    padding: 1.5rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

/* Testimonials */
.testimonial-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    height: 100%;
    transition: var(--transition);
}

.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stars {
    color: var(--secondary-color);
}

.testimonial-author {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* CTA Section */
.cta-section {
    background: var(--gradient-primary);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.1;
    pointer-events: none;
}

.cta-section .container {
    position: relative;
    z-index: 1;
}

/* Demo Page Styles */
.demo-page {
    background-color: #f8fafc;
}

.demo-header {
    border-bottom: 1px solid #e5e7eb;
}

.demo-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background-color: var(--success-color);
}

/* Demo Panels */
.demo-panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.panel-header {
    background: #f8fafc;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--dark-color);
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.demo-panel .container-fluid {
    padding: 1.5rem;
}

/* Sample Portfolio Buttons */
.sample-portfolio-btn {
    text-align: left;
    border: 1px solid #e5e7eb;
    transition: var(--transition);
}

.sample-portfolio-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(30, 58, 138, 0.05);
}

.sample-portfolio-btn.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

/* Current Weights */
.current-weights {
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 1rem;
    min-height: 100px;
    background: #f8fafc;
}

.weight-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.weight-input-group label {
    flex: 1;
    font-size: 0.875rem;
    margin: 0;
}

.weight-input-group input {
    width: 80px;
    margin-left: 0.5rem;
}

/* Progress and Loading */
.loading-spinner {
    padding: 3rem;
}

.empty-state {
    padding: 3rem;
}

.error-state {
    padding: 3rem;
}

/* Results Display */
.metric-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
    height: 100%;
}

.metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.metric-card .metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Demo Results Layout */
.demo-page #resultsDisplay {
    max-width: 100%;
    max-height: 80vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Dashboard Chart Layout */
.dashboard-page .card .card-body canvas {
    max-width: 100%;
    display: block;
}

.dashboard-page .card .card-body {
    position: relative;
}

.dashboard-page .card .card-body > canvas {
    height: 320px !important;
    max-height: 320px;
}

.dashboard-page .card .card-body .chart-wrapper {
    max-height: 320px;
    overflow: hidden;
}

.dashboard-page .row.mb-4 {
    align-items: stretch;
}

@media (max-width: 992px) {
    .demo-page #resultsDisplay {
        max-height: none;
        padding-right: 0;
    }
}

.demo-page #resultsDisplay .chart-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.demo-page #resultsDisplay .chart-container canvas {
    max-width: 100% !important;
    max-height: 300px !important;
    width: 100% !important;
    height: 300px !important;
    display: block;
    margin: 0 auto;
}

.demo-page #resultsDisplay .chart-container h5 {
    text-align: center;
    margin-bottom: 0;
    color: var(--dark-color);
}

.demo-page #resultsDisplay .chart-metrics {
    margin-top: 0;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.demo-page #resultsDisplay .table {
    margin-bottom: 0;
    table-layout: fixed;
    width: 100%;
}

.demo-page #resultsDisplay .table th {
    background-color: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-page #resultsDisplay .table td {
    vertical-align: middle;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* Fix for allocation table columns */
#allocationTableBody tr td:nth-child(1) { width: 15%; } /* Stock */
#allocationTableBody tr td:nth-child(2) { width: 20%; } /* Classical % */
#allocationTableBody tr td:nth-child(3) { width: 20%; } /* Quantum % */
#allocationTableBody tr td:nth-child(4) { width: 20%; } /* Change */
#allocationTableBody tr td:nth-child(5) { width: 25%; } /* Risk Contrib */

.demo-page #resultsDisplay .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.demo-page #resultsDisplay .tab-content {
    max-width: 100%;
}

/* Container fluid fix */
.demo-page .container-fluid {
    max-width: 100vw;
    overflow-x: hidden;
    padding-left: 15px;
    padding-right: 15px;
}

/* Demo panel fixes */
.demo-panel {
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

/* Performance card fixes */
.performance-card {
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
}

/* Watchlist Page */
.watchlist-page .card-header {
    padding: 1rem 1.5rem;
}

.watchlist-page .card-body {
    padding: 1.5rem;
}

.watchlist-page .table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.watchlist-page .table td {
    vertical-align: middle;
}

.watchlist-page #marketPulse {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.watchlist-page #insightsList li {
    line-height: 1.5;
}

.watchlist-page .badge.bg-success-subtle,
.watchlist-page .badge.bg-danger-subtle,
.watchlist-page .badge.bg-warning-subtle {
    border-radius: 2rem;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
}

/* Optimizer Page */
.optimizer-page .card-header {
    padding: 1rem 1.5rem;
}

.optimizer-page .card-body {
    padding: 1.5rem;
}

.optimizer-page canvas {
    max-width: 100%;
}

.optimizer-page #optimizerStatus {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.optimizer-page #optimizerMetrics .metric-card {
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: var(--border-radius);
    padding: 1rem;
    background: white;
}

.optimizer-page .table-responsive {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius);
}

.optimizer-page #optimizerMetrics .metric-card .metric-value {
    font-size: 1.5rem;
}

.optimizer-page #optimizerMetrics .metric-card .metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    color: #6b7280;
}

.optimizer-chart-wrapper {
    flex: 1;
    min-width: 240px;
}

.chart-container-sm {
    position: relative;
    width: 100%;
    height: 260px;
}

.chart-container-sm canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Simulation Page */
.simulation-page .chart-container-lg {
    position: relative;
    width: 100%;
    height: 320px;
}

.simulation-page .chart-container-lg canvas,
.simulation-page .chart-container-sm canvas {
    width: 100% !important;
    height: 100% !important;
}

.simulation-page .simulation-trade-table {
    max-height: 280px;
    overflow-y: auto;
}

.simulation-page #simulationMetrics .metric-card {
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: var(--border-radius);
    padding: 1rem;
    background: white;
}

.simulation-page #simulationMetrics .metric-card .metric-value {
    font-size: 1.4rem;
}

.simulation-page #simulationMetrics .metric-card .metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    color: #6b7280;
}

.simulation-page #scenarioInsights {
    font-size: 0.9rem;
}

.simulation-page #scenarioInsights i {
    flex-shrink: 0;
}

/* Reports Page */
.reports-page .chart-container-lg {
    position: relative;
    width: 100%;
    height: 320px;
}

.reports-page .chart-container-lg canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.reports-page #insightHighlights h6 {
    font-size: 0.95rem;
}

.reports-page #reportSummary p,
.reports-page #insightHighlights p {
    font-size: 0.9rem;
}

.reports-page #reportStatus {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.reports-page .table-responsive {
    max-height: 280px;
    overflow-y: auto;
}

/* Education Hub */
.education-page .card-header {
    padding: 1rem 1.5rem;
}

.education-page .card-body {
    padding: 1.5rem;
}

.education-page #learningPaths .list-group-item {
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.education-page #learningPaths .list-group-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
}

.education-page .glossary-list {
    max-height: 360px;
    overflow-y: auto;
}

.education-page .glossary-term {
    margin-bottom: 1rem;
}

.education-page .glossary-term h6 {
    margin-bottom: 0.25rem;
}

.education-page #lessonCards .lesson-card {
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.education-page #lessonCards .lesson-card .badge {
    align-self: flex-start;
}

/* Settings */
.settings-page .card-header {
    padding: 1rem 1.5rem;
}

.settings-page .card-body {
    padding: 1.5rem;
}

.settings-page #integrationList .integration-card {
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.settings-page #integrationList .integration-card .status {
    font-size: 0.8rem;
}

.sidebar {
    transition: width 0.3s ease;
}

.main-content {
    transition: margin-left 0.3s ease;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Tab content fixes */
.tab-pane {
    max-width: 100%;
    overflow: hidden;
}

/* Metric card fixes */
.metric-card {
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
}

/* Badges and Status */
.change-positive {
    color: var(--success-color);
    font-weight: 600;
}

.change-negative {
    color: var(--danger-color);
    font-weight: 600;
}

.change-neutral {
    color: #6b7280;
}

/* Trade Recommendations */
.trade-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trade-action {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trade-action.buy {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.trade-action.sell {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Help Button */
.help-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    border: none;
    font-size: 1.25rem;
}

/* Rate Limit Info */
.rate-limit-info {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    text-align: center;
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

/* Algorithm Details */
.algorithm-details {
    margin: 1.5rem 0;
}

.detail-item {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.detail-item h6 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.detail-item p {
    font-family: 'Monaco', 'Consolas', monospace;
    background: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }
    
    .performance-number {
        font-size: 2.5rem;
    }
    
    .demo-panel {
        margin-bottom: 1rem;
    }
    
    .help-btn {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }
    
    .metric-card .metric-value {
        font-size: 1.5rem;
    }
    
    .benefit-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    .help-btn,
    .navbar,
    .panel-actions,
    .modal {
        display: none !important;
    }
    
    .demo-panel {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Custom Select2 Styling */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    min-height: 38px;
}

.select2-container--default .select2-selection--multiple:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: white;
    border-radius: 0.25rem;
    padding: 0 8px;
    margin: 2px;
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dashboard Specific Styles */

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    transition: width 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.sidebar.collapsed .brand-text {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background 0.3s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    font-size: 0.95rem;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav .nav-item.active .nav-link {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-left: 3px solid var(--secondary-color);
}

.sidebar-nav .nav-link i {
    width: 24px;
    margin-right: 1rem;
    font-size: 1.1rem;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .nav-link i {
    margin: 0;
}

.nav-divider {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

/* Theme Switch */
.theme-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: var(--secondary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.sidebar.collapsed .theme-switch {
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar.collapsed .theme-label {
    display: none;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--light-color);
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Topbar */
.topbar {
    background: white;
    height: var(--topbar-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.market-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 2rem;
    font-size: 0.875rem;
}

.notifications {
    position: relative;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--dark-color);
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
}

.btn-icon .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    min-width: 16px;
    text-align: center;
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-width: calc(100vw - 2rem);
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    margin-top: 0.5rem;
}

.notifications-dropdown.show {
    display: block;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.notifications-header h6 {
    margin: 0;
    font-weight: 600;
}

.notifications-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.unread {
    background: #eff6ff;
}

.notification-item.unread:hover {
    background: #dbeafe;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 0.875rem;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: 0.875rem;
    color: #1f2937;
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.notifications-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.notifications-footer a {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
}

.notifications-footer a:hover {
    text-decoration: underline;
}

/* Dark theme notifications */
body.dark-theme .notifications-dropdown {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

body.dark-theme .notifications-header {
    border-bottom-color: var(--border-color);
}

body.dark-theme .notification-item {
    border-bottom-color: var(--border-color);
}

body.dark-theme .notification-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .notification-item.unread {
    background: rgba(59, 130, 246, 0.1);
}

body.dark-theme .notification-text {
    color: var(--text-primary);
}

body.dark-theme .notification-time {
    color: var(--text-secondary);
}

body.dark-theme .notifications-footer {
    border-top-color: var(--border-color);
}

.user-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--dark-color);
    padding: 0.5rem;
}

/* Dashboard Cards */
.card {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-gradient {
    background: var(--gradient-primary);
    color: white;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Metric Cards */
.metric-card {
    position: relative;
    overflow: visible;
    cursor: help;
}

.metric-card .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-primary-light {
    background: rgba(30, 58, 138, 0.1);
}

.bg-success-light {
    background: rgba(16, 185, 129, 0.1);
}

.bg-warning-light {
    background: rgba(245, 158, 11, 0.1);
}

.bg-info-light {
    background: rgba(6, 182, 212, 0.1);
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
}

.metric-change {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.metric-change.positive {
    color: var(--success-color);
}

.metric-change.negative {
    color: var(--danger-color);
}

.metric-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Health Score Badge */
.health-score-badge {
    display: inline-block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.health-score-badge.good {
    background: linear-gradient(135deg, #10b981, #059669);
}

.health-score-badge.fair {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.health-score-badge.poor {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 150px;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--dark-color);
}

.action-btn:hover {
    border-color: var(--primary-color);
    background: rgba(30, 58, 138, 0.05);
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.action-btn span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Chart Controls */
.chart-controls .btn-group .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
}

.chart-controls .btn-group .btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Allocation Legend */
.allocation-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Performer List */
.performer-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.performer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    transition: background 0.3s;
}

.performer-item:hover {
    background: #e5e7eb;
}

.performer-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.performer-symbol {
    font-weight: 600;
    font-size: 0.95rem;
}

.performer-name {
    font-size: 0.75rem;
    color: #6b7280;
}

.performer-change {
    font-weight: 600;
    font-size: 0.95rem;
}

.performer-change.positive {
    color: var(--success-color);
}

.performer-change.negative {
    color: var(--danger-color);
}

/* Activity Timeline */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    align-items: start;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Guided Tour Overlay */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    pointer-events: none;
    overflow: visible;
}

.tour-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-radius: 18px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2000px rgba(15, 23, 42, 0.65);
    transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease, opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.tour-overlay.is-active {
    pointer-events: auto;
}

.tour-tooltip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 420px;
    width: min(420px, 90vw);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 10000;
    pointer-events: auto;
    transition: transform 0.3s ease, top 0.3s ease, left 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tour-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1f2937;
}

.tour-description {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.tour-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.tour-buttons {
    display: flex;
    gap: 0.75rem;
}

.tour-progress {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.tour-actions .btn {
    font-size: 0.875rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

.tour-actions .btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
}

.tour-actions .btn-secondary:hover {
    background: #4b5563;
}

.tour-actions .btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
}

.tour-actions .btn-primary:hover {
    background: #1e40af;
}

/* Mobile Sidebar Toggle */
.sidebar-toggle-mobile {
    display: none;
}

/* Dark Theme Styles */
body.dark-theme {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.dark-theme .card {
    background: var(--card-bg);
    color: var(--text-primary);
}

body.dark-theme .topbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

body.dark-theme .page-title {
    color: var(--text-primary);
}

body.dark-theme .btn-icon {
    color: var(--text-primary);
}

body.dark-theme .metric-label {
    color: var(--text-secondary);
}

body.dark-theme .metric-value {
    color: var(--text-primary);
}

body.dark-theme .performer-item {
    background: var(--bg-primary);
}

body.dark-theme .performer-name {
    color: var(--text-secondary);
}

body.dark-theme .activity-time {
    color: var(--text-secondary);
}

body.dark-theme .action-btn {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .action-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Responsive Dashboard */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle-mobile {
        display: block;
    }
}

@media (max-width: 768px) {
    .quick-actions {
        flex-direction: column;
    }

    .action-btn {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        min-width: unset;
        padding: 0.875rem 1rem;
    }

    .action-btn i {
        font-size: 1.25rem;
    }

    .metric-card .metric-value {
        font-size: 1.25rem;
    }

    .topbar {
        padding: 0 0.75rem;
        height: auto;
        min-height: var(--topbar-height);
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .topbar-left {
        flex: 1;
        min-width: 0;
    }

    .topbar-right {
        gap: 0.75rem;
    }

    .page-title {
        font-size: 1.125rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hide market status text on mobile, show only indicator */
    .market-status-badge .status-text {
        display: none;
    }

    .market-status-badge {
        padding: 0.5rem;
        min-width: 32px;
        justify-content: center;
    }

    /* Hide user name on mobile */
    .user-menu .user-name {
        display: none;
    }

    /* Chart controls - horizontal scroll */
    .chart-controls {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: -0.5rem;
        padding: 0.5rem;
    }

    .chart-controls .btn-group {
        flex-wrap: nowrap;
    }

    .chart-controls .btn-group .btn {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    /* Card header adjustments */
    .card-header {
        padding: 1rem;
    }

    .card-header .d-flex {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start !important;
    }

    .card-header h5 {
        font-size: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Metric cards on mobile */
    .metric-card .card-body {
        padding: 1rem;
        gap: 0.75rem;
    }

    .metric-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .metric-label {
        font-size: 0.75rem;
    }

    /* Welcome section */
    .welcome-section .card-body {
        padding: 1.25rem;
        position: relative;
    }

    .welcome-section h2 {
        font-size: 1.25rem;
        padding-right: 2.5rem;
    }

    .welcome-section p {
        font-size: 0.875rem;
    }

    .welcome-section .row {
        flex-direction: column;
    }

    .welcome-section .col-lg-4 {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        width: auto;
        padding: 0;
    }

    .welcome-section #dismissWelcome {
        padding: 0.25rem;
        font-size: 1.25rem;
        opacity: 0.8;
    }

    /* Activity and performers */
    .performer-item,
    .activity-item {
        padding: 0.75rem 0;
    }

    /* Health score badge */
    .health-score-badge {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 1.25rem;
    }

    /* Allocation legend */
    .allocation-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .legend-item {
        font-size: 0.75rem;
    }

    /* Tour tooltip mobile */
    .tour-tooltip {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: calc(100vw - 2rem) !important;
        max-width: 340px;
        padding: 1.5rem;
        margin: 0;
        z-index: 10001;
    }

    .tour-highlight {
        display: none !important;
    }

    .tour-title {
        font-size: 1.25rem;
    }

    .tour-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .tour-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .tour-actions .btn {
        width: 100%;
    }

    /* Modal improvements */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Extra small devices (phones, 480px and below) */
@media (max-width: 480px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .topbar {
        padding: 0.5rem;
    }

    .topbar-right {
        gap: 0.5rem;
    }

    /* Stack metric cards fully */
    .metric-card .card-body {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .metric-icon {
        margin: 0 auto;
    }

    .metric-value {
        font-size: 1.5rem !important;
    }

    /* Smaller buttons */
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .btn-sm {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Chart controls - even more compact */
    .chart-controls .btn-group .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.6875rem;
    }

    /* Quick actions - full width */
    .action-btn {
        width: 100%;
        flex: none;
    }

    /* Card headers */
    .card-header h5 {
        font-size: 0.9375rem;
    }

    /* Page title */
    .page-title {
        font-size: 1rem;
    }

    /* Hide notification badge count on very small screens */
    .btn-icon .badge {
        min-width: 14px;
        padding: 0.0625rem 0.25rem;
        font-size: 0.5625rem;
    }

    /* Welcome section more compact */
    .welcome-section .card-body {
        padding: 1rem;
    }

    .welcome-section h2 {
        font-size: 1.125rem;
        padding-right: 2rem;
    }

    .welcome-section p {
        font-size: 0.8125rem;
        margin-bottom: 0.75rem !important;
    }

    .welcome-section .btn {
        width: 100%;
    }

    /* Performers list */
    .performer-item {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    /* Activity timeline */
    .activity-icon {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .activity-title {
        font-size: 0.8125rem;
    }

    .activity-time {
        font-size: 0.6875rem;
    }

    /* Tour even more compact */
    .tour-tooltip {
        padding: 1rem;
    }

    .tour-title {
        font-size: 1rem;
    }

    .tour-description {
        font-size: 0.8125rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Minimum touch target size (44px recommended by Apple/Google) */
    .btn,
    .action-btn,
    .nav-link,
    .dropdown-toggle,
    .btn-icon {
        min-height: 44px;
    }

    .sidebar-nav .nav-link {
        padding: 0.875rem 1.5rem;
    }

    /* Remove hover effects that don't work on touch */
    .card:hover {
        box-shadow: var(--shadow-sm);
    }

    .action-btn:hover {
        transform: none;
    }

    /* Active states for touch feedback */
    .btn:active,
    .action-btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    /* Larger tap targets for chart controls */
    .chart-controls .btn-group .btn {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
    }

    /* Easier to tap close buttons */
    .btn-close {
        width: 44px;
        height: 44px;
        padding: 0.75rem;
    }
}

/* Safe area support for notched phones */
@supports (padding: max(0px)) {
    .sidebar {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .main-content {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .topbar {
            padding-left: max(0.75rem, env(safe-area-inset-left));
            padding-right: max(0.75rem, env(safe-area-inset-right));
        }

        .container-fluid {
            padding-left: max(0.75rem, env(safe-area-inset-left));
            padding-right: max(0.75rem, env(safe-area-inset-right));
        }
    }
}

/* Prevent text selection on interactive elements (mobile) */
@media (max-width: 1024px) {
    .btn,
    .action-btn,
    .nav-link,
    .sidebar-toggle,
    .sidebar-toggle-mobile {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
    .main-content {
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    .main-content {
        overflow-x: hidden;
    }
}
