/* ===== ULTRA-MODERN ENHANCEMENTS CSS ===== */
/* A comprehensive modern design system for DonateBloodNow */
/* Adds sophisticated visual effects, micro-interactions, and creative styling */

/* ===== ADVANCED CSS VARIABLES ===== */
:root {
    /* Mesh Gradient Colors */
    --mesh-1: #E63946;
    --mesh-2: #7B2CBF;
    --mesh-3: #00F5D4;
    --mesh-4: #FFD166;

    /* Glow Colors */
    --glow-primary: rgba(230, 57, 70, 0.5);
    --glow-secondary: rgba(0, 245, 212, 0.5);
    --glow-accent: rgba(123, 44, 191, 0.5);

    /* Glass Effect Variables */
    --glass-blur: 20px;
    --glass-saturation: 180%;
    --glass-bg-light: rgba(255, 255, 255, 0.08);
    --glass-bg-dark: rgba(0, 0, 0, 0.2);
    --glass-border-light: rgba(255, 255, 255, 0.18);
    --glass-border-dark: rgba(255, 255, 255, 0.08);

    /* Animation Timings */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);

    /* 3D Depth */
    --depth-shadow-1: 0 2px 4px rgba(0, 0, 0, 0.05), 0 4px 8px rgba(0, 0, 0, 0.05);
    --depth-shadow-2: 0 4px 8px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.08);
    --depth-shadow-3: 0 8px 16px rgba(0, 0, 0, 0.1), 0 16px 32px rgba(0, 0, 0, 0.1);
    --depth-shadow-4: 0 16px 32px rgba(0, 0, 0, 0.12), 0 32px 64px rgba(0, 0, 0, 0.12);
}

/* ===== ANIMATED MESH GRADIENT BACKGROUND ===== */
.mesh-gradient-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(230, 57, 70, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(123, 44, 191, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(0, 245, 212, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 0% 100%, rgba(255, 209, 102, 0.08) 0%, transparent 50%);
    animation: meshShift 20s ease infinite;
}

@keyframes meshShift {
    0%, 100% {
        background-position: 0% 0%, 100% 0%, 100% 100%, 0% 100%;
    }
    25% {
        background-position: 50% 0%, 100% 50%, 50% 100%, 0% 50%;
    }
    50% {
        background-position: 100% 0%, 100% 100%, 0% 100%, 0% 0%;
    }
    75% {
        background-position: 50% 50%, 50% 100%, 50% 50%, 50% 0%;
    }
}

/* ===== FLOATING ORB BACKGROUNDS ===== */
.floating-orbs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: orbFloat 25s ease-in-out infinite;
}

.floating-orb:nth-child(1) {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.3), rgba(123, 44, 191, 0.2));
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.floating-orb:nth-child(2) {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(0, 245, 212, 0.25), rgba(123, 44, 191, 0.15));
    top: 50%;
    right: -5%;
    animation-delay: -8s;
}

.floating-orb:nth-child(3) {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(230, 57, 70, 0.15));
    bottom: -10%;
    left: 30%;
    animation-delay: -16s;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }
    75% {
        transform: translate(40px, 20px) scale(1.05);
    }
}

/* ===== NOISE TEXTURE OVERLAY ===== */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== ADVANCED GLASSMORPHISM ===== */
.glass-card {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    border: 1px solid var(--glass-border-light);
    border-radius: 24px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.4s var(--ease-smooth);
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

/* ===== GRADIENT TEXT EFFECTS ===== */
.gradient-text-animated {
    background: linear-gradient(
        135deg,
        var(--mesh-1) 0%,
        var(--mesh-2) 33%,
        var(--mesh-3) 66%,
        var(--mesh-1) 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 8s ease infinite;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.text-glow {
    text-shadow:
        0 0 20px var(--glow-primary),
        0 0 40px var(--glow-primary),
        0 0 60px rgba(230, 57, 70, 0.2);
}

/* ===== MODERN BUTTON STYLES ===== */
.btn-modern {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    background: linear-gradient(135deg, var(--mesh-1) 0%, var(--mesh-2) 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s var(--ease-smooth);
    box-shadow:
        0 4px 15px rgba(230, 57, 70, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.btn-modern:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 12px 35px rgba(230, 57, 70, 0.4),
        0 0 0 3px rgba(230, 57, 70, 0.1);
}

.btn-modern:hover::before {
    opacity: 1;
}

.btn-modern:active::after {
    width: 300%;
    height: 300%;
}

/* Secondary button variant */
.btn-modern-secondary {
    background: var(--glass-bg-light);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border-light);
    box-shadow: var(--depth-shadow-2);
}

.btn-modern-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--mesh-3);
    box-shadow:
        var(--depth-shadow-3),
        0 0 20px rgba(0, 245, 212, 0.2);
}

/* ===== CARD HOVER EFFECTS ===== */
.card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-3d:hover {
    transform: rotateX(5deg) rotateY(-5deg) translateZ(20px);
}

.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        transparent 20%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 80%
    );
    transform: rotate(45deg);
    transition: all 0.8s var(--ease-out-expo);
}

.card-shine:hover::before {
    top: 100%;
    left: 100%;
}

/* ===== BORDER GLOW EFFECT ===== */
.border-glow {
    position: relative;
}

.border-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--mesh-1), var(--mesh-2), var(--mesh-3), var(--mesh-1));
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: borderGlow 8s linear infinite;
}

.border-glow:hover::before {
    opacity: 1;
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== FLOATING ANIMATION ===== */
.float-animation {
    animation: gentleFloat 6s ease-in-out infinite;
}

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

.float-animation-delayed {
    animation: gentleFloat 6s ease-in-out infinite;
    animation-delay: -3s;
}

/* ===== PULSE ANIMATIONS ===== */
.pulse-ring {
    position: relative;
}

.pulse-ring::after {
    content: '';
    position: absolute;
    inset: -10px;
    border: 2px solid var(--mesh-1);
    border-radius: inherit;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s var(--ease-out-expo);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s var(--ease-elastic);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

.reveal-slide-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s var(--ease-out-expo);
}

.reveal-slide-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-slide-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.8s var(--ease-out-expo);
}

.reveal-slide-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered children animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s var(--ease-out-expo);
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: none; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 100ms; opacity: 1; transform: none; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 200ms; opacity: 1; transform: none; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 300ms; opacity: 1; transform: none; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 400ms; opacity: 1; transform: none; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 500ms; opacity: 1; transform: none; }

/* ===== MODERN FORM INPUTS ===== */
.input-modern {
    position: relative;
    width: 100%;
}

.input-modern input,
.input-modern textarea,
.input-modern select {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    outline: none;
    transition: all 0.3s var(--ease-smooth);
}

.input-modern input:focus,
.input-modern textarea:focus,
.input-modern select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--mesh-3);
    box-shadow:
        0 0 0 4px rgba(0, 245, 212, 0.1),
        0 8px 25px rgba(0, 0, 0, 0.15);
}

.input-modern label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s var(--ease-smooth);
}

.input-modern input:focus + label,
.input-modern input:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    background: var(--dark-bg-primary);
    padding: 0 0.5rem;
    color: var(--mesh-3);
}

/* ===== ICON BADGES ===== */
.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    font-size: 1.75rem;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.15), rgba(123, 44, 191, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.4s var(--ease-elastic);
}

.icon-badge:hover {
    transform: scale(1.15) rotate(5deg);
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.25), rgba(123, 44, 191, 0.25));
    box-shadow: 0 10px 30px rgba(230, 57, 70, 0.2);
}

/* ===== STAT COUNTERS ===== */
.stat-modern {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--mesh-1), var(--mesh-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

/* ===== DIVIDERS ===== */
.divider-gradient {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--mesh-1), var(--mesh-2), var(--mesh-3), transparent);
    border: none;
    margin: 3rem 0;
}

.divider-glow {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    border: none;
    margin: 2rem 0;
}

/* ===== TOOLTIPS ===== */
.tooltip-modern {
    position: relative;
}

.tooltip-modern::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: white;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease-smooth);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-modern:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ===== PROGRESS INDICATORS ===== */
.progress-modern {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-modern-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mesh-1), var(--mesh-2), var(--mesh-3));
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progressShimmer 2s linear infinite;
    transition: width 0.8s var(--ease-out-expo);
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== TAG/CHIP STYLES ===== */
.tag-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.tag-modern:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.tag-primary {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.2), rgba(230, 57, 70, 0.1));
    border-color: rgba(230, 57, 70, 0.3);
    color: #ff6b7a;
}

.tag-secondary {
    background: linear-gradient(135deg, rgba(0, 245, 212, 0.2), rgba(0, 245, 212, 0.1));
    border-color: rgba(0, 245, 212, 0.3);
    color: #5FFBEB;
}

.tag-accent {
    background: linear-gradient(135deg, rgba(123, 44, 191, 0.2), rgba(123, 44, 191, 0.1));
    border-color: rgba(123, 44, 191, 0.3);
    color: #9D4EDD;
}

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator-modern {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.scroll-indicator-modern:hover {
    opacity: 1;
}

.scroll-indicator-modern .mouse {
    width: 28px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    position: relative;
}

.scroll-indicator-modern .mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--mesh-1);
    border-radius: 2px;
    animation: scrollMouse 2s ease-in-out infinite;
}

@keyframes scrollMouse {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(12px); opacity: 0.3; }
}

/* ===== BACKDROP BLUR VARIATIONS ===== */
.blur-sm { backdrop-filter: blur(4px); }
.blur-md { backdrop-filter: blur(12px); }
.blur-lg { backdrop-filter: blur(24px); }
.blur-xl { backdrop-filter: blur(40px); }

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .floating-orb {
        opacity: 0.3;
    }

    .floating-orb:nth-child(1) { width: 250px; height: 250px; }
    .floating-orb:nth-child(2) { width: 200px; height: 200px; }
    .floating-orb:nth-child(3) { width: 225px; height: 225px; }

    .btn-modern {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .glass-card {
        border-radius: 20px;
    }

    .icon-badge {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .floating-orbs {
        display: none;
    }

    .btn-modern {
        padding: 0.75rem 1.25rem;
        border-radius: 12px;
    }

    .glass-card {
        border-radius: 16px;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (prefers-reduced-motion: reduce) {
    .floating-orb,
    .gradient-text-animated,
    .float-animation,
    .float-animation-delayed,
    .pulse-ring::after,
    .reveal-on-scroll,
    .reveal-scale,
    .reveal-slide-left,
    .reveal-slide-right,
    .stagger-children > * {
        animation: none !important;
        transition: none !important;
    }

    .reveal-on-scroll,
    .reveal-scale,
    .reveal-slide-left,
    .reveal-slide-right {
        opacity: 1;
        transform: none;
    }
}

/* ===== LIGHT MODE ADAPTATIONS ===== */
body:not(.dark-mode) .glass-card {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.6) 100%
    );
    border-color: rgba(0, 0, 0, 0.08);
}

body:not(.dark-mode) .input-modern input,
body:not(.dark-mode) .input-modern textarea,
body:not(.dark-mode) .input-modern select {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

body:not(.dark-mode) .tag-modern {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

body:not(.dark-mode) .stat-label {
    color: var(--text-secondary);
}
