/* ============================================
   Global Styles & Reset
   ============================================ */
html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f0f7ff;
}

::-webkit-scrollbar-thumb {
    background: #93c5fd;
    border-radius: 5px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #60a5fa;
}

/* ============================================
   Glass Morphism Styles
   ============================================ */
.glass-nav {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.33, 0.66, 0.66, 1);
}

.glass-nav:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
    border-color: rgba(255, 255, 255, 0.7);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.glass-dark:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 40px rgba(59, 130, 246, 0.2);
}

.glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 12px 40px 0 rgba(59, 130, 246, 0.2);
}

.text-shadow-glow {
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* ============================================
   Keyframe Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* ============================================
   Micro-interactions: Shimmer Effect
   ============================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

/* ============================================
   Micro-interactions: Pulse Effect
   ============================================ */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

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

/* ============================================
   Micro-interactions: Bounce Effect
   ============================================ */
@keyframes bounce-subtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.bounce-subtle {
    animation: bounce-subtle 1s ease-in-out infinite;
}

/* ============================================
   Micro-interactions: Ripple Effect
   ============================================ */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* ============================================
   Animation Classes
   ============================================ */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.8s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.parallax-element {
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.33, 0.66, 0.66, 1);
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

.opacity-0 { opacity: 0; }

/* ============================================
   Modal Styles
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out forwards;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 2rem;
    padding: 3rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease-out forwards;
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.3);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e7ff;
}

.modal-header h2 {
    font-size: 1.875rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #475569;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: #f0f7ff;
    color: #0f172a;
    transform: rotate(90deg) scale(1.1);
}

.modal-body {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.8;
}

.modal-body h3 {
    color: #0f172a;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.modal-body h3:hover {
    color: #3b82f6;
    transform: translateX(5px);
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease;
}

.modal-body li:hover {
    transform: translateX(5px);
}

/* ============================================
   Button Micro-interactions
   ============================================ */
button, a[class*="button"], .btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

button:hover, a[class*="button"]:hover, .btn:hover {
    transform: translateY(-2px);
}

button:active, a[class*="button"]:active, .btn:active {
    transform: translateY(0px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Primary button glow effect */
.bg-gradient-to-r:not(.from-background-light) {
    transition: all 0.3s ease;
}

.bg-gradient-to-r:not(.from-background-light):hover {
    filter: brightness(1.1);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
}

/* ============================================
   Card Micro-interactions
   ============================================ */
.group {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.group:hover {
    transform: translateY(-8px);
}

/* ============================================
   Input & Form Micro-interactions
   ============================================ */
input, textarea, select {
    transition: all 0.3s ease;
    border-color: transparent;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

/* ============================================
   Link Micro-interactions
   ============================================ */
a:not([class*="group"]):not(.modal-close) {
    position: relative;
    transition: color 0.3s ease;
}

a:not([class*="group"]):not(.modal-close)::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: #3b82f6;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

a:not([class*="group"]):not(.modal-close):hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ============================================
   Icon Micro-interactions
   ============================================ */
.material-symbols-outlined {
    transition: all 0.3s ease;
    display: inline-block;
}

button .material-symbols-outlined,
a .material-symbols-outlined {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

button:hover .material-symbols-outlined,
a:hover .material-symbols-outlined {
    transform: scale(1.15) rotate(5deg);
}

/* ============================================
   Scroll Trigger Effects
   ============================================ */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ============================================
   Loading States
   ============================================ */
@keyframes skeleton-loading {
    0%, 100% {
        background-color: rgba(255, 255, 255, 0.1);
    }
    50% {
        background-color: rgba(255, 255, 255, 0.2);
    }
}

.skeleton {
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.5rem;
}

/* ============================================
   Tooltip Styles
   ============================================ */
.tooltip-trigger {
    position: relative;
}

.tooltip {
    position: absolute;
    background: #0f172a;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
    transition: all 0.3s ease;
    z-index: 10;
}

.tooltip-trigger:hover .tooltip {
    opacity: 1;
    transform: translateY(-35px) scale(1);
}

/* ============================================
   Fade Transitions
   ============================================ */
.fade-transition {
    transition: opacity 0.3s ease;
}

.fade-transition.fade-out {
    opacity: 0;
}

/* ============================================
   Responsive Micro-interactions
   ============================================ */
@media (max-width: 768px) {
    button, a[class*="button"], .btn {
        padding: 0.75rem 1.5rem;
    }

    .modal-content {
        padding: 2rem;
        border-radius: 1.5rem;
    }

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

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-slide-in-left,
    .animate-slide-in-right,
    .animate-scale-in,
    .animate-float,
    .pulse-glow,
    .bounce-subtle {
        animation: none;
    }
}

/* ============================================
   Focus Visible for Keyboard Navigation
   ============================================ */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
