/* ====================================
   VELORA UNIFIED THEME SYSTEM
   Consolidated Theme Management
   ==================================== */

:root {
    /* ===== LIGHT MODE VARIABLES (DEFAULT) ===== */
    
    /* Background Colors */
    --velora-bg-primary: #FFFFFF;
    --velora-bg-secondary: #F8F9FA;
    --velora-bg-tertiary: #F1F3F4;
    --velora-bg-card: rgba(248, 249, 250, 0.8);
    --velora-bg-overlay: rgba(255, 255, 255, 0.95);
    --velora-bg-hover: rgba(107, 70, 193, 0.08);
    
    /* Text Colors */
    --velora-text-primary: #1A1A1A;
    --velora-text-secondary: #4A4A4A;
    --velora-text-muted: #808080;
    --velora-text-inverse: #FFFFFF;
    
    /* Accent Colors */
    --velora-accent-primary: #6B46C1;
    --velora-accent-secondary: #3B82F6;
    --velora-accent-tertiary: #EC4899;
    --velora-accent-gold: #D4AF37;
    
    /* Border Colors */
    --velora-border-primary: rgba(0, 0, 0, 0.1);
    --velora-border-secondary: rgba(0, 0, 0, 0.05);
    --velora-border-hover: rgba(107, 70, 193, 0.3);
    
    /* Shadows */
    --velora-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --velora-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
    --velora-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
    --velora-shadow-glow: 0 0 20px rgba(107, 70, 193, 0.2);
    
    /* Gradients */
    --velora-gradient-primary: linear-gradient(135deg, #6B46C1 0%, #3B82F6 100%);
    --velora-gradient-secondary: linear-gradient(135deg, #EC4899 0%, #D4AF37 100%);
    --velora-gradient-cosmic: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 50%, #F1F3F4 100%);
    
    /* Status Colors */
    --velora-success: #10B981;
    --velora-warning: #F59E0B;
    --velora-error: #EF4444;
    --velora-info: #3B82F6;
    
    /* Brand Colors */
    --velora-cosmic-gold: #D4AF37;
    --velora-cosmic-violet: #6C63FF;
    --velora-cosmic-purple: #8B5CF6;
    --velora-deep-space-blue: #0D1B2A;
    --velora-stellar-gold: #FFD700;
    --velora-nebula-amber: #FFA500;
    --velora-aurora-cyan: #4CC9F0;
    --velora-moonlight-white: #F8F9FA;
    --velora-star-dust-gray: #ADB5BD;
    --velora-celestial-white: #FFFFFF;
    --velora-soft-lavender: #E9E7FF;
    --velora-deep-indigo: #4B3F72;
    --velora-pastel-pink: #FFD6E0;
    --velora-sky-blue: #A6E1FA;
    --velora-midnight-gray: #343A40;
    --velora-silver-mist: #DEE2E6;
    
    /* Element Colors */
    --velora-element-fire: #FF6B6B;
    --velora-element-earth: #8B7355;
    --velora-element-air: #74B9FF;
    --velora-element-water: #4ECDC4;
    
    /* Zodiac Colors */
    --velora-zodiac-aries: #FF6B6B;
    --velora-zodiac-taurus: #66BB6A;
    --velora-zodiac-gemini: #FFA726;
    --velora-zodiac-cancer: #42A5F5;
    --velora-zodiac-leo: #FFD54F;
    --velora-zodiac-virgo: #8D6E63;
    --velora-zodiac-libra: #EC407A;
    --velora-zodiac-scorpio: #AB47BC;
    --velora-zodiac-sagittarius: #7E57C2;
    --velora-zodiac-capricorn: #5C6BC0;
    --velora-zodiac-aquarius: #29B6F6;
    --velora-zodiac-pisces: #26C6DA;
}

/* ===== LEGACY VARIABLE MAPPINGS ===== */
:root {
    /* Add missing legacy CSS variables that are used throughout the codebase */
    --bg-card: var(--velora-bg-card);
    --border-subtle: var(--border-subtle, var(--velora-border-subtle, #e0d6ff));
    --accent-gold: var(--velora-accent-gold);
    --accent-purple: var(--velora-accent-primary);
    --text-accent: var(--velora-accent-primary);
    --card-radius: var(--radius-card, 16px);
    --card-shadow: var(--shadow-soft, var(--velora-shadow-soft));
    
    /* Map new cosmic tokens to existing velora variables for backward compatibility */
    --velora-bg-page: var(--bg-page, #f5f3ff);
    --velora-bg-surface: var(--bg-surface, #ffffff);
    --velora-primary-600: var(--primary-600, #5b3fd9);
    --velora-primary-500: var(--primary-500, #7b5cff);
    --velora-primary-100: var(--primary-100, #ebe4ff);
    --velora-text-strong: var(--text-strong, #151022);
    --velora-text-default: var(--text-default, #2a203f);
    --velora-text-soft: var(--text-soft, #6b6288);
    --velora-text-muted: var(--text-muted, #9a92b5);
    
    /* Map commonly used legacy variables to new --velora-* variables */
    --bg-color: var(--velora-bg-primary);
    --bg-secondary: var(--velora-bg-secondary);
    --bg-tertiary: var(--velora-bg-tertiary);
    --card-bg: var(--velora-bg-card);
    --card-border: var(--velora-border-secondary);
    
    --text-primary: var(--velora-text-primary);
    --text-secondary: var(--velora-text-secondary);
    --text-muted: var(--velora-text-muted);
    --text-inverse: var(--velora-text-inverse);
    
    --primary-color: var(--velora-accent-primary);
    --secondary-color: var(--velora-accent-secondary);
    --accent-color: var(--velora-accent-gold);
    --cosmic-violet: var(--velora-cosmic-violet);
    --cosmic-purple: var(--velora-cosmic-purple);
    
    --border-color: var(--velora-border-primary);
    --input-bg: var(--velora-bg-primary);
    --input-border: var(--velora-border-primary);
    --input-focus-border: var(--velora-accent-primary);
    
    --link-color: var(--velora-accent-primary);
    --link-hover: var(--velora-accent-secondary);
    
    --nav-bg: var(--velora-bg-card);
    --nav-text: var(--velora-text-primary);
    --nav-hover: var(--velora-accent-primary);
    
    --dashboard-bg: var(--velora-bg-primary);
    --dashboard-card-bg: var(--velora-bg-card);
    --dashboard-text: var(--velora-text-primary);
    --dashboard-text-secondary: var(--velora-text-secondary);
    --dashboard-border: var(--velora-border-primary);
    --dashboard-hover: var(--velora-bg-hover);
    
    --shadow-sm: var(--velora-shadow-sm);
    --shadow-md: var(--velora-shadow-md);
    --shadow-lg: var(--velora-shadow-lg);
    
    /* Color system mappings */
    /* Note: Legacy --color-primary, --color-secondary, and --color-accent intentionally map to gold/amber tokens
       instead of purple/blue primary accents. This preserves the visual semantics of legacy pages that expect
       gold-based color schemes for the Velora brand palette. For new implementations, use --velora-accent-primary,
       --velora-accent-secondary, or --velora-accent-tertiary for purple/blue/pink accents. */
    --color-primary: var(--velora-accent-gold);
    --color-secondary: var(--velora-stellar-gold);
    --color-accent: var(--velora-nebula-amber);
    --color-bg-primary: var(--velora-bg-primary);
    --color-bg-secondary: var(--velora-bg-secondary);
    --color-bg-tertiary: var(--velora-bg-tertiary);
    --color-bg-card: var(--velora-bg-card);
    --color-bg-overlay: var(--velora-bg-overlay);
    --color-text-primary: var(--velora-text-primary);
    --color-text-secondary: var(--velora-text-secondary);
    --color-text-muted: var(--velora-text-muted);
    --color-text-inverse: var(--velora-text-inverse);
    --color-link: var(--velora-accent-primary);
    --color-link-hover: var(--velora-accent-secondary);
    --color-success: var(--velora-success);
    --color-warning: var(--velora-warning);
    --color-error: var(--velora-error);
    --color-info: var(--velora-info);
    --color-border-primary: var(--velora-border-primary);
    --color-border-secondary: var(--velora-border-secondary);
    
    /* Theme system mappings */
    --primary-bg: var(--velora-bg-primary);
    --secondary-bg: var(--velora-bg-secondary);
    --tertiary-bg: var(--velora-bg-tertiary);
    --primary-text: var(--velora-text-primary);
    --secondary-text: var(--velora-text-secondary);
    --muted-text: var(--velora-text-muted);
    --accent-primary: var(--velora-accent-primary);
    --accent-secondary: var(--velora-accent-secondary);
    --accent-tertiary: var(--velora-accent-tertiary);
    --accent-success: var(--velora-success);
    --accent-danger: var(--velora-error);
    --border-hover: var(--velora-border-hover);
    --shadow-glow: var(--velora-shadow-glow);
    --gradient-primary: var(--velora-gradient-primary);
    --gradient-secondary: var(--velora-gradient-secondary);
    --gradient-cosmic: var(--velora-gradient-cosmic);
    --overlay-bg: var(--velora-bg-overlay);
    --backdrop-blur: 12px;
}

/* ===== DARK MODE VARIABLES ===== */
[data-theme="dark"] {
    /* Background Colors */
    --velora-bg-primary: #0F0F0F;
    --velora-bg-secondary: #1A1A1A;
    --velora-bg-tertiary: #262626;
    --velora-bg-card: rgba(26, 26, 26, 0.8);
    --velora-bg-overlay: rgba(15, 15, 15, 0.95);
    --velora-bg-hover: rgba(107, 70, 193, 0.08);
    
    /* Text Colors */
    --velora-text-primary: #FFFFFF;
    --velora-text-secondary: #B3B3B3;
    --velora-text-muted: #808080;
    --velora-text-inverse: #0F0F0F;
    
    /* Accent Colors (consistent) */
    --velora-accent-primary: #6B46C1;
    --velora-accent-secondary: #3B82F6;
    --velora-accent-tertiary: #EC4899;
    --velora-accent-gold: #D4AF37;
    
    /* Border Colors */
    --velora-border-primary: rgba(255, 255, 255, 0.1);
    --velora-border-secondary: rgba(255, 255, 255, 0.05);
    --velora-border-hover: rgba(107, 70, 193, 0.3);
    
    /* Shadows (darker for dark mode) */
    --velora-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --velora-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --velora-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --velora-shadow-glow: 0 0 20px rgba(107, 70, 193, 0.2);
    
    /* Gradients (adjusted for dark mode) */
    --velora-gradient-primary: linear-gradient(135deg, #6B46C1 0%, #3B82F6 100%);
    --velora-gradient-secondary: linear-gradient(135deg, #EC4899 0%, #D4AF37 100%);
    --velora-gradient-cosmic: linear-gradient(135deg, #0F0F0F 0%, #1A1A1A 50%, #262626 100%);
    
    /* Status Colors (consistent) */
    --velora-success: #10B981;
    --velora-warning: #F59E0B;
    --velora-error: #EF4444;
    --velora-info: #3B82F6;
}

/* ===== GLOBAL THEME APPLICATION ===== */

body {
    background: var(--velora-bg-primary);
    color: var(--velora-text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== COMPONENT STYLES ===== */

/* Cards - Base card styles are now in cards.css */
/* Only utility classes and non-card specific selectors remain here */
.bg-white {
    background: var(--bg-surface, var(--velora-bg-card)) !important;
    color: var(--text-default, var(--velora-text-primary));
    border: 1px solid var(--border-subtle, var(--velora-border-secondary));
    border-radius: var(--radius-card, 16px);
    box-shadow: var(--shadow-soft, var(--velora-shadow-md));
    transition: all 0.3s ease;
}

/* Legacy card classes (zodiac-card, horoscope-card, calculator-card, info-card) 
   are now handled by the unified card system in cards.css */

/* Text Colors */
h1, h2, h3, h4, h5, h6 {
    color: var(--velora-text-primary);
}


.text-primary {
    color: var(--velora-text-primary) !important;
}

.text-secondary {
    color: var(--velora-text-secondary) !important;
}

.text-muted {
    color: var(--velora-text-muted) !important;
}

.text-dark {
    color: var(--velora-text-primary) !important;
}

/* Links */
a:not(.btn):not(.nav-link):not(.dropdown-item) {
    color: var(--velora-accent-primary);
    transition: color 0.3s ease;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    color: var(--velora-accent-secondary);
}

/* Forms */
input,
textarea,
select {
    background: var(--velora-bg-primary) !important;
    border: 1px solid var(--velora-border-primary) !important;
    color: var(--velora-text-primary) !important;
    transition: all 0.3s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--velora-text-muted) !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--velora-accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1) !important;
}

label {
    color: var(--velora-text-primary);
}

/* Buttons */
.btn {
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--velora-gradient-primary);
    border: none;
    color: var(--velora-text-inverse);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--velora-shadow-glow);
}

.btn-secondary {
    background: var(--velora-bg-secondary);
    border: 1px solid var(--velora-border-primary);
    color: var(--velora-text-primary);
}

.btn-secondary:hover {
    background: var(--velora-bg-tertiary);
    border-color: var(--velora-accent-primary);
}

/* Navigation */
.nav {
    background: var(--velora-bg-card) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--velora-border-primary);
}

.nav-link {
    color: var(--velora-text-primary) !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--velora-accent-primary) !important;
}

.dropdown-content {
    background: var(--velora-bg-card) !important;
    border: 1px solid var(--velora-border-primary);
    box-shadow: var(--velora-shadow-lg);
}

.dropdown-content a {
    color: var(--velora-text-primary) !important;
}

.dropdown-content a:hover {
    background: var(--velora-bg-secondary) !important;
    color: var(--velora-accent-primary) !important;
}

/* Tables */
table {
    color: var(--velora-text-primary);
    background: var(--velora-bg-card);
}

th {
    background: var(--velora-bg-secondary);
    color: var(--velora-text-primary);
    border-color: var(--velora-border-primary);
}

td {
    color: var(--velora-text-secondary);
    border-color: var(--velora-border-secondary);
}

/* Badges and Tags */
.badge,
.tag {
    background: rgba(107, 70, 193, 0.1) !important;
    color: var(--velora-accent-primary) !important;
    border: 1px solid rgba(107, 70, 193, 0.2);
}

/* Sections */
section {
    background: var(--velora-bg-primary);
}

.section-alt {
    background: var(--velora-bg-secondary);
}

/* Grid Items */
.grid-item,
.list-item {
    background: var(--velora-bg-card);
    border: 1px solid var(--velora-border-secondary);
    color: var(--velora-text-primary);
}

.grid-item:hover,
.list-item:hover {
    background: var(--velora-bg-secondary);
    border-color: var(--velora-accent-primary);
}

/* Horoscope Specific */
.horoscope-content p {
    color: var(--velora-text-secondary) !important;
}

.horoscope-details {
    background: var(--velora-bg-secondary);
    border: 1px solid var(--velora-border-secondary);
}

.detail-item {
    background: var(--velora-bg-primary);
    border-left: 3px solid var(--velora-accent-primary);
}

.detail-item h4 {
    color: var(--velora-accent-primary) !important;
}

.detail-item p {
    color: var(--velora-text-secondary) !important;
}

/* Star Ratings */
.star-rating i {
    color: var(--velora-accent-gold);
}

/* Lucky Items */
.lucky-items {
    background: var(--velora-bg-secondary);
    border: 1px solid var(--velora-border-secondary);
}

.lucky-item {
    color: var(--velora-text-primary);
}

/* ===== UNIFIED CARD COMPONENT SYSTEM ===== */
/* Note: .velora-card is mapped to the new .card system in cards.css for consistency */
/* Base styles are defined in cards.css - only variant-specific styles remain here */

/* Base Card - Inherits from cards.css, only decorative differences here */
.velora-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Variants (.velora-card-feature, .velora-card-info, .velora-card-compact) 
   are defined in cards.css to maintain consistency with the unified card system */

/* Form Card Variant - Unique to velora-card, not in base system */
.velora-card-form {
    max-width: 600px;
    margin: 0 auto;
}

/* ===== UNIFIED FORM INPUT COMPONENT SYSTEM ===== */

/* Base Input */
.velora-input {
    background: var(--velora-bg-primary);
    border: 2px solid var(--velora-border-primary);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--velora-text-primary);
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
}

.velora-input:focus {
    outline: none;
    border-color: var(--velora-accent-primary);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.velora-input::placeholder {
    color: var(--velora-text-muted);
    opacity: 0.7;
}

/* Input Error State */
.velora-input-error {
    border-color: var(--velora-error);
    background: rgba(239, 68, 68, 0.05);
}

/* Input Success State */
.velora-input-success {
    border-color: var(--velora-success);
    background: rgba(16, 185, 129, 0.05);
}

/* Form Group Wrapper */
.velora-form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Form Label */
.velora-form-label {
    font-weight: 500;
    color: var(--velora-text-primary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form Error Message */
.velora-form-error {
    color: var(--velora-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Form Hint Text */
.velora-form-hint {
    color: var(--velora-text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Footer */
.footer {
    background: var(--velora-bg-secondary);
    color: var(--velora-text-primary);
    border-top: 1px solid var(--velora-border-primary);
}

.footer a {
    color: var(--velora-text-secondary);
}

.footer a:hover {
    color: var(--velora-accent-primary);
}

/* Mobile Menu */
.mobile-menu {
    background: var(--velora-bg-overlay);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.mobile-menu-content {
    background: var(--velora-bg-card);
    border: 1px solid var(--velora-border-primary);
}

.mobile-nav-link {
    color: var(--velora-text-primary) !important;
}

.mobile-nav-link:hover {
    background: var(--velora-bg-secondary) !important;
    color: var(--velora-accent-primary) !important;
}

.mobile-dropdown a {
    color: var(--velora-text-secondary) !important;
}

.mobile-dropdown a:hover {
    background: var(--velora-bg-secondary) !important;
    color: var(--velora-accent-primary) !important;
}

/* ===== THEME TOGGLE STYLING ===== */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--velora-bg-tertiary);
    border: 2px solid var(--velora-border-primary);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    border-color: var(--velora-border-hover);
    box-shadow: var(--velora-shadow-glow);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: calc(100% - 24px - 2px);
    width: 22px;
    height: 22px;
    background: var(--velora-gradient-secondary);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle::after { content: ''; }

.theme-toggle .theme-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: var(--velora-text-inverse);
    z-index: 3;
    pointer-events: none;
}

[data-theme="dark"] .theme-toggle::before { 
    left: 2px;
    background: var(--velora-gradient-primary);
}

[data-theme="light"] .theme-toggle::after { content: ''; }

/* Mobile theme toggle */
.mobile-theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--velora-bg-card);
    border: 1px solid var(--velora-border-primary);
    border-radius: 8px;
    color: var(--velora-text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.mobile-theme-toggle:hover {
    background: var(--velora-bg-secondary);
    border-color: var(--velora-border-hover);
}

.mobile-theme-toggle .mobile-theme-icon {
    font-size: 16px;
    transition: all 0.3s ease;
    color: var(--velora-accent-primary);
}

/* ===== BACKGROUND EFFECTS ===== */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.6;
    z-index: 1;
}

[data-theme="dark"] .stars-bg {
    background-image:
        radial-gradient(2px 2px at 20px 30px, #8b5cf6, transparent),
        radial-gradient(2px 2px at 40px 70px, #06b6d4, transparent),
        radial-gradient(1px 1px at 90px 40px, #f59e0b, transparent),
        radial-gradient(1px 1px at 130px 80px, #8b5cf6, transparent);
    background-repeat: repeat;
    background-size: 200px 150px;
}

[data-theme="light"] .stars-bg {
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(124, 58, 237, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(8, 145, 178, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(217, 119, 6, 0.2), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(124, 58, 237, 0.2), transparent);
    background-repeat: repeat;
    background-size: 200px 150px;
    opacity: 0.3;
}

.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

[data-theme="dark"] .cosmic-bg {
    background:
        radial-gradient(ellipse at top, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
}

[data-theme="light"] .cosmic-bg {
    background:
        radial-gradient(ellipse at top, rgba(124, 58, 237, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(8, 145, 178, 0.05) 0%, transparent 50%);
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    background: var(--velora-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--velora-bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--velora-bg-tertiary);
}

/* ===== DARK MODE SPECIFIC OVERRIDES ===== */
[data-theme="dark"] .text-white {
    color: var(--velora-text-primary) !important;
}

[data-theme="light"] .text-white {
    color: var(--velora-text-primary) !important;
}

[data-theme="dark"] .bg-dark {
    background: var(--velora-bg-primary) !important;
}

[data-theme="light"] .bg-light {
    background: var(--velora-bg-primary) !important;
}

[data-theme="dark"] .text-gray-600 {
    color: var(--velora-text-secondary) !important;
}

[data-theme="light"] .text-gray-600 {
    color: var(--velora-text-secondary) !important;
}

[data-theme="dark"] .text-gray-300 {
    color: var(--velora-text-secondary) !important;
}

[data-theme="light"] .text-gray-300 {
    color: var(--velora-text-secondary) !important;
}

/* ===== UTILITY CLASSES ===== */

/* Background Colors */
.bg-deep-space { background-color: var(--velora-deep-space-blue) !important; }
.bg-cosmic { background-color: var(--velora-cosmic-gold) !important; }
.bg-stellar { background-color: var(--velora-stellar-gold) !important; }
.bg-nebula { background-color: var(--velora-nebula-amber) !important; }
.bg-aurora { background-color: var(--velora-aurora-cyan) !important; }

/* Gradient Backgrounds */
.bg-gradient-cosmic { background: var(--velora-gradient-cosmic) !important; }
.bg-gradient-nebula { background: linear-gradient(135deg, var(--velora-stellar-gold) 0%, var(--velora-nebula-amber) 100%) !important; }
.bg-gradient-aurora { background: linear-gradient(135deg, var(--velora-aurora-cyan) 0%, var(--velora-cosmic-gold) 100%) !important; }
.bg-gradient-galaxy { background: linear-gradient(180deg, var(--velora-deep-space-blue) 0%, #1A0E2E 100%) !important; }
.bg-gradient-sunset { background: linear-gradient(135deg, var(--velora-nebula-amber) 0%, var(--velora-aurora-cyan) 100%) !important; }
.bg-gradient-mystic { background: linear-gradient(135deg, #D4AF37 0%, #FFD700 50%, #FFA500 100%) !important; }

/* Text Colors */
.text-cosmic { color: var(--velora-cosmic-gold) !important; }
.text-stellar { color: var(--velora-stellar-gold) !important; }
.text-nebula { color: var(--velora-nebula-amber) !important; }
.text-aurora { color: var(--velora-aurora-cyan) !important; }
.text-moonlight { color: var(--velora-moonlight-white) !important; }
.text-stardust { color: var(--velora-star-dust-gray) !important; }

/* Element Colors */
.element-fire { color: var(--velora-element-fire) !important; }
.element-earth { color: var(--velora-element-earth) !important; }
.element-air { color: var(--velora-element-air) !important; }
.element-water { color: var(--velora-element-water) !important; }

/* Glow Effects */
.glow-cosmic {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.glow-stellar {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.glow-nebula {
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.5);
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* ===== SPECIAL EFFECTS ===== */

/* Cosmic Background Pattern */
.cosmic-background {
    background-color: var(--velora-bg-primary);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 165, 0, 0.1) 0%, transparent 50%);
}

/* Stars Effect */
.stars-effect {
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent);
    background-size: 200px 200px;
    background-position: 0 0, 40px 60px, 130px 270px;
    opacity: 0.3;
}

/* Aurora Border */
.aurora-border {
    border: 2px solid transparent;
    background: linear-gradient(var(--velora-bg-primary), var(--velora-bg-primary)) padding-box,
                linear-gradient(135deg, var(--velora-aurora-cyan) 0%, var(--velora-cosmic-gold) 100%) border-box;
    border-radius: 12px;
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark Mode Glassmorphism */
[data-theme="dark"] .glass {
    background: rgba(13, 27, 42, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* ===== MEGA MENU ===== */
.mega-menu {
    background: var(--velora-bg-card);
    border-color: var(--velora-border-primary);
}

.mega-menu a {
    color: var(--velora-text-primary) !important;
}

.mega-menu a:hover {
    background: var(--velora-bg-hover);
    color: var(--velora-accent-primary) !important;
}

/* ===== DROPDOWN MENUS ===== */
.dropdown-menu {
    background: var(--velora-bg-card);
    border-color: var(--velora-border-primary);
}

.dropdown-item {
    color: var(--velora-text-primary);
}

.dropdown-item:hover {
    background: var(--velora-bg-hover);
    color: var(--velora-accent-primary);
}

/* ===== PAGINATION ===== */
.pagination .page-link {
    background: var(--velora-bg-card);
    border-color: var(--velora-border-primary);
    color: var(--velora-text-primary);
}

.pagination .page-link:hover {
    background: var(--velora-bg-hover);
    border-color: var(--velora-accent-primary);
    color: var(--velora-accent-primary);
}

.pagination .active .page-link {
    background: var(--velora-accent-primary);
    border-color: var(--velora-accent-primary);
    color: var(--velora-text-inverse);
}

/* ===== PROGRESS BARS ===== */
.progress {
    background: var(--velora-bg-tertiary);
}

.progress-bar {
    background: var(--velora-accent-primary);
}

/* ===== TOOLTIPS ===== */
.tooltip-inner {
    background: var(--velora-bg-tertiary);
    color: var(--velora-text-primary);
}

/* ===== SELECTION ===== */
::selection {
    background: var(--velora-accent-primary);
    color: var(--velora-text-inverse);
}

/* ===== FOCUS STYLES ===== */
:focus-visible {
    outline: 2px solid var(--velora-accent-primary);
    outline-offset: 2px;
}

/* ===== ALERTS ===== */
.alert {
    background: var(--velora-bg-card);
    border-color: var(--velora-border-primary);
    color: var(--velora-text-primary);
}

/* ===== MODALS ===== */
.modal-content {
    background: var(--velora-bg-card);
    color: var(--velora-text-primary);
}

.modal-header {
    border-bottom-color: var(--velora-border-primary);
}

.modal-footer {
    border-top-color: var(--velora-border-primary);
}

/* ===== CODE BLOCKS ===== */
pre, code {
    background: var(--velora-bg-tertiary);
    color: var(--velora-text-primary);
}

/* ===== DUOTONE ICONS ===== */
.fa-duotone {
    --fa-primary-color: var(--velora-accent-primary);
    --fa-secondary-color: var(--velora-accent-secondary);
    opacity: 0.8;
}

/* ===== ICONS ===== */
.fa-light, .fa-regular, .fa-solid {
    transition: color 0.3s ease;
}

a:hover .fa-light,
a:hover .fa-regular,
button:hover .fa-light,
button:hover .fa-regular {
    color: var(--velora-accent-primary);
}

/* Reserve space for icons to reduce layout shift */
.fa-light, .fa-regular, .fa-solid, .fa-duotone { 
    min-width: 1.25em; 
    display: inline-block; 
}

.nav-link i, .btn i, .feature-icon i { 
    width: 1.25em; 
    text-align: center; 
}

/* ===== SMOOTH TRANSITIONS ===== */
/* Scoped transitions for key components */
.card, .btn, input, textarea, select, .nav-link, .dropdown-item {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== RESPONSIVE ADJUSTMENTS FOR FORMS ===== */
/* Card responsive padding is handled by cards.css */
@media (max-width: 768px) {
    .velora-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .velora-form-group {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .velora-input {
        padding: 0.75rem 0.875rem;
    }
}

@media (max-width: 320px) {
    .velora-input {
        padding: 0.625rem 0.75rem;
    }
}

/* Touch Target Compliance */
@media (max-width: 768px) {
    .velora-card.clickable,
    .velora-card button,
    .velora-card .card-link-enhanced,
    .velora-card .feature-link {
        min-height: 44px;
        min-width: 44px;
    }

    .velora-input,
    .velora-btn {
        min-height: 44px;
    }

    .velora-card.clickable,
    .velora-card a,
    .velora-card button {
        touch-action: manipulation;
    }

    .velora-form-label {
        padding: 0.5rem 0;
    }
}

/* Image Optimization */
.velora-card img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

.velora-card-feature img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Card hover states are handled by cards.css */

/* Spacing Consistency */
@media (max-width: 640px) {
    .velora-form-group {
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 480px) {
    .velora-form-group {
        margin-bottom: 1rem;
    }
}

@media (max-width: 320px) {
    .velora-form-group {
        margin-bottom: 0.875rem;
    }
}
