body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background: #1a1a1a;
    min-height: 100vh;
    color: #f2f2f2;
    padding-top: 70px; /* Space for fixed navbar */
}

.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #262626;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 1000;
    box-sizing: border-box;
    border-bottom: 1px solid #e20074;
}

.logo h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
    color: #e20074;
}

.tabs {
    display: flex;
    gap: 10px;
}

.tab-button {
    background: transparent;
    color: #f2f2f2;
    border: 2px solid transparent;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background 0.3s, color 0.3s, transform 0.2s;
}

.tab-button:hover {
    background: #333;
    transform: translateY(-2px);
}

.tab-button.active {
    background: #e20074;
    color: white;
    font-weight: 700;
}

.container {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.tab-content {
    background: #262626;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    border: 1px solid #333;
    padding: 30px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #333;
}

.header h1, .header h2 {
    margin: 0;
    font-size: 2.2em;
    font-weight: 700;
    color: #e20074;
}

.header p {
    margin: 0;
    font-size: 1.2em;
    color: #f2f2f2;
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-actions .btn {
    font-size: 0.9em;
    padding: 10px 16px;
    margin: 0;
}

.controls {
    display: none;
}

.info-content, .settings-content {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.info-content h3 {
    color: #e20074;
    margin-top: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #e20074;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.settings-content .setting-item {
    margin-bottom: 30px;
}

.settings-content label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #f2f2f2;
    font-size: 1.1em;
}

.settings-content input, .settings-content select {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    box-sizing: border-box;
    background: #333 !important;
    color: #f2f2f2 !important;
    border: 2px solid #444 !important;
    font-size: 1em;
}

.settings-content small {
    display: block;
    margin-top: 10px;
    color: #aaa;
    font-size: 0.9em;
}

.btn {
    background: #e20074 !important;
    color: white !important;
    border: none !important;
    padding: 15px 30px !important;
    border-radius: 25px !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
}

.btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 20px rgba(226, 0, 116, 0.4) !important;
}

.btn:disabled {
    background: #555 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Dark theme for any remaining light elements */
div, span, p {
    color: #f2f2f2;
}

/* Scrollbar dark theme */
::-webkit-scrollbar {
    width: 10px;
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #e20074;
    border-radius: 5px;
}

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

/* Additional modern UI enhancements */

/* Loading animations and effects */
.loading {
    text-align: center;
    padding: 40px;
    color: #f2f2f2;
}

.loading h3, .loading p {
    color: #f2f2f2;
}

.spinner {
    border: 4px solid #333;
    border-top: 4px solid #e20074;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Progress bars and status */
.progress {
    background: linear-gradient(135deg, #333 0%, #262626 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
    border-left: 4px solid #e20074;
    color: #f2f2f2;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.report-container {
    padding: 30px;
}

.date-header {
    background: linear-gradient(135deg, #e20074 0%, #ff008a 100%);
    color: white;
    padding: 20px 25px;
    margin: 40px 0 20px 0; /* Increased top margin for spacing between dates */
    border-radius: 15px;
    font-weight: 600;
    font-size: 1.2em;
    box-shadow: 0 5px 20px rgba(226, 0, 116, 0.3);
}

/* First date header should have less top margin */
.date-header:first-of-type {
    margin-top: 20px;
}

/* Dynamic day summary colors based on health level */
.day-summary {
    margin: 15px 0;
    padding: 15px;
    border-left: 4px solid;
    border-radius: 8px;
    font-weight: 500;
}

.day-summary.excellent {
    background: linear-gradient(135deg, #00d4aa20 0%, #00b89430 100%);
    border-color: #00d4aa;
    color: #f2f2f2;
}

.day-summary.good {
    background: linear-gradient(135deg, #74b9ff20 0%, #0984e330 100%);
    border-color: #74b9ff;
    color: #f2f2f2;
}

.day-summary.fair {
    background: linear-gradient(135deg, #fdcb6e20 0%, #e1705530 100%);
    border-color: #fdcb6e;
    color: #f2f2f2;
}

.day-summary.poor {
    background: linear-gradient(135deg, #e8439320 0%, #d6303130 100%);
    border-color: #e84393;
    color: #f2f2f2;
}

/* Enhanced table styling with better column widths */
.service-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    border-radius: 15px;
    overflow: hidden;
    background: #262626;
    table-layout: fixed; /* Fixed layout for better column control */
}

.service-table th {
    background: linear-gradient(135deg, #333 0%, #262626 100%);
    padding: 20px 15px;
    text-align: left;
    font-weight: 700;
    color: #f2f2f2;
    border-bottom: 2px solid #e20074;
    font-size: 1.1em;
}

.service-table td {
    padding: 18px 15px;
    border-bottom: 1px solid #333;
    vertical-align: top;
    color: #f2f2f2;
    background: #262626;
    transition: background 0.3s;
    word-wrap: break-word;
}

/* Column width distribution */
.service-table th:nth-child(1), .service-table td:nth-child(1) { width: 15%; } /* Service */
.service-table th:nth-child(2), .service-table td:nth-child(2) { width: 10%; } /* Status */
.service-table th:nth-child(3), .service-table td:nth-child(3) { width: 20%; } /* Issues */
.service-table th:nth-child(4), .service-table td:nth-child(4) { width: 10%; } /* Impact */
.service-table th:nth-child(5), .service-table td:nth-child(5) { width: 15%; } /* Sources */
.service-table th:nth-child(6), .service-table td:nth-child(6) { width: 30%; } /* Notes */

/* Center align status and impact columns */
.service-table th:nth-child(2), .service-table td:nth-child(2),
.service-table th:nth-child(4), .service-table td:nth-child(4) {
    text-align: center;
}

/* Notes column styling for better readability */
.service-table td:nth-child(6) {
    line-height: 1.4;
    font-size: 0.9em;
    max-height: 80px;
    overflow-y: auto;
}

/* Sources column styling */
.sources-cell {
    font-size: 0.85em;
    max-width: 150px;
    word-wrap: break-word;
}

.sources-cell a {
    color: #74b9ff;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin: 2px 0;
    padding: 2px 6px;
    background: rgba(116, 185, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(116, 185, 255, 0.3);
    transition: all 0.3s ease;
}

.sources-cell a:hover {
    background: rgba(116, 185, 255, 0.2);
    border-color: #74b9ff;
    transform: translateY(-1px);
}

/* Status badges with background colors */
.status-excellent {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(0, 212, 170, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    text-align: center;
}

.status-good {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(116, 185, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    text-align: center;
}

.status-fair {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(253, 203, 110, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    text-align: center;
}

.status-poor {
    background: linear-gradient(135deg, #e84393 0%, #d63031 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(232, 67, 147, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    text-align: center;
}

/* Health chart styling */
.health-chart-container {
    background: linear-gradient(135deg, #333 0%, #262626 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #444;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.health-chart-container h3 {
    color: #e20074;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
}

.health-chart {
    width: 100%;
    height: 300px;
    background: #1a1a1a;
    border-radius: 10px;
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
}

/* Interactive chart cursor */
.health-chart {
    cursor: crosshair;
    transition: filter 0.2s ease;
}

.health-chart:hover {
    filter: brightness(1.05);
}

/* Notification system */
.notification {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
}

.notification.error {
    background: linear-gradient(135deg, #e84393 0%, #d63031 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
}

.notification.info {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.notification button {
    background: rgba(255,255,255,0.2) !important;
    border: none !important;
    color: white !important;
    width: 25px !important;
    height: 25px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.notification button:hover {
    background: rgba(255,255,255,0.3) !important;
}

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

/* Compact view styles */
.container.compact-view .tab-content {
    padding: 15px;
}

.container.compact-view .header {
    padding: 15px;
    margin-bottom: 15px;
}

.container.compact-view .header h1,
.container.compact-view .header h2 {
    font-size: 1.8em;
}

.container.compact-view .service-table th,
.container.compact-view .service-table td {
    padding: 12px 10px;
    font-size: 0.9em;
}

.container.compact-view .date-header {
    padding: 15px 20px;
    margin: 25px 0 15px 0;
    font-size: 1.1em;
}

.container.compact-view .summary {
    padding: 20px;
    margin-bottom: 20px;
}

.container.compact-view .health-chart-container {
    padding: 20px;
    margin-bottom: 25px;
}

.container.compact-view .health-chart {
    height: 250px;
}

.container.compact-view .info-card {
    padding: 20px;
    margin-bottom: 15px;
}

.container.compact-view .settings-group {
    padding: 20px;
    margin-bottom: 20px;
}

/* Light theme styles */
body.light-theme {
    background: #f5f5f5;
    color: #333;
}

body.light-theme .top-navbar {
    background: #fff;
    border-bottom: 1px solid #e20074;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body.light-theme .logo h1 {
    color: #e20074;
}

body.light-theme .tab-button {
    color: #333;
}

body.light-theme .tab-button:hover {
    background: #f0f0f0;
}

body.light-theme .tab-content {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
}

body.light-theme .header {
    border-bottom: 1px solid #ddd;
}

body.light-theme .service-table {
    background: #fff;
}

body.light-theme .service-table th {
    background: #f8f9fa;
    color: #333;
    border-bottom: 2px solid #e20074;
}

body.light-theme .service-table td {
    background: #fff;
    color: #333;
    border-bottom: 1px solid #ddd;
}

body.light-theme .service-table tr:hover {
    background: #f8f9fa;
}

body.light-theme .info-card,
body.light-theme .settings-group {
    background: #f8f9fa;
    border: 1px solid #ddd;
}

body.light-theme .health-chart-container {
    background: #f8f9fa;
    border: 1px solid #ddd;
}

body.light-theme .health-chart {
    background: #fff;
    border: 1px solid #ddd;
}

body.light-theme .day-summary {
    color: #333;
}

body.light-theme div, 
body.light-theme span, 
body.light-theme p {
    color: #333;
}

body.light-theme ::-webkit-scrollbar {
    background: #f5f5f5;
}

body.light-theme ::-webkit-scrollbar-thumb {
    background: #e20074;
}

/* Cache and status indicators */
.cache-indicator, .fresh-indicator {
    font-size: 0.8em;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: 500;
}

.cache-indicator {
    background: rgba(116, 185, 255, 0.2);
    color: #74b9ff;
    border: 1px solid #74b9ff;
}

.fresh-indicator {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
    border: 1px solid #00d4aa;
}

.cache-info {
    background: rgba(116, 185, 255, 0.1);
    border: 1px solid #74b9ff;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 0.9em;
    color: #74b9ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-small {
    background: #6c5ce7;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    margin-left: 10px;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #5a4fcf;
    transform: translateY(-1px);
}

.error {
    background: rgba(214, 48, 49, 0.1);
    border: 1px solid #d63031;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.error h3, .error h4 {
    color: #d63031;
    margin-top: 0;
}

/* Enhanced progress display */
.progress {
    background: rgba(116, 185, 255, 0.1);
    border: 1px solid #74b9ff;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

.progress strong {
    color: #74b9ff;
}

/* Export Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #2a2a2a;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #444;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background: linear-gradient(135deg, #e20074, #74b9ff);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 30px;
    color: #f2f2f2;
}

.modal-body p {
    margin-bottom: 20px;
    font-size: 1.1em;
    opacity: 0.9;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.export-option {
    background: #333;
    border: 2px solid #444;
    border-radius: 10px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #f2f2f2;
}

.export-option:hover {
    background: #404040;
    border-color: #74b9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(116, 185, 255, 0.2);
}

.export-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.export-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.export-desc {
    font-size: 0.9em;
    opacity: 0.7;
}

.modal-footer {
    padding: 20px 30px;
    text-align: right;
    border-top: 1px solid #444;
    background: #252525;
    border-radius: 0 0 12px 12px;
}

.modal-footer .btn {
    background: #666;
    margin: 0;
}

.modal-footer .btn:hover {
    background: #777;
}

/* Tooltip styles for chart and table interactions */
.chart-tooltip, .table-tooltip {
    position: fixed;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: #f2f2f2;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e20074;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(226, 0, 116, 0.3);
    z-index: 10000;
    display: none;
    font-size: 0.9em;
    max-width: 300px;
    pointer-events: none;
    backdrop-filter: blur(10px);
    animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.tooltip-header {
    font-weight: 700;
    color: #e20074;
    font-size: 1.1em;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #444;
}

.tooltip-date {
    color: #74b9ff;
    font-size: 0.85em;
    margin-bottom: 8px;
    font-style: italic;
}

.tooltip-score {
    margin-bottom: 6px;
}

.tooltip-score strong {
    color: #00d4aa;
    font-weight: 700;
}

.tooltip-status {
    margin-bottom: 6px;
}

.tooltip-status .status-excellent {
    color: #00d4aa;
    font-weight: 600;
}

.tooltip-status .status-good {
    color: #74b9ff;
    font-weight: 600;
}

.tooltip-status .status-fair {
    color: #fdcb6e;
    font-weight: 600;
}

.tooltip-status .status-poor {
    color: #e84393;
    font-weight: 600;
}

.tooltip-issues {
    margin-bottom: 6px;
    color: #fdcb6e;
    font-size: 0.85em;
    line-height: 1.3;
}

.tooltip-impact {
    color: #e84393;
    font-size: 0.85em;
    font-weight: 500;
}

.tooltip-section {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
    line-height: 1.4;
}

.tooltip-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tooltip-section strong {
    color: #e20074;
    display: block;
    margin-bottom: 4px;
}

/* Light theme tooltip adjustments */
body.light-theme .chart-tooltip,
body.light-theme .table-tooltip {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #333;
    border: 1px solid #e20074;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 20px rgba(226, 0, 116, 0.2);
}

body.light-theme .tooltip-header {
    color: #e20074;
    border-bottom: 1px solid #ddd;
}

body.light-theme .tooltip-date {
    color: #0984e3;
}

body.light-theme .tooltip-score strong {
    color: #00b894;
}

body.light-theme .tooltip-section {
    border-bottom: 1px solid #eee;
}

body.light-theme .tooltip-section strong {
    color: #e20074;
}

/* Responsive tooltip adjustments */
@media (max-width: 768px) {
    .chart-tooltip, .table-tooltip {
        max-width: 250px;
        font-size: 0.8em;
        padding: 10px 12px;
    }
    
    .tooltip-header {
        font-size: 1em;
    }
}

/* Performance optimizations */
.service-table {
    /* ...existing properties... */
    will-change: transform; /* Optimize for animations */
}

.health-chart {
    /* ...existing properties... */
    will-change: filter; /* Optimize for hover effects */
}

.chart-tooltip, .table-tooltip {
    /* ...existing properties... */
    will-change: transform, opacity; /* Optimize for positioning */
}
}

body.light-theme .tooltip-section {
    border-bottom: 1px solid #eee;
}

body.light-theme .tooltip-section strong {
    color: #e20074;
}

body.light-theme .service-table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    box-shadow: 0 8px 25px rgba(226, 0, 116, 0.3);
}

/* Responsive tooltip adjustments */
@media (max-width: 768px) {
    .chart-tooltip, .table-tooltip {
        max-width: 250px;
        font-size: 0.8em;
        padding: 10px 12px;
    }
    
    .tooltip-header {
        font-size: 1em;
    }
}
