*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --card-bg: rgba(18, 18, 26, 0.8);
    --card-border: rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #f5f5f7;
        --bg-secondary: #ffffff;
        --text-primary: #1a1a2e;
        --text-secondary: #6b6b80;
        --card-bg: rgba(255, 255, 255, 0.9);
        --card-border: rgba(0, 0, 0, 0.1);
    }
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animated gradient background */
.background {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        135deg,
        var(--bg-primary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-primary) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -2;
}

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

/* Floating geometric shapes */
.shape {
    position: fixed;
    opacity: 0.1;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    border: 2px solid var(--accent);
    top: 60%;
    right: 15%;
    animation-delay: -5s;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.shape-3 {
    width: 150px;
    height: 150px;
    border: 2px solid var(--accent);
    border-radius: 30%;
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
    animation-duration: 25s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    top: 30%;
    right: 25%;
    animation-delay: -7s;
    animation-duration: 18s;
}

.shape-5 {
    width: 250px;
    height: 250px;
    border: 2px solid var(--accent);
    bottom: 10%;
    right: 5%;
    animation-delay: -3s;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, -30px) rotate(5deg);
    }
    50% {
        transform: translate(-10px, 20px) rotate(-5deg);
    }
    75% {
        transform: translate(-20px, -10px) rotate(3deg);
    }
}

/* Particles canvas */
#particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* Main container */
.container {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    animation: fadeIn 1s ease-out;
}

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

/* Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 100px var(--accent-glow);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    color: var(--accent);
}

.logo svg,
.logo img {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: contain;
    display: block;
}

.logo span {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Heading */
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Message */
.message {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* File Transfer Animation - Enhanced Windows XP Style */
.file-transfer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 1.5rem;
    position: relative;
    height: 54px;
    overflow: visible;
    padding: 8px 0;
}

.folder {
    position: relative;
    width: 50px;
    height: 38px;
    transform: translateZ(0);
}

.folder-tab {
    position: absolute;
    top: 0;
    left: 2px;
    width: 22px;
    height: 6px;
    background: #FCCE6C;
    border: 1px solid #C89A3C;
    border-bottom: none;
    border-radius: 2px 2px 0 0;
}

.folder-body {
    position: absolute;
    top: 6px;
    left: 0;
    width: 50px;
    height: 32px;
    background: #FCDB85;
    border: 1px solid #C89A3C;
    border-radius: 0 3px 3px 3px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.folder-body::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 50%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.25) 0%,
        transparent 100%);
    border-radius: 0 2px 0 0;
}

.folder-body::after {
    display: none;
}

.file-stream {
    position: relative;
    width: 132px;
    height: 36px;
    overflow: visible;
}

.file-stream::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(99, 102, 241, 0.1) 25%,
        rgba(99, 102, 241, 0.2) 50%,
        rgba(99, 102, 241, 0.1) 75%,
        transparent 100%);
    transform: translateY(-50%);
    filter: blur(4px);
    animation: glowPulse 2.4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.file {
    position: absolute;
    top: 8px;
    left: 0;
    width: 24px;
    height: 30px;
    background: #FFFFFF;
    border: 1px solid #7A7A7A;
    border-radius: 1px;
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.3),
        inset 1px 1px 0 rgba(255, 255, 255, 0.8);
    opacity: 0;
    animation: flyFile 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    animation-fill-mode: both;
    will-change: transform, opacity, filter;
    z-index: 2;
    overflow: hidden;
}

/* Folded corner - outer border */
.file::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #7A7A7A transparent transparent;
    z-index: 2;
}

/* Folded corner - inner fill */
.file::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 7px 7px 0;
    border-color: transparent #D8D8D8 transparent transparent;
    z-index: 1;
}

.file-1 {
    animation-delay: 0s;
}

.file-2 {
    animation-delay: 0.5s;
}

.file-3 {
    animation-delay: 1s;
}

@keyframes flyFile {
    0% {
        transform:
            translateX(0)
            translateY(0)
            scale(0.85)
            rotate(-5deg);
        opacity: 0;
        filter: blur(0px);
    }
    8% {
        opacity: 0.3;
        filter: blur(1px);
    }
    15% {
        opacity: 1;
        filter: blur(0px);
    }
    25% {
        transform:
            translateX(24px)
            translateY(-8px)
            scale(0.95)
            rotate(2deg);
        filter: blur(0.5px);
    }
    50% {
        transform:
            translateX(60px)
            translateY(-12px)
            scale(1.05)
            rotate(0deg);
        opacity: 1;
        filter: blur(1px);
    }
    75% {
        transform:
            translateX(96px)
            translateY(-6px)
            scale(0.98)
            rotate(-3deg);
        filter: blur(0.5px);
    }
    85% {
        opacity: 1;
        filter: blur(0px);
    }
    92% {
        opacity: 0.4;
        filter: blur(1px);
    }
    100% {
        transform:
            translateX(132px)
            translateY(0)
            scale(0.88)
            rotate(5deg);
        opacity: 0;
        filter: blur(2px);
    }
}

/* Fallback for browsers without filter support */
@supports not (filter: blur(1px)) {
    .file {
        box-shadow:
            0 2px 5px rgba(0, 0, 0, 0.3),
            inset 1px 1px 0 rgba(255, 255, 255, 0.8);
    }

    @keyframes flyFile {
        0%, 100% { opacity: 0; }
        15%, 85% { opacity: 1; }
    }
}

@media (prefers-reduced-motion: reduce) {
    .file {
        animation: none;
        opacity: 1;
        transform: translateX(0);
        filter: none;
    }

    .file-2 {
        transform: translateX(44px);
    }

    .file-3 {
        transform: translateX(88px);
    }

    .file-stream::before {
        animation: none;
    }
}

/* Light mode adjustments */
@media (prefers-color-scheme: light) {
    .folder-body {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.5),
            0 3px 6px rgba(0, 0, 0, 0.3);
    }

    .file {
        background: #FAFAFA;
        box-shadow:
            0 2px 6px rgba(0, 0, 0, 0.35),
            inset 1px 1px 0 rgba(255, 255, 255, 0.9);
    }
}

/* Status indicator */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: 2rem;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--accent-glow);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
        box-shadow: 0 0 0 10px transparent;
    }
}

/* Contact */
.contact {
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.contact p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.contact a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.contact a:hover {
    opacity: 0.8;
}

/* Footer */
footer {
    margin-top: 2rem;
}

footer p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 480px) {
    .card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .logo svg,
    .logo img {
        width: 40px !important;
        height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }

    /* Scale down file transfer animation for mobile */
    .file-transfer {
        gap: 16px;
        height: 42px;
        transform: scale(0.8);
    }

    .folder {
        width: 42px;
        height: 32px;
    }

    .folder-tab {
        width: 18px;
        height: 5px;
    }

    .folder-body {
        width: 42px;
        height: 27px;
    }

    .file-stream {
        width: 110px;
    }

    .file {
        width: 22px;
        height: 27px;
    }

    @keyframes flyFile {
        0% {
            transform: translateX(0) translateY(0) scale(0.85) rotate(-5deg);
            opacity: 0;
            filter: blur(0px);
        }
        8% {
            opacity: 0.3;
            filter: blur(0.5px);
        }
        15% {
            opacity: 1;
            filter: blur(0px);
        }
        25% {
            transform: translateX(20px) translateY(-6px) scale(0.95) rotate(2deg);
            filter: blur(0.3px);
        }
        50% {
            transform: translateX(50px) translateY(-10px) scale(1.05) rotate(0deg);
            opacity: 1;
            filter: blur(0.5px);
        }
        75% {
            transform: translateX(80px) translateY(-5px) scale(0.98) rotate(-3deg);
            filter: blur(0.3px);
        }
        85% {
            opacity: 1;
            filter: blur(0px);
        }
        92% {
            opacity: 0.4;
            filter: blur(0.5px);
        }
        100% {
            transform: translateX(110px) translateY(0) scale(0.88) rotate(5deg);
            opacity: 0;
            filter: blur(1px);
        }
    }
}
