/**
 * Premium Glassmorphism Theme System for BuzzRFP
 *
 * This stylesheet provides a modern, expressive aesthetic with glassmorphic effects,
 * smooth animations, and premium micro-interactions.
 *
 * Design Philosophy:
 * - Glassmorphism: Translucent surfaces with backdrop blur
 * - High contrast: Vibrant colors against dark gradients
 * - Purposeful motion: 300ms transitions with cubic-bezier easing
 * - Typography: Modern font stack (Inter for body, optional display fonts for headings)
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Dynamically Injected)
   ============================================ */
:root {
    /* Brand Colors (overridden by branding system) */
    --primary-color: #007AFF;
    --secondary-color: #06B6D4;
    --accent-color: #A855F7;
    --background-color: #F8FAFC;

    /* Theme Aesthetic Properties */
    --glass-opacity: 0.75;
    --glass-blur: 20px;
    --glass-border-opacity: 0.2;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --gradient-angle: 135deg;

    /* Animation Properties */
    --transition-speed: 300ms;
    --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   GLASSMORPHIC COMPONENTS
   ============================================ */

/* Glass Card Effect */
.glass-card {
    background: linear-gradient(
        var(--gradient-angle),
        rgba(255, 255, 255, var(--glass-opacity)),
        rgba(255, 255, 255, calc(var(--glass-opacity) - 0.1))
    );
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(255, 255, 255, var(--glass-border-opacity));
    box-shadow:
        0 8px 32px 0 var(--shadow-color),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    transition: all var(--transition-speed) var(--transition-easing);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 48px 0 rgba(0, 0, 0, 0.15),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
}

/* Glass Button (Primary) */
.glass-button-primary {
    background: linear-gradient(
        135deg,
        var(--primary-color),
        color-mix(in srgb, var(--primary-color) 80%, var(--secondary-color))
    );
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-family: var(--font-body);
    box-shadow:
        0 4px 16px rgba(0, 122, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all var(--transition-speed) var(--transition-easing);
    position: relative;
    overflow: hidden;
}

.glass-button-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    opacity: 0;
    transition: opacity var(--transition-speed) var(--transition-easing);
}

.glass-button-primary:hover::before {
    opacity: 1;
}

.glass-button-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(0, 122, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.glass-button-primary:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(0, 122, 255, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Glass Input Fields */
.glass-input {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-family: var(--font-body);
    transition: all var(--transition-speed) var(--transition-easing);
    outline: none;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: var(--primary-color);
    box-shadow:
        0 4px 16px rgba(0, 122, 255, 0.15),
        inset 0 -2px 0 var(--primary-color);
}

.glass-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* Glass Select/Dropdown */
.glass-select {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-family: var(--font-body);
    transition: all var(--transition-speed) var(--transition-easing);
    outline: none;
    cursor: pointer;
}

.glass-select:focus,
.glass-select:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.15);
}

/* ============================================
   DARK MODE GRADIENT BACKGROUND
   ============================================ */
.theme-background-dark {
    background: radial-gradient(
        ellipse at top,
        #1a1a2e 0%,
        #0f0f1e 50%,
        #000000 100%
    );
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.theme-background-gradient {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--primary-color) 10%, #121212),
        #000000
    );
}

/* ============================================
   NAVIGATION & HEADER ENHANCEMENTS
   ============================================ */
.glass-nav {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ============================================
   PREMIUM MICRO-INTERACTIONS
   ============================================ */

/* Smooth state transitions */
.premium-transition {
    transition: all var(--transition-speed) var(--transition-easing);
}

/* Hover lift effect */
.hover-lift {
    transition: transform var(--transition-speed) var(--transition-easing);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* Focus ring (accessible) */
.focus-ring:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 0.375rem;
}

/* Ripple effect container */
.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple-container:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   TYPOGRAPHY ENHANCEMENTS
   ============================================ */
.text-display {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

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

/* ============================================
   SIDEBAR ENHANCEMENTS
   ============================================ */
.glass-sidebar {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.9),
        rgba(255, 255, 255, 0.85)
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
}

/* ============================================
   PREMIUM MODAL/DIALOG
   ============================================ */
.glass-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.5rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ============================================
   FOOTER ENHANCEMENTS
   ============================================ */
.glass-footer {
    background: linear-gradient(
        135deg,
        rgba(var(--primary-color-rgb), 0.95),
        rgba(var(--secondary-color-rgb), 0.95)
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

/* Shadow levels */
.shadow-premium-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.shadow-premium-md {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.shadow-premium-lg {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.shadow-premium-xl {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

/* Border styles */
.border-glass {
    border: 1px solid rgba(255, 255, 255, var(--glass-border-opacity));
}

/* Loading shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    :root {
        --glass-blur: 15px;
        --transition-speed: 200ms;
    }

    .glass-card {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    .glass-card {
        background: linear-gradient(
            var(--gradient-angle),
            rgba(30, 30, 46, var(--glass-opacity)),
            rgba(24, 24, 37, calc(var(--glass-opacity) - 0.1))
        );
        border-color: rgba(255, 255, 255, 0.1);
    }

    .glass-input,
    .glass-select {
        background: rgba(30, 30, 46, 0.85);
        color: #ffffff;
    }

    .glass-input::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass-card,
    .glass-input,
    .glass-select {
        border-width: 2px;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
