/*
 * Modern Effects CSS
 * Glassmorphism, Animations, Micro-interactions
 * Universal Template
 */

/* ========================================
   CSS Variables for Modern Effects
   ======================================== */
:root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, color-mix(in srgb, var(--primary-color), white 20%) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, color-mix(in srgb, var(--secondary-color), white 20%) 100%);
    --gradient-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   Smooth Scroll
   ======================================== */
html {
    scroll-behavior: smooth;
}

/* ========================================
   Glassmorphism Effects
   ======================================== */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--glass-shadow);
}

/* Navbar Glassmorphism on scroll */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Gradient Borders
   ======================================== */
.gradient-border {
    position: relative;
    background: white;
    border-radius: 15px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: 17px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
    opacity: 1;
}

/* ========================================
   Modern Card Hover Effects
   ======================================== */
.modern-card {
    transition: var(--transition-smooth);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.modern-card:hover {
    transform: translateY(-10px) rotateX(2deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Shine effect on hover */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg) translateX(-100%);
    transition: transform 0.6s ease;
}

.shine-effect:hover::after {
    transform: rotate(30deg) translateX(100%);
}

/* ========================================
   Floating Animation
   ======================================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

.floating {
    animation: float 4s ease-in-out infinite;
}

.floating-slow {
    animation: floatSlow 6s ease-in-out infinite;
}

/* ========================================
   Pulse Animation
   ======================================== */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--secondary-color-rgb, 255, 165, 0), 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(var(--secondary-color-rgb, 255, 165, 0), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--secondary-color-rgb, 255, 165, 0), 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ========================================
   Blob Shapes for Backgrounds
   ======================================== */
.blob-bg {
    position: relative;
    overflow: hidden;
}

.blob-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: var(--gradient-accent);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(60px);
    animation: blobMove 15s ease-in-out infinite;
}

.blob-bg::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(60px);
    animation: blobMove 12s ease-in-out infinite reverse;
}

@keyframes blobMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-10px, 20px) scale(0.95);
    }
    75% {
        transform: translate(30px, 10px) scale(1.02);
    }
}

/* ========================================
   Modern Button Styles
   ======================================== */
.btn-modern {
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    z-index: 1;
}

.btn-modern::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 ease;
    z-index: -1;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-modern:active {
    transform: translateY(-1px);
}

/* Gradient Button */
.btn-gradient {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-gradient:hover {
    background: var(--gradient-secondary);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Scroll Reveal Animations
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   Micro-interactions
   ======================================== */
/* Input Focus Effects */
.form-control-modern {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 18px;
    transition: var(--transition-smooth);
    background: white;
}

.form-control-modern:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb, 0, 51, 102), 0.1);
    outline: none;
}

/* Checkbox Modern Style */
.checkbox-modern {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.checkbox-modern:checked {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
}

.checkbox-modern:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Link Hover Underline Effect */
.link-modern {
    position: relative;
    text-decoration: none;
    color: var(--primary-color);
}

.link-modern::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.link-modern:hover::after {
    width: 100%;
}

/* ========================================
   Icon Animations
   ======================================== */
.icon-hover-rotate {
    transition: transform 0.3s ease;
}

.icon-hover-rotate:hover i,
.icon-hover-rotate:hover .icon {
    transform: rotate(15deg) scale(1.1);
}

.icon-hover-bounce {
    transition: transform 0.3s ease;
}

.icon-hover-bounce:hover i,
.icon-hover-bounce:hover .icon {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-4px); }
}

/* ========================================
   Loading Skeleton
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 10px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 15px;
}

.skeleton-image {
    height: 200px;
    margin-bottom: 15px;
}

/* ========================================
   Text Gradient Effect
   ======================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-accent {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Modern Section Dividers
   ======================================== */
.wave-divider {
    position: relative;
}

.wave-divider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100'%3E%3Cpath fill='%23ffffff' d='M0,50 C360,100 1080,0 1440,50 L1440,100 L0,100 Z'/%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
}

/* ========================================
   Modern Card Styles
   ======================================== */
.card-elevated {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: var(--transition-smooth);
    border: none;
}

.card-elevated:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

/* Neumorphism Card */
.card-neumorphic {
    background: #f0f0f3;
    border-radius: 20px;
    box-shadow: 8px 8px 16px #d1d1d4, -8px -8px 16px #ffffff;
    border: none;
    transition: var(--transition-smooth);
}

.card-neumorphic:hover {
    box-shadow: 12px 12px 24px #d1d1d4, -12px -12px 24px #ffffff;
}

/* ========================================
   Counter Animation
   ======================================== */
.counter-animated {
    font-variant-numeric: tabular-nums;
}

/* ========================================
   Image Effects
   ======================================== */
.img-zoom-container {
    overflow: hidden;
    border-radius: 15px;
}

.img-zoom {
    transition: transform 0.5s ease;
}

.img-zoom-container:hover .img-zoom {
    transform: scale(1.1);
}

/* Tilt Effect */
.tilt-effect {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-effect:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* ========================================
   Ripple Effect (Material Design)
   ======================================== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* ========================================
   Modern Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    .dark-mode-support {
        --glass-bg: rgba(30, 30, 30, 0.8);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
}

/* ========================================
   Accessibility - Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
