/* Modern UI CSS with Glassmorphism and 3D Effects */

/* CSS Variables for Modern Theming */
:root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --neon-glow: 0 0 20px rgba(212, 175, 55, 0.8);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-gold: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    --gradient-dark: linear-gradient(135deg, #1B4332 0%, #2D6A4F 50%, #40916C 100%);
    --perspective: 1200px;
    --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);
}

/* Glassmorphism Base */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    transition: var(--transition-smooth);
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #1B4332, #2D6A4F, #40916C, #52B788);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

/* Particle Canvas Background */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* 3D Card Effects */
.card-3d {
    transform-style: preserve-3d;
    transform: perspective(var(--perspective));
    transition: var(--transition-smooth);
}

.card-3d:hover {
    transform: perspective(var(--perspective)) rotateX(-10deg) rotateY(10deg) scale(1.05);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(212, 175, 55, 0.3);
}

.card-3d-wrapper {
    perspective: var(--perspective);
    transform-style: preserve-3d;
}

/* Floating Navigation Bar */
.floating-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition-smooth);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.floating-nav.scrolled {
    padding: 10px 0;
    background: rgba(27, 67, 50, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Neon Glow Effects */
.neon-text {
    text-shadow: 
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 30px currentColor,
        0 0 40px currentColor;
    animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    from { text-shadow: 0 0 10px currentColor, 0 0 20px currentColor; }
    to { text-shadow: 0 0 15px currentColor, 0 0 30px currentColor, 0 0 45px currentColor; }
}

.neon-border {
    border: 2px solid transparent;
    background-image: linear-gradient(#111, #111), var(--gradient-gold);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    position: relative;
}

.neon-border::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-gold);
    filter: blur(10px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.neon-border:hover::after {
    opacity: 0.7;
}

/* Gradient Buttons with Animation */
.btn-gradient {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
    border: none;
    color: white;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

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

.btn-gradient:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

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

.btn-gradient:active::before {
    width: 300px;
    height: 300px;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-gold);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-bounce);
    z-index: 999;
}

.fab:hover {
    transform: scale(1.15) rotate(45deg);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.7);
}

.fab-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    from {
        width: 0;
        height: 0;
        opacity: 1;
    }
    to {
        width: 100px;
        height: 100px;
        opacity: 0;
    }
}

/* Parallax Container */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    width: 110%;
    height: 110%;
    top: -5%;
    left: -5%;
}

.parallax-bg {
    z-index: -3;
    transform: translateZ(-300px) scale(2);
}

.parallax-mid {
    z-index: -2;
    transform: translateZ(-150px) scale(1.5);
}

.parallax-front {
    z-index: -1;
    transform: translateZ(-50px) scale(1.2);
}

/* Loading Animation */
.loading-skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

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

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-secondary);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Animated SVG Icons */
.svg-icon {
    transition: var(--transition-smooth);
}

.svg-icon:hover {
    transform: rotate(360deg) scale(1.2);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.8));
}

/* Text Typing Animation */
.typing-text {
    overflow: hidden;
    border-right: 3px solid var(--gold);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--gold); }
}

/* Floating Labels */
.form-group-float {
    position: relative;
    margin-bottom: 30px;
}

.form-group-float input,
.form-group-float textarea {
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 5px;
    width: 100%;
    transition: var(--transition-smooth);
}

.form-group-float label {
    position: absolute;
    top: 10px;
    left: 5px;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition-smooth);
    pointer-events: none;
}

.form-group-float input:focus,
.form-group-float input:valid,
.form-group-float textarea:focus,
.form-group-float textarea:valid {
    border-bottom-color: var(--gold);
}

.form-group-float input:focus ~ label,
.form-group-float input:valid ~ label,
.form-group-float textarea:focus ~ label,
.form-group-float textarea:valid ~ label {
    transform: translateY(-25px);
    font-size: 0.85rem;
    color: var(--gold);
}

/* Card Flip Animation */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Gradient Text */
.gradient-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* Hover Lift Animation */
.hover-lift {
    transition: var(--transition-smooth);
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(212, 175, 55, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* Slide In Animations */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* RTL Support for Animations */
[dir="rtl"] .slide-in-left {
    animation: slideInRight 0.5s ease-out;
}

[dir="rtl"] .slide-in-right {
    animation: slideInLeft 0.5s ease-out;
}

[dir="rtl"] .form-group-float label {
    left: auto;
    right: 5px;
}

[dir="rtl"] .fab {
    right: auto;
    left: 30px;
}

/* Morphing Blob Background */
.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--gradient-accent);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    opacity: 0.7;
    animation: morph 8s ease-in-out infinite;
    filter: blur(40px);
}

@keyframes morph {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: rotate(0deg) scale(1);
    }
    33% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
        transform: rotate(120deg) scale(1.1);
    }
    66% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(240deg) scale(0.9);
    }
}

/* Glow Card */
.glow-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.glow-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(10px);
}

.glow-card:hover::before {
    opacity: 1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modern Tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    pointer-events: none;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.tooltip:hover::after {
    transform: translateX(-50%) scale(1);
}

/* Micro-interactions */
.micro-interact {
    transition: var(--transition-smooth);
}

.micro-interact:active {
    transform: scale(0.95);
}

/* Enhanced Focus States */
*:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

/* 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;
        scroll-behavior: auto !important;
    }
}