/* Adaptive Text - Light Text on Dark Backgrounds, Dark Text on Light Backgrounds */

/* Core adaptive text using luminance-based contrast */
body.adaptive-mode {
    --text-light: #ffffff;
    --text-dark: #000000;
    --bg-threshold: 0.5;
}

/* Force white text on dark backgrounds and override any gradients */
body.adaptive-mode h1,
body.adaptive-mode h2, 
body.adaptive-mode h3,
body.adaptive-mode h4,
body.adaptive-mode h5,
body.adaptive-mode h6 {
    color: white !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: white !important;
    background-clip: initial !important;
    transition: color 0.3s ease;
}

/* Force white text on navigation */
body.adaptive-mode .navbar,
body.adaptive-mode .navbar *,
body.adaptive-mode .navbar-brand,
body.adaptive-mode .nav-link,
body.adaptive-mode .navbar-nav .nav-link,
body.adaptive-mode .btn,
body.adaptive-mode .btn *,
body.adaptive-mode .forecast-bar,
body.adaptive-mode .forecast-bar *,
body.adaptive-mode .location-permission-request,
body.adaptive-mode .location-permission-request *,
body.adaptive-mode .forecast-sidebar,
body.adaptive-mode .forecast-sidebar *,
body.adaptive-mode #forecastSidebar,
body.adaptive-mode #forecastSidebar *,
body.adaptive-mode .sidebar-emoji,
body.adaptive-mode #sidebarEmoji {
    color: white !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: white !important;
    background-clip: initial !important;
}

body.adaptive-mode p,
body.adaptive-mode span,
body.adaptive-mode a,
body.adaptive-mode .card-title,
body.adaptive-mode .card-text,
body.adaptive-mode .nav-link,
body.adaptive-mode .navbar-brand,
body.adaptive-mode button,
body.adaptive-mode .btn {
    transition: color 0.3s ease;
}

/* Ensure no mix-blend-mode interference */

/* Form elements */
body.adaptive-mode input,
body.adaptive-mode textarea,
body.adaptive-mode select {
    transition: color 0.3s ease;
}

/* Notification text */
body.adaptive-mode .notification-bar .scrolling-text,
body.adaptive-mode .weather-notification-content {
    transition: color 0.3s ease;
}

/* Icons should also adapt like text */
body.adaptive-mode .fa,
body.adaptive-mode .fas, 
body.adaptive-mode .fab,
body.adaptive-mode .far,
body.adaptive-mode i[class*="fa"],
body.adaptive-mode i {
    transition: color 0.3s ease;
}

/* COMPREHENSIVE WHITE TEXT OVERRIDE FOR ALL SUBTITLES AND TEXT */
body *, body *::before, body *::after,
.subtitle, .subtext, .description, .info,
.weather-info, .forecast-info, .status-text,
small, .small, .text-sm, .text-muted,
.card-subtitle, .lead, .help-text,
.form-text, .input-group-text, .badge,
.alert, .toast, .tooltip, .popover {
    color: white !important;
}

/* Fix specific subtitle classes that might be black */
.card-subtitle, .text-muted, .text-secondary,
.help-block, .form-help, .description-text,
.status-indicator, .info-text, .sub-info {
    color: white !important;
}