/* ==================== PREMIUM ENTERPRISE CSS ==================== */

/* Import Inter font family */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* CSS Variables for Dynamic Theming */
:root {
    --color-primary-50: #f0f9ff;
    --color-primary-100: #e0f2fe;
    --color-primary-200: #bae6fd;
    --color-primary-300: #7dd3fc;
    --color-primary-400: #38bdf8;
    --color-primary-500: #0ea5e9;
    --color-primary-600: #0284c7;
    --color-primary-700: #0369a1;
    --color-primary-800: #075985;
    --color-primary-900: #0c4a6e;

    --color-accent-purple-400: #c084fc;
    --color-accent-purple-500: #a855f7;
    --color-accent-purple-600: #9333ea;
    --color-accent-cyan-500: #06b6d4;
    --color-accent-amber-500: #f59e0b;

    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;

    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(203, 213, 225, 0.6);
    --glass-shadow: rgba(0, 0, 0, 0.1);

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;

    --animation-duration: 0.3s;
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.2);

    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
}

/* Global Styles */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Smooth color transitions */
* {
    transition-property: color, background-color, border-color;
    transition-duration: var(--animation-duration);
    transition-timing-function: var(--animation-timing);
}

/* Prevent transition on initial load */
.preload * {
    transition: none !important;
}

/* ==================== ANIMATED BACKGROUND ==================== */

html {
    background: #551C85;
}

body {
    position: relative;
    overflow-x: hidden;
    background: #f0f9ff;
    color: var(--text-primary);
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

.dark .animated-bg {
    background: linear-gradient(135deg, #121212 0%, #1a1a1a 50%, #121212 100%);
}

.dark html {
    background: #121212;
}

.dark body {
    background: #121212;
}

/* ==================== DARK MODE VARIANTS ==================== */

/* OLED Black - Pure black for OLED screens */
.dark.dark-oled .animated-bg {
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #000000 100%);
}

.dark.dark-oled html,
.dark.dark-oled body {
    background: #000000;
}

.dark.dark-oled .glass,
.dark.dark-oled .glass-strong {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
}

.dark.dark-oled .premium-card {
    background: rgba(10, 10, 10, 0.9);
}

/* Dark Grey - Default (#121212) */
.dark.dark-grey .animated-bg {
    background: linear-gradient(135deg, #121212 0%, #1a1a1a 50%, #121212 100%);
}

.dark.dark-grey html,
.dark.dark-grey body {
    background: #121212;
}

/* Blue-Grey - Cool blue tint */
.dark.dark-blue-grey .animated-bg {
    background: linear-gradient(135deg, #0f1419 0%, #151f28 50%, #0f1419 100%);
}

.dark.dark-blue-grey html,
.dark.dark-blue-grey body {
    background: #0f1419;
}

.dark.dark-blue-grey .glass,
.dark.dark-blue-grey .glass-strong {
    background: rgba(15, 20, 25, 0.7);
    border-color: rgba(100, 150, 200, 0.15);
}

.dark.dark-blue-grey .premium-card {
    background: rgba(20, 27, 35, 0.8);
    border-color: rgba(100, 150, 200, 0.1);
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Mesh gradient overlay */
.mesh-gradient {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(at 27% 37%, rgba(14, 165, 233, 0.15) 0px, transparent 50%),
        radial-gradient(at 97% 21%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
        radial-gradient(at 52% 99%, rgba(6, 182, 212, 0.15) 0px, transparent 50%),
        radial-gradient(at 10% 29%, rgba(245, 158, 11, 0.15) 0px, transparent 50%),
        radial-gradient(at 97% 96%, rgba(14, 165, 233, 0.15) 0px, transparent 50%),
        radial-gradient(at 33% 50%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
    opacity: 1;
    animation: mesh-float 20s ease-in-out infinite;
}

@keyframes mesh-float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -30px); }
    66% { transform: translate(-20px, 20px); }
}

/* Grain texture overlay */
.grain-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

/* ==================== GLASSMORPHISM EFFECTS ==================== */

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.glass-strong {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
}

/* Premium navigation glass */
.nav-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 20px -5px rgba(0, 0, 0, 0.03);
}

.dark .nav-glass {
    background: rgba(17, 24, 39, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 20px -5px rgba(0, 0, 0, 0.2);
}

/* ==================== NAVIGATION TEXT COLORS ==================== */

/* Navigation header title - gradient with solid color fallback */
nav h1 {
    /* Solid color fallback if gradient fails to render */
    color: #111827 !important; /* gray-900 */
}

.dark nav h1 {
    color: #ffffff !important; /* white in dark mode */
}

/* Support for gradient text when bg-clip-text is used */
nav h1.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Explicit gradient for light mode */
nav h1.bg-clip-text.bg-gradient-to-r {
    background-image: linear-gradient(to right, #111827, #1e3a8a, #581c87);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Explicit gradient for dark mode */
.dark nav h1.bg-clip-text.bg-gradient-to-r {
    background-image: linear-gradient(to right, #ffffff, #dbeafe, #e9d5ff);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Navigation subtitle */
nav p {
    color: #4b5563 !important; /* gray-600 */
}

.dark nav p {
    color: #d1d5db !important; /* gray-300 */
}

/* Navigation buttons - general */
nav button {
    color: #374151 !important; /* gray-700 */
}

.dark nav button {
    color: #e5e7eb !important; /* gray-200 */
}

/* Secondary buttons specifically */
nav .btn-secondary {
    color: #374151 !important; /* gray-700 */
}

.dark nav .btn-secondary {
    color: #e5e7eb !important; /* gray-200 */
}

/* Icon buttons */
nav .btn-icon {
    color: #4b5563 !important; /* gray-600 */
}

.dark nav .btn-icon {
    color: #d1d5db !important; /* gray-300 */
}

/* Primary button text (should always be white on gradient) */
nav .btn-primary {
    color: #ffffff !important;
}

/* Export dropdown menu background */
#exportMenu {
    background: #ffffff;
    border-color: #e5e7eb;
}

.dark #exportMenu {
    background: #1f2937;
    border-color: #374151;
}

/* Export dropdown menu items */
nav #exportMenu button {
    color: #374151 !important; /* gray-700 */
}

.dark nav #exportMenu button {
    color: #e5e7eb !important; /* gray-200 */
}

/* Advanced export option with blue accent */
nav #exportMenu button[onclick*="toggleExportOptionsModal"] {
    color: #1d4ed8 !important; /* blue-700 */
}

.dark nav #exportMenu button[onclick*="toggleExportOptionsModal"] {
    color: #60a5fa !important; /* blue-400 */
}

/* Navigation SVG icons inherit color from parent */
nav svg {
    color: currentColor;
}

/* Preserve colored icons in export menu (they have specific color classes) */
nav #exportMenu svg {
    /* Let Tailwind color classes apply to these icons */
    color: inherit;
}

/* ==================== SIDEBAR TEXT COLORS ==================== */

/* Sidebar category navigation buttons */
#sidebarNav a,
#sidebarNav button {
    color: #374151 !important; /* gray-700 for light mode */
    background: rgba(255, 255, 255, 0.6) !important; /* Light semi-transparent background */
    border: 1px solid rgba(203, 213, 225, 0.5) !important; /* Subtle border */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; /* Smooth transitions */
}

.dark #sidebarNav a,
.dark #sidebarNav button {
    color: #d1d5db !important; /* gray-300 for dark mode */
    background: rgba(55, 65, 81, 0.5) !important; /* Dark gray background */
    border: 1px solid rgba(255, 255, 255, 0.1) !important; /* Subtle light border */
}

/* Category button hover state */
#sidebarNav a:hover,
#sidebarNav button:hover {
    color: #0ea5e9 !important; /* Sky blue on hover in light mode */
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(168, 85, 247, 0.15)) !important; /* Blue-purple gradient */
    border-color: #0ea5e9 !important; /* Sky blue border */
    transform: translateX(4px); /* Slight slide effect */
    box-shadow: 0 4px 6px rgba(14, 165, 233, 0.2); /* Blue glow */
}

.dark #sidebarNav a:hover,
.dark #sidebarNav button:hover {
    color: #ffffff !important; /* White on hover in dark mode */
    background: rgba(75, 85, 99, 0.7) !important; /* Lighter gray on hover */
    border-color: rgba(255, 255, 255, 0.2) !important; /* Brighter border */
}

/* Quick Actions button text and borders */
.glass-strong button {
    color: #374151 !important; /* gray-700 for light mode */
    border: 1px solid #cbd5e1 !important; /* gray-300 border */
    background: rgba(255, 255, 255, 0.5) !important; /* Subtle white background */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; /* Smooth transitions */
}

.dark .glass-strong button {
    color: #e5e7eb !important; /* gray-200 for dark mode */
    border: 1px solid rgba(255, 255, 255, 0.2) !important; /* Subtle white border */
    background: rgba(255, 255, 255, 0.05) !important; /* Very subtle background */
}

/* Quick Actions button hover */
.glass-strong button:hover {
    color: #ffffff !important; /* White text on hover */
    border-color: #0ea5e9 !important; /* Sky blue border */
    background: linear-gradient(135deg, #0ea5e9, #a855f7) !important; /* Blue to purple gradient */
    transform: translateY(-2px); /* Lift effect */
    box-shadow: 0 6px 12px rgba(14, 165, 233, 0.3); /* Enhanced blue glow */
}

.dark .glass-strong button:hover {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important; /* Brighter border on hover */
    background: rgba(255, 255, 255, 0.1) !important; /* Slightly stronger background */
}

/* Clear History button (red text) - special case */
button[onclick="clearHistory()"] {
    color: #dc2626 !important; /* red-600 for light mode */
}

button[onclick="clearHistory()"]:hover {
    color: #ffffff !important; /* White text on hover */
    background: linear-gradient(135deg, #dc2626, #ef4444) !important; /* Red gradient */
    border-color: #dc2626 !important; /* Red border */
    transform: translateY(-2px); /* Lift effect */
    box-shadow: 0 6px 12px rgba(220, 38, 38, 0.3); /* Red glow */
}

.dark button[onclick="clearHistory()"] {
    color: #f87171 !important; /* red-400 for dark mode */
}

.dark button[onclick="clearHistory()"]:hover {
    color: #ffffff !important; /* White text on hover */
    background: linear-gradient(135deg, #ef4444, #f87171) !important; /* Lighter red gradient */
    border-color: #ef4444 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.4);
}

/* ==================== FOOTER TEXT COLORS & HOVER EFFECTS ==================== */

/* Footer background gradient - light mode */
footer {
    background: linear-gradient(to bottom right, #f9fafb, #dbeafe, #f3e8ff) !important;
    border-top: 1px solid #e5e7eb !important;
}

/* Footer background gradient - dark mode */
.dark footer {
    background: linear-gradient(to bottom right, #111827, #172554, #581c87) !important;
    border-top: 1px solid #1f2937 !important;
}

/* Footer main heading - "ZeroDataUpload.com" */
footer h2 {
    color: #111827 !important; /* gray-900 for light mode */
}

.dark footer h2 {
    color: #ffffff !important; /* white for dark mode */
}

/* Footer subtitle - "Privacy-first web utilities..." */
footer > div > div:first-child > p:first-of-type {
    color: #374151 !important; /* gray-700 for light mode */
}

.dark footer > div > div:first-child > p:first-of-type {
    color: #d1d5db !important; /* gray-300 for dark mode */
}

/* Footer description paragraphs */
footer p {
    color: #4b5563 !important; /* gray-600 for light mode */
}

.dark footer p {
    color: #9ca3af !important; /* gray-400 for dark mode */
}

/* Footer column headings (Legal, Company, Support) */
footer h3 {
    color: #111827 !important; /* gray-900 for light mode */
}

.dark footer h3 {
    color: #ffffff !important; /* white for dark mode */
}

/* Footer column heading icons - maintain their colors */
footer h3 svg {
    color: inherit !important;
}

/* Footer links - default state */
footer a {
    color: #374151 !important; /* gray-700 for light mode */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.dark footer a {
    color: #d1d5db !important; /* gray-300 for dark mode */
}

/* Footer link hover - Legal column (blue) */
footer .grid > div:nth-child(1) a:hover {
    color: #0284c7 !important; /* sky-600 for light mode */
}

.dark footer .grid > div:nth-child(1) a:hover {
    color: #38bdf8 !important; /* sky-400 for dark mode */
}

/* Footer link hover - Company column (purple) */
footer .grid > div:nth-child(2) a:hover {
    color: #9333ea !important; /* purple-600 for light mode */
}

.dark footer .grid > div:nth-child(2) a:hover {
    color: #c084fc !important; /* purple-400 for dark mode */
}

/* Footer link hover - Support column (cyan) */
footer .grid > div:nth-child(3) a:hover {
    color: #0891b2 !important; /* cyan-600 for light mode */
}

.dark footer .grid > div:nth-child(3) a:hover {
    color: #22d3ee !important; /* cyan-400 for dark mode */
}

/* Footer link underline effect on hover */
footer a:hover span.group-hover\:underline {
    text-decoration: underline !important;
}

/* Copyright section text */
footer .border-t p {
    color: #4b5563 !important; /* gray-600 for light mode */
}

.dark footer .border-t p {
    color: #9ca3af !important; /* gray-400 for dark mode */
}

/* Copyright - company name bold */
footer .border-t span.font-semibold {
    color: #111827 !important; /* gray-900 for light mode */
}

.dark footer .border-t span.font-semibold {
    color: #ffffff !important; /* white for dark mode */
}

/* "Built with love" text - intentionally subtle */
footer .border-t p:last-child {
    color: #6b7280 !important; /* gray-500 for both modes - subtle */
}

.dark footer .border-t p:last-child {
    color: #6b7280 !important; /* intentionally same - subtle in both modes */
}

/* Sidebar section headings (CATEGORIES, QUICK ACTIONS) */
aside h3,
.glass-strong h3,
aside .text-xs.font-semibold {
    color: #111827 !important; /* gray-900 for light mode */
}

.dark aside h3,
.dark .glass-strong h3,
.dark aside .text-xs.font-semibold {
    color: #ffffff !important; /* white for dark mode */
}

/* Sidebar section icons */
aside svg,
.glass-strong svg {
    color: inherit !important;
    fill: currentColor !important;
}

/* ==================== PREMIUM CARD DESIGN ==================== */

.premium-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.05),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    /* Performance optimizations */
    contain: layout style paint;
}

.premium-card:hover {
    will-change: transform, box-shadow;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        var(--color-primary-500),
        var(--color-accent-purple-500),
        var(--color-accent-cyan-500)
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.premium-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(14, 165, 233, 0.1),
        0 0 40px -10px rgba(14, 165, 233, 0.3);
}

.premium-card:hover::before {
    opacity: 1;
}

/* ==================== BUTTON STYLES ==================== */

.btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-accent-purple-600));
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3), 0 2px 4px -1px rgba(14, 165, 233, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-icon:hover {
    will-change: transform;
}

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

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.4), 0 4px 6px -2px rgba(14, 165, 233, 0.3);
}

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

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* Button loading state */
.btn-primary.loading,
.btn-secondary.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-primary.loading::after,
.btn-secondary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

.btn-primary.loading > span,
.btn-secondary.loading > span {
    opacity: 0;
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary-400);
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.2);
}

.btn-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--glass-bg);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* ==================== FORM CONTROLS ==================== */

.input-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-glass:focus {
    outline: 3px solid var(--color-primary-500);
    outline-offset: 2px;
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15),
                0 0 20px rgba(14, 165, 233, 0.25);
    transform: translateY(-1px);
}

.dark .input-glass:focus {
    outline: 3px solid var(--color-primary-400);
    border-color: var(--color-primary-400);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25),
                0 0 20px rgba(56, 189, 248, 0.35);
}

/* Custom select styling */
select.input-glass {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230ea5e9'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5rem;
}

.dark select.input-glass {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d1d5db'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

/* Disabled input/select styling */
select.input-glass:disabled,
input.input-glass:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dark select.input-glass:disabled,
.dark input.input-glass:disabled {
    opacity: 0.5;
    color: var(--color-gray-300);
}

/* Select option elements - cross-browser dark mode fix */
select.input-glass option {
    background-color: white;
    color: #111827; /* gray-900 */
}

.dark select.input-glass option {
    background-color: #1f2937; /* gray-800 */
    color: #f3f4f6; /* gray-100 */
}

/* ==================== PREMIUM SCROLLBAR ==================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-primary-400), var(--color-accent-purple-500));
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-primary-500), var(--color-accent-purple-600));
    background-clip: padding-box;
}

.dark ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-primary-600), var(--color-accent-purple-600));
    background-clip: padding-box;
}

/* ==================== ANIMATIONS & KEYFRAMES ==================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 20px currentColor;
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 30px currentColor;
    }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes success-checkmark {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(45deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(45deg);
        opacity: 1;
    }
}

@keyframes button-success {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(0.9); }
    20%, 40% { transform: scale(1.1); }
}

/* Animation classes */
.animate-fadeIn { animation: fadeIn 0.5s ease-out; }
.animate-slideUp { animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-slideIn { animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-scaleIn { animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-success-checkmark { animation: success-checkmark 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.animate-heartbeat { animation: heartbeat 1.5s ease-in-out infinite; }

/* Button loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.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 0.6s linear infinite;
}

.btn-loading.btn-primary::after {
    border-top-color: white;
}

.btn-loading.btn-secondary::after {
    border-top-color: #0ea5e9;
}

/* Success state */
.btn-success {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
    color: white !important;
}

/* Status indicators with pulse */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-glow 2s ease-in-out infinite;
}

.status-online { background-color: #10b981; color: #10b981; }
.status-excellent { background-color: #0ea5e9; color: #0ea5e9; }
.status-good { background-color: #10b981; color: #10b981; }
.status-warning { background-color: #f59e0b; color: #f59e0b; }
.status-danger { background-color: #ef4444; color: #ef4444; }

/* Stagger delays for card animations */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ==================== LOADING SKELETON ==================== */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(226, 232, 240, 0.5) 0%,
        rgba(226, 232, 240, 0.8) 50%,
        rgba(226, 232, 240, 0.5) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

.dark .skeleton {
    background: linear-gradient(
        90deg,
        rgba(30, 41, 59, 0.5) 0%,
        rgba(51, 65, 85, 0.8) 50%,
        rgba(30, 41, 59, 0.5) 100%
    );
}

/* ==================== STATUS INDICATORS ==================== */

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-online {
    color: #10b981;
    background-color: #10b981;
}
.status-excellent {
    color: #10b981;
    background-color: #10b981;
}
.status-good {
    color: #3b82f6;
    background-color: #3b82f6;
}
.status-warning {
    color: #f59e0b;
    background-color: #f59e0b;
}
.status-danger {
    color: #ef4444;
    background-color: #ef4444;
}

/* ==================== PROGRESS BARS ==================== */

.progress-bar-fill {
    background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-purple-500));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

/* ==================== MODAL ANIMATIONS ==================== */

.modal-backdrop {
    animation: fadeIn 0.3s ease-out;
}

.modal-panel {
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== TOOLTIPS ==================== */

.tooltip {
    position: absolute;
    z-index: 1000;
    padding: 8px 12px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    color: white;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: 250px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== COLLAPSIBLE CONTENT ==================== */

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapsible-content.expanded {
    max-height: 3000px;
}

/* ==================== CARD CONTENT TEXT COLORS ==================== */

/* Ensure card content always has proper text colors regardless of Tailwind */
.collapsible-content span,
.collapsible-content p,
.collapsible-content div {
    color: #1f2937; /* gray-900 for light mode */
}

.dark .collapsible-content span,
.dark .collapsible-content p,
.dark .collapsible-content div {
    color: #ffffff; /* white for dark mode */
}

/* Key-value pairs in cards - keys (left side) */
.collapsible-content span.text-sm:not(.font-medium) {
    color: #4b5563 !important; /* gray-600 for keys */
}

.dark .collapsible-content span.text-sm:not(.font-medium) {
    color: #d1d5db !important; /* gray-300 for keys in dark mode */
}

/* Value text (right side - has font-medium class) */
.collapsible-content .font-medium {
    color: #111827 !important; /* gray-900 for values */
}

.dark .collapsible-content .font-medium {
    color: #ffffff !important; /* white for values in dark mode */
}

/* Card headers and titles */
.premium-card h3,
.premium-card .text-lg,
.premium-card .text-xl {
    color: #111827 !important; /* gray-900 for headings */
}

.dark .premium-card h3,
.dark .premium-card .text-lg,
.dark .premium-card .text-xl {
    color: #ffffff !important; /* white for headings in dark mode */
}

/* Buttons and interactive elements */
.premium-card button {
    color: #374151; /* gray-700 */
}

.dark .premium-card button {
    color: #d1d5db; /* gray-300 in dark mode */
}

/* Quick Stats and glass-strong panels */
.glass-strong p,
.glass-strong span,
.glass-strong div {
    color: #111827; /* gray-900 for light mode */
}

.dark .glass-strong p,
.dark .glass-strong span,
.dark .glass-strong div {
    color: #ffffff; /* white for dark mode */
}

/* Ensure all headings have proper colors */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

/* Paragraphs and general text */
p {
    color: var(--text-secondary);
}

/* ==================== CHART CONTAINER ==================== */

.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
}

/* ==================== HIGHLIGHT SEARCH RESULTS ==================== */

.highlight {
    background: linear-gradient(120deg, #fef08a 0%, #fbbf24 100%);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.2);
}

.dark .highlight {
    background: linear-gradient(120deg, #854d0e 0%, #a16207 100%);
    color: #fef08a;
}

/* ==================== DROPDOWN ANIMATIONS ==================== */

.dropdown-enter {
    animation: slideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== FOCUS STATES (Accessibility) ==================== */

/* Enhanced focus indicators for WCAG 2.2 compliance */
*:focus-visible {
    outline: 3px solid var(--color-primary-500);
    outline-offset: 3px;
    border-radius: 6px;
    box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.15);
}

/* Dark theme focus enhancement */
.dark *:focus-visible {
    outline: 3px solid var(--color-primary-400);
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.25);
}

/* Button and link specific focus styles */
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--color-primary-500);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.2),
                0 4px 12px rgba(14, 165, 233, 0.3);
}

.dark button:focus-visible,
.dark a:focus-visible {
    outline: 3px solid var(--color-primary-400);
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.3),
                0 4px 12px rgba(56, 189, 248, 0.4);
}

/* Card focus styles */
.premium-card:focus-visible {
    outline: 3px solid var(--color-primary-500);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.15),
                0 8px 16px -4px rgba(14, 165, 233, 0.2);
    transform: translateY(-2px);
}

.dark .premium-card:focus-visible {
    outline: 3px solid var(--color-primary-400);
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.25),
                0 8px 16px -4px rgba(56, 189, 248, 0.3);
}

/* ==================== HIGH CONTRAST MODE ==================== */

.high-contrast {
    --color-primary-500: #0066cc;
    --color-primary-600: #0052a3;
}

.high-contrast.dark {
    --color-primary-400: #66b3ff;
    --color-primary-500: #3399ff;
}

.high-contrast body {
    background: #ffffff !important;
}

.high-contrast.dark body {
    background: #000000 !important;
}

.high-contrast .glass,
.high-contrast .glass-strong {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid #000000 !important;
}

.high-contrast.dark .glass,
.high-contrast.dark .glass-strong {
    background: rgba(0, 0, 0, 0.95) !important;
    border: 2px solid #ffffff !important;
}

.high-contrast .premium-card {
    border: 3px solid #000000 !important;
    box-shadow: none !important;
}

.high-contrast.dark .premium-card {
    border: 3px solid #ffffff !important;
}

.high-contrast .text-gray-700 {
    color: #000000 !important;
}

.high-contrast.dark .text-gray-200,
.high-contrast.dark .text-gray-300 {
    color: #ffffff !important;
}

.high-contrast button,
.high-contrast .btn-primary,
.high-contrast .btn-secondary {
    border: 2px solid #000000 !important;
}

.high-contrast.dark button,
.high-contrast.dark .btn-primary,
.high-contrast.dark .btn-secondary {
    border: 2px solid #ffffff !important;
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==================== PRINT STYLES ==================== */

@media print {
    /* Hide non-essential elements */
    .no-print { display: none !important; }
    .animated-bg,
    .mesh-gradient,
    .grain-overlay {
        display: none !important;
    }

    /* Reset backgrounds to white for better printing */
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Premium cards */
    .premium-card {
        border: 1px solid #000 !important;
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 1rem;
        padding: 1rem;
    }

    /* Add page breaks between categories */
    .premium-card[data-category]:not(:first-child) {
        page-break-before: auto;
    }

    /* Headers */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        font-weight: bold !important;
    }

    /* Print header with title and date */
    body::before {
        content: "System Intelligence Platform Report";
        display: block;
        font-size: 24px;
        font-weight: bold;
        text-align: center;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #000;
    }

    body::after {
        content: "Generated: " attr(data-print-date);
        display: block;
        font-size: 10px;
        text-align: center;
        margin-top: 2rem;
        padding-top: 0.5rem;
        border-top: 1px solid #000;
    }

    /* Show toggle switches as text */
    .toggle-switch {
        display: inline-block !important;
        width: auto !important;
        height: auto !important;
    }

    .toggle-switch input:checked + .toggle-slider::after {
        content: "ON";
        position: static;
        width: auto;
        height: auto;
        background: none;
        font-weight: bold;
    }

    .toggle-switch input:not(:checked) + .toggle-slider::after {
        content: "OFF";
        position: static;
        width: auto;
        height: auto;
        background: none;
        font-weight: bold;
    }

    .toggle-slider::before {
        display: none !important;
    }

    /* Links */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }

    a[href^="#"]::after,
    a[href^="javascript:"]::after {
        content: "";
    }

    /* Page numbers */
    @page {
        margin: 2cm;
    }

    /* Optimize for black and white printing */
    .badge,
    .glass,
    .glass-strong {
        border: 1px solid #000 !important;
        background: white !important;
    }
}

/* ==================== SIDEBAR ==================== */

.sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* ==================== GRADIENT TEXT ==================== */

.gradient-text {
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-accent-purple-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== BADGE STYLES ==================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.badge-primary {
    background: rgba(14, 165, 233, 0.1);
    color: var(--color-primary-600);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.dark .badge-primary {
    background: rgba(14, 165, 233, 0.2);
    color: var(--color-primary-400);
}

/* ==================== CUSTOM TRANSITIONS ==================== */

.transition-all-smooth {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-transform-smooth {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== PREMIUM LINK STYLES ==================== */

a:not(.btn-primary):not(.btn-secondary):not(.btn-icon) {
    position: relative;
    display: inline-block;
    color: var(--color-primary-600);
    text-decoration: none;
    transition: color 0.3s ease;
}

.dark a:not(.btn-primary):not(.btn-secondary):not(.btn-icon) {
    color: var(--color-primary-400);
}

a:not(.btn-primary):not(.btn-secondary):not(.btn-icon):hover {
    color: var(--color-accent-purple-600);
}

.dark a:not(.btn-primary):not(.btn-secondary):not(.btn-icon):hover {
    color: var(--color-accent-purple-400);
}

/* Gradient underline effect */
a:not(.btn-primary):not(.btn-secondary):not(.btn-icon)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-purple-500), var(--color-accent-cyan-500));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:not(.btn-primary):not(.btn-secondary):not(.btn-icon):hover::after {
    width: 100%;
}

/* ==================== SPRING BOUNCE ANIMATION ==================== */

@keyframes springBounce {
    0% { transform: scale(1); }
    25% { transform: scale(1.15); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animate-spring-bounce {
    animation: springBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Enhanced checkbox with spring effect (when .animate-spring-bounce is added) */
input[type="checkbox"]:checked {
    transform-origin: center;
}

/* ==================== FLOATING LABELS ==================== */

.floating-label-container {
    position: relative;
}

.floating-label {
    position: absolute;
    left: 2.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: var(--color-gray-500);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    background: transparent;
    padding: 0 0.25rem;
}

.dark .floating-label {
    color: var(--color-gray-300);
}

/* Float label when input is focused or has content */
.floating-label-container input:focus ~ .floating-label,
.floating-label-container input.has-content ~ .floating-label {
    top: -0.5rem;
    left: 2.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-bg);
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-accent-purple-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark .floating-label-container input:focus ~ .floating-label,
.dark .floating-label-container input.has-content ~ .floating-label {
    background: linear-gradient(135deg, var(--color-primary-400), var(--color-accent-purple-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hide placeholder when not focused to prevent overlap */
.floating-label-container input:not(:focus)::placeholder {
    opacity: 0;
}

.floating-label-container input.has-content::placeholder {
    opacity: 0;
}

/* ==================== CUSTOM TOGGLE SWITCHES ==================== */

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

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark .toggle-slider {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

/* The sliding knob */
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2.5px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dark .toggle-slider::before {
    background: #e5e7eb;
}

/* Checked state */
.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-accent-purple-500));
    border: 1px solid transparent;
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.1),
                0 4px 6px -1px rgba(14, 165, 233, 0.2),
                inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Focus state - Enhanced for WCAG 2.2 */
.toggle-switch input:focus-visible + .toggle-slider {
    outline: 3px solid var(--color-primary-500);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.2);
}

.dark .toggle-switch input:focus-visible + .toggle-slider {
    outline: 3px solid var(--color-primary-400);
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.3);
}

.toggle-switch input:focus-visible:checked + .toggle-slider {
    box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.25),
                0 4px 6px -1px rgba(14, 165, 233, 0.3),
                inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

/* Hover state */
.toggle-slider:hover {
    border-color: rgba(14, 165, 233, 0.3);
}

.toggle-switch input:checked + .toggle-slider:hover {
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-accent-purple-600));
}

/* Disabled state */
.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .toggle-slider,
    .toggle-slider::before {
        transition: none;
    }
}

/* ==================== SPARKLINE STYLES ==================== */
.sparkline-container {
    display: block;
    width: 100%;
    padding: 4px 0;
    margin-top: 4px;
}

.sparkline-canvas {
    display: block;
    width: 100%;
    height: 24px;
    border-radius: 4px;
    background: transparent;
    transition: opacity 0.3s ease;
}

/* Tooltip on hover */
.sparkline-canvas:hover {
    opacity: 0.85;
    cursor: crosshair;
}

/* Print styles - hide sparklines in print */
@media print {
    .sparkline-container,
    .sparkline-canvas {
        display: none !important;
    }
}

/* ==================== GAUGE CHART STYLES ==================== */
.gauge-container {
    display: inline-block;
    position: relative;
}

.gauge-canvas {
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.gauge-canvas:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Animation for gauge appearance */
@keyframes gaugeAppear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.gauge-canvas {
    animation: gaugeAppear 0.5s ease-out;
}

/* Print styles - hide gauges in print */
@media print {
    .gauge-container,
    .gauge-canvas {
        display: none !important;
    }
}

/* Responsive sizing for smaller screens */
@media (max-width: 640px) {
    .gauge-canvas {
        width: 60px !important;
        height: 60px !important;
    }
}

/* ==================== SETTINGS MODAL LIGHT MODE FIX (Phase 6) ==================== */
/* Fix text visibility issues in Settings modal for light mode */
/* Same root cause: Tailwind JIT doesn't generate utility classes from HTML */

/* 1. Modal Panel Background - ensure opacity for readability */
#settingsModal .glass-strong {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(203, 213, 225, 0.6) !important;
}

.dark #settingsModal .glass-strong {
    background: rgba(31, 41, 55, 0.98) !important;
    border: 1px solid rgba(75, 85, 99, 0.4) !important;
}

/* 2. Section Container Backgrounds - make them more opaque */
#settingsModal .rounded-xl.bg-gray-50\/50 {
    background: rgba(249, 250, 251, 0.95) !important;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.dark #settingsModal .rounded-xl.bg-gray-50\/50 {
    background: rgba(31, 41, 55, 0.95) !important;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

/* Alternative selector for section containers */
#settingsModal > div > div > div > div > div.p-4 {
    background: rgba(249, 250, 251, 0.95) !important;
}

.dark #settingsModal > div > div > div > div > div.p-4 {
    background: rgba(31, 41, 55, 0.95) !important;
}

/* 3. Modal Title */
#settingsModal h3#settings-title {
    color: #111827 !important; /* gray-900 */
}

.dark #settingsModal h3#settings-title {
    color: #ffffff !important;
}

/* 4. All Section Headings (font-semibold labels) */
#settingsModal .text-sm.font-semibold,
#settingsModal span.text-sm.font-semibold {
    color: #374151 !important; /* gray-700 */
}

.dark #settingsModal .text-sm.font-semibold,
.dark #settingsModal span.text-sm.font-semibold {
    color: #e5e7eb !important; /* gray-200 */
}

/* 5. Description Text (text-xs) */
#settingsModal .text-xs,
#settingsModal p.text-xs {
    color: #4b5563 !important; /* gray-600 */
}

.dark #settingsModal .text-xs,
.dark #settingsModal p.text-xs {
    color: #9ca3af !important; /* gray-400 */
}

/* 6. Select Dropdown Text */
#settingsModal select {
    color: #111827 !important; /* gray-900 */
    background: rgba(255, 255, 255, 0.9) !important;
}

.dark #settingsModal select {
    color: #ffffff !important;
    background: rgba(55, 65, 81, 0.9) !important;
}

/* 7. Select Options */
#settingsModal select option {
    color: #111827 !important;
    background: #ffffff !important;
}

.dark #settingsModal select option {
    color: #ffffff !important;
    background: #1f2937 !important;
}

/* 8. Storage Usage Text */
#settingsModal #storagePercentage {
    color: #6b7280 !important; /* gray-500 */
}

.dark #settingsModal #storagePercentage {
    color: #d1d5db !important; /* gray-300 */
}

#settingsModal #storageUsed,
#settingsModal #storageQuota {
    color: #4b5563 !important; /* gray-600 */
}

.dark #settingsModal #storageUsed,
.dark #settingsModal #storageQuota {
    color: #d1d5db !important; /* gray-300 */
}

/* 9. Warning Message Amber Text */
#settingsModal .text-xs.text-amber-600 {
    color: #d97706 !important; /* amber-600 */
}

.dark #settingsModal .text-xs.text-amber-600 {
    color: #fbbf24 !important; /* amber-400 */
}

/* 10. Storage Warning Box */
#settingsModal #storageWarning {
    background: rgba(254, 243, 199, 0.9) !important; /* amber-100 */
    border-color: #fcd34d !important; /* amber-300 */
}

.dark #settingsModal #storageWarning {
    background: rgba(120, 53, 15, 0.3) !important; /* amber-900/30 */
    border-color: #78350f !important; /* amber-900 */
}

#settingsModal #storageWarning p {
    color: #92400e !important; /* amber-800 */
}

.dark #settingsModal #storageWarning p {
    color: #fde68a !important; /* amber-200 */
}

/* 11. Radio Button Labels - Main Text */
#settingsModal input[type="radio"] + div .text-sm.font-medium {
    color: #111827 !important; /* gray-900 */
}

.dark #settingsModal input[type="radio"] + div .text-sm.font-medium {
    color: #f3f4f6 !important; /* gray-100 */
}

/* 12. Radio Button Labels - Description Text */
#settingsModal input[type="radio"] + div .text-xs {
    color: #6b7280 !important; /* gray-500 */
}

.dark #settingsModal input[type="radio"] + div .text-xs {
    color: #9ca3af !important; /* gray-400 */
}

/* 13. Label Elements in Radio/Checkbox Sections */
#settingsModal label .text-gray-600 {
    color: #4b5563 !important; /* gray-600 */
}

.dark #settingsModal label .text-gray-600 {
    color: #d1d5db !important; /* gray-300 */
}

/* 14. Accent Color Labels */
#settingsModal label span.text-xs {
    color: #374151 !important; /* gray-700 */
}

.dark #settingsModal label span.text-xs {
    color: #d1d5db !important; /* gray-300 */
}

/* 15. Alert Settings Text */
#settingsModal #alertSettings span {
    color: #4b5563 !important; /* gray-600 */
}

.dark #settingsModal #alertSettings span {
    color: #d1d5db !important; /* gray-300 */
}

/* 16. Clear Old Data Button (Secondary Button with Background) */
#settingsModal button[onclick="clearOldData()"] {
    background: rgba(255, 255, 255, 0.9) !important; /* Near-opaque white */
    border: 1px solid #cbd5e1 !important; /* gray-300 border */
}

.dark #settingsModal button[onclick="clearOldData()"] {
    background: rgba(55, 65, 81, 0.8) !important; /* gray-700 at 80% */
    border: 1px solid rgba(148, 163, 184, 0.4) !important; /* gray-400 at 40% */
}

/* Clear Old Data button hover */
#settingsModal button[onclick="clearOldData()"]:hover {
    background: rgba(243, 244, 246, 1) !important; /* Solid gray-100 */
    border-color: #0ea5e9 !important; /* sky-500 border on hover */
}

.dark #settingsModal button[onclick="clearOldData()"]:hover {
    background: rgba(75, 85, 99, 0.9) !important; /* gray-600 at 90% */
    border-color: #0ea5e9 !important; /* sky-500 border on hover */
}

/* Clear Old Data button text */
#settingsModal button[onclick="clearOldData()"] span {
    color: #374151 !important; /* gray-700 */
}

.dark #settingsModal button[onclick="clearOldData()"] span {
    color: #e5e7eb !important; /* gray-200 */
}

/* Clear Old Data button SVG icon - keep trash bin visible on hover */
#settingsModal button[onclick="clearOldData()"] svg {
    color: #374151 !important; /* gray-700 - always dark */
}

#settingsModal button[onclick="clearOldData()"]:hover svg {
    color: #1f2937 !important; /* gray-800 - even darker on hover */
}

.dark #settingsModal button[onclick="clearOldData()"] svg {
    color: #e5e7eb !important; /* gray-200 */
}

.dark #settingsModal button[onclick="clearOldData()"]:hover svg {
    color: #ffffff !important; /* white on hover in dark mode */
}

/* 17. Export/Import Settings Buttons (Secondary Buttons with Background) */
#settingsModal button[onclick="exportSettings()"],
#settingsModal button[onclick="importSettings()"] {
    background: rgba(255, 255, 255, 0.9) !important; /* Near-opaque white */
    border: 1px solid #cbd5e1 !important; /* gray-300 border */
}

.dark #settingsModal button[onclick="exportSettings()"],
.dark #settingsModal button[onclick="importSettings()"] {
    background: rgba(55, 65, 81, 0.8) !important; /* gray-700 at 80% */
    border: 1px solid rgba(148, 163, 184, 0.4) !important; /* gray-400 at 40% */
}

/* Export/Import buttons hover */
#settingsModal button[onclick="exportSettings()"]:hover,
#settingsModal button[onclick="importSettings()"]:hover {
    background: rgba(243, 244, 246, 1) !important; /* Solid gray-100 */
    border-color: #0ea5e9 !important; /* sky-500 border on hover */
}

.dark #settingsModal button[onclick="exportSettings()"]:hover,
.dark #settingsModal button[onclick="importSettings()"]:hover {
    background: rgba(75, 85, 99, 0.9) !important; /* gray-600 at 90% */
    border-color: #0ea5e9 !important; /* sky-500 border on hover */
}

/* Export/Import button text */
#settingsModal button[onclick="exportSettings()"] span,
#settingsModal button[onclick="importSettings()"] span {
    color: #374151 !important; /* gray-700 */
}

.dark #settingsModal button[onclick="exportSettings()"] span,
.dark #settingsModal button[onclick="importSettings()"] span {
    color: #e5e7eb !important; /* gray-200 */
}

/* Export/Import button SVG icons - keep visible on hover */
#settingsModal button[onclick="exportSettings()"] svg,
#settingsModal button[onclick="importSettings()"] svg {
    color: #374151 !important; /* gray-700 - always dark */
}

#settingsModal button[onclick="exportSettings()"]:hover svg,
#settingsModal button[onclick="importSettings()"]:hover svg {
    color: #1f2937 !important; /* gray-800 - even darker on hover */
}

.dark #settingsModal button[onclick="exportSettings()"] svg,
.dark #settingsModal button[onclick="importSettings()"] svg {
    color: #e5e7eb !important; /* gray-200 */
}

.dark #settingsModal button[onclick="exportSettings()"]:hover svg,
.dark #settingsModal button[onclick="importSettings()"]:hover svg {
    color: #ffffff !important; /* white on hover in dark mode */
}

/* 18. Reset to Defaults Button (Red with Background) */
#settingsModal button[onclick="resetApp()"] {
    color: #dc2626 !important; /* red-600 */
    background: rgba(254, 226, 226, 0.6) !important; /* red-100 at 60% opacity */
    border: 1px solid #fca5a5 !important; /* red-300 border */
}

.dark #settingsModal button[onclick="resetApp()"] {
    color: #f87171 !important; /* red-400 */
    background: rgba(127, 29, 29, 0.3) !important; /* red-900 at 30% opacity */
    border: 1px solid rgba(248, 113, 113, 0.3) !important; /* red-400 at 30% */
}

/* Reset button hover states */
#settingsModal button[onclick="resetApp()"]:hover {
    background: rgba(254, 226, 226, 0.95) !important; /* Increase opacity on hover */
    border-color: #f87171 !important; /* red-400 border */
    color: #b91c1c !important; /* red-700 - darker text */
}

.dark #settingsModal button[onclick="resetApp()"]:hover {
    background: rgba(127, 29, 29, 0.5) !important; /* Increase opacity */
    border-color: rgba(248, 113, 113, 0.5) !important; /* Brighter border */
    color: #fca5a5 !important; /* red-300 - lighter text */
}

#settingsModal button[onclick="resetApp()"] span {
    color: inherit !important;
}

/* Reset button SVG icon - keep circular arrows visible */
#settingsModal button[onclick="resetApp()"] svg {
    color: #dc2626 !important; /* red-600 - match button color */
}

#settingsModal button[onclick="resetApp()"]:hover svg {
    color: #b91c1c !important; /* red-700 - darker on hover */
}

.dark #settingsModal button[onclick="resetApp()"] svg {
    color: #f87171 !important; /* red-400 */
}

.dark #settingsModal button[onclick="resetApp()"]:hover svg {
    color: #fca5a5 !important; /* red-300 - lighter on hover */
}

/* 19. Close Button (Primary with Gradient) */
#settingsModal .btn-primary {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0284c7, #9333ea) !important; /* Sky-600 to Purple-600 */
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3), 0 2px 4px -1px rgba(14, 165, 233, 0.2) !important;
}

#settingsModal .btn-primary:hover {
    background: linear-gradient(135deg, #0369a1, #7e22ce) !important; /* Darker on hover */
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.4), 0 4px 6px -2px rgba(14, 165, 233, 0.3) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* 20. Modal Footer Border */
#settingsModal .border-t {
    border-color: rgba(229, 231, 235, 0.5) !important;
}

.dark #settingsModal .border-t {
    border-color: rgba(75, 85, 99, 0.5) !important;
}

/* 21. All Paragraph Tags in Settings Modal */
#settingsModal p {
    color: #4b5563 !important; /* gray-600 */
}

.dark #settingsModal p {
    color: #9ca3af !important; /* gray-400 */
}

/* 22. All Span Tags in Settings Modal (general fallback) */
#settingsModal span {
    color: #374151 !important; /* gray-700 */
}

.dark #settingsModal span {
    color: #d1d5db !important; /* gray-300 */
}

/* 23. SVG Icons - inherit color from parent */
#settingsModal svg {
    color: inherit !important;
}

/* 24. ESC Key Badge */
#settingsModal kbd {
    color: #6b7280 !important; /* gray-500 */
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(209, 213, 219, 0.6) !important;
}

.dark #settingsModal kbd {
    color: #d1d5db !important; /* gray-300 */
    background: rgba(55, 65, 81, 0.6) !important;
    border-color: rgba(107, 114, 128, 0.5) !important;
}

/* 25. Radio Button Hover States */
#settingsModal label:hover {
    background: rgba(243, 244, 246, 0.8) !important; /* gray-100 */
}

.dark #settingsModal label:hover {
    background: rgba(55, 65, 81, 0.5) !important; /* gray-700 */
}
