/* Dobby's Lab - Base Styles */

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0a;
}

/* Dobby Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 20%, rgba(88, 101, 242, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.dobby-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 80px,
            rgba(139, 92, 246, 0.12) 80px,
            rgba(139, 92, 246, 0.12) 81px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 80px,
            rgba(139, 92, 246, 0.12) 80px,
            rgba(139, 92, 246, 0.12) 81px
        );
    pointer-events: none;
    z-index: 0;
}

/* Floating retro icons */
.retro-icon {
    position: absolute;
    opacity: 0.15;
    filter: drop-shadow(0 0 12px currentColor);
    animation: float-random 25s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float-random {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(var(--float-x1, 30px), var(--float-y1, -40px)) rotate(var(--float-rot1, 15deg));
    }
    50% {
        transform: translate(var(--float-x2, -25px), var(--float-y2, 35px)) rotate(var(--float-rot2, -10deg));
    }
    75% {
        transform: translate(var(--float-x3, 20px), var(--float-y3, -30px)) rotate(var(--float-rot3, 12deg));
    }
}

/* Glass morphism cards - Optimized for performance */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.card {
    position: relative;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out forwards;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.6s ease;
}

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

.card:hover {
    transform: translateY(-12px) scale(1.02);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.25),
        0 8px 16px rgba(0, 0, 0, 0.2);
}

.card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Staggered animation delays */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }

/* Icon box styling */
.icon-box {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    transition: all 0.4s ease;
}

.card:hover .icon-box {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Resource cards */
.resource-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px) saturate(120%);
    -webkit-backdrop-filter: blur(15px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.resource-card:hover {
    transform: translateY(-6px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Input fields */
.input-field {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
}

/* Buttons */
.btn-primary {
    background: #3b82f6;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Progress bars */
.progress-bar {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    background: linear-gradient(90deg, var(--progress-color-start), var(--progress-color-end));
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

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

    .retro-icon {
        animation: none;
    }

    .card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Mobile optimizations - reduce blur intensity */
@media (max-width: 768px) {
    .glass-card {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .card {
        backdrop-filter: blur(12px) saturate(110%);
        -webkit-backdrop-filter: blur(12px) saturate(110%);
    }

    .resource-card {
        backdrop-filter: blur(10px) saturate(110%);
        -webkit-backdrop-filter: blur(10px) saturate(110%);
    }

    .icon-box {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}
