/**
 * Modern UI Components
 * Inspired by Uiverse.io and modern design trends
 */

/* ========================================
   Glassmorphism Cards
   ======================================== */
.card-glass {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.card-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ========================================
   Animated Gradient Borders
   ======================================== */
@keyframes rotate-border {
    0% {
        --angle: 0deg;
    }
    100% {
        --angle: 360deg;
    }
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.gradient-border {
    position: relative;
    border: none;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(var(--angle), #2563eb, #f59e0b, #10b981, #2563eb);
    border-radius: inherit;
    z-index: -1;
    animation: rotate-border 3s linear infinite;
}

.gradient-border::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    border-radius: inherit;
    z-index: -1;
}

/* ========================================
   Neumorphism Elements
   ======================================== */
.neuro-card {
    background: #f0f0f3;
    box-shadow: 
        12px 12px 24px rgba(163, 177, 198, 0.6),
        -12px -12px 24px rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
}

.neuro-card:hover {
    box-shadow: 
        8px 8px 16px rgba(163, 177, 198, 0.6),
        -8px -8px 16px rgba(255, 255, 255, 0.5);
}

/* ========================================
   Animated Background Particles
   ======================================== */
.particles-bg {
    position: relative;
    overflow: hidden;
}

.particles-bg::before,
.particles-bg::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    opacity: 0.1;
    animation: float-particles 20s infinite ease-in-out;
}

.particles-bg::before {
    background: radial-gradient(circle, #2563eb, transparent);
    top: -250px;
    left: -250px;
}

.particles-bg::after {
    background: radial-gradient(circle, #f59e0b, transparent);
    bottom: -250px;
    right: -250px;
    animation-delay: -10s;
}

@keyframes float-particles {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(100px, -100px) scale(1.1);
    }
    66% {
        transform: translate(-100px, 100px) scale(0.9);
    }
}

/* ========================================
   Modern Grid Pattern Overlay
   ======================================== */
.grid-overlay {
    position: relative;
}

.grid-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

/* ========================================
   Floating Action Buttons (FAB)
   ======================================== */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 99, 235, 0.6);
}

/* ========================================
   Skeleton Loaders
   ======================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

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

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 2em;
    width: 60%;
}

.skeleton-card {
    height: 200px;
}

/* ========================================
   Morphing Shapes
   ======================================== */
@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph-shape {
    animation: morph 8s ease-in-out infinite;
}

/* ========================================
   Glowing Borders
   ======================================== */
.glow-border {
    position: relative;
    border: 2px solid transparent;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #2563eb, #f59e0b, #10b981, #2563eb);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: glow-rotate 8s ease infinite;
    opacity: 0.7;
}

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

/* ========================================
   Text Reveal Animation
   ======================================== */
.text-reveal {
    overflow: hidden;
    display: inline-block;
}

.text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: text-reveal-anim 0.6s forwards;
}

@keyframes text-reveal-anim {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger delays for multiple spans */
.text-reveal span:nth-child(1) { animation-delay: 0.1s; }
.text-reveal span:nth-child(2) { animation-delay: 0.2s; }
.text-reveal span:nth-child(3) { animation-delay: 0.3s; }
.text-reveal span:nth-child(4) { animation-delay: 0.4s; }
.text-reveal span:nth-child(5) { animation-delay: 0.5s; }

/* ========================================
   Magnetic Buttons
   ======================================== */
.btn-magnetic {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    position: relative;
}

.btn-magnetic:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.3);
}

/* ========================================
   Blob Backgrounds
   ======================================== */
.blob-bg {
    position: relative;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: blob-float 20s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #2563eb;
    top: -200px;
    left: -200px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: #f59e0b;
    bottom: -175px;
    right: -175px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #10b981;
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes blob-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* ========================================
   Smooth Section Transitions
   ======================================== */
.section-transition {
    position: relative;
}

.section-transition::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--color-white));
}

/* ========================================
   Interactive Feature Cards
   ======================================== */
.feature-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card::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;
}

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

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Count Up Numbers with Background
   ======================================== */
.stat-box {
    position: relative;
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.95));
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #f59e0b, #10b981);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* ========================================
   Typing Cursor Effect
   ======================================== */
.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========================================
   Scroll Indicator
   ======================================== */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.scroll-indicator::before {
    content: '';
    display: block;
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    position: relative;
}

.scroll-indicator::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    transform: translateX(-50%);
    animation: scroll-down 2s infinite;
}

@keyframes scroll-down {
    0% {
        opacity: 0;
        top: 8px;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        top: 24px;
    }
}

/* ========================================
   Animated Underline Links
   ======================================== */
.link-animated {
    position: relative;
    display: inline-block;
    text-decoration: none;
}

.link-animated::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.link-animated:hover::before {
    width: 100%;
}

/* ========================================
   Icon Boxes with Hover Effects
   ======================================== */
.icon-box {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.icon-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    opacity: 1;
    transition: opacity 0.3s;
}

.icon-box:hover::before {
    opacity: 0;
}

.icon-box::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--color-secondary), #d97706);
    opacity: 0;
    transition: opacity 0.3s;
}

.icon-box:hover::after {
    opacity: 1;
}

.icon-box svg {
    position: relative;
    z-index: 1;
}

/* ========================================
   Tooltip Component
   ======================================== */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 14px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}

.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ========================================
   Progress Rings
   ======================================== */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
}

/* ========================================
   Floating Labels for Forms
   ======================================== */
.form-floating {
    position: relative;
}

.form-floating input,
.form-floating textarea {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem;
    pointer-events: none;
    transform-origin: 0 0;
    transition: all 0.3s;
    color: var(--color-gray-500);
}

.form-floating input:focus ~ label,
.form-floating input:not(:placeholder-shown) ~ label,
.form-floating textarea:focus ~ label,
.form-floating textarea:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--color-primary);
}

/* ========================================
   Badge Components
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    background: var(--color-gray-100);
    color: var(--color-gray-700);
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-accent);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-secondary);
}

.badge-pulse {
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
}

/* ========================================
   Empty State Illustrations
   ======================================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-3xl);
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-lg);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(245, 158, 11, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.empty-state-icon svg {
    width: 60px;
    height: 60px;
    color: var(--color-primary);
}

/* ========================================
   Testimonial Bubbles
   ======================================== */
.testimonial-bubble {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.testimonial-bubble::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 30px;
    font-size: 100px;
    color: var(--color-primary);
    opacity: 0.1;
    font-family: Georgia, serif;
    line-height: 1;
}

/* ========================================
   Wave Separator
   ======================================== */
.wave-separator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-separator svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

/* ========================================
   Spotlight Effect
   ======================================== */
.spotlight {
    position: relative;
    overflow: hidden;
}

.spotlight::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    pointer-events: none;
    transition: all 0.3s;
    opacity: 0;
}

.spotlight:hover::before {
    opacity: 1;
}

