﻿:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --accent: #22d3ee;
    --accent-glow: rgba(34, 211, 238, 0.4);
    --bg-dark: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Effects */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.1) 0%, transparent 50%), radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    z-index: 0;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 2rem;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.3s ease;
}

    .logo:hover {
        transform: scale(1.02);
    }

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--gradient-1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 4rem;
    position: relative;
    z-index: 1;
}

.error-container {
    text-align: center;
    max-width: 600px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glitch Effect for 404 */
.error-code {
    font-size: clamp(8rem, 20vw, 14rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 1rem;
    position: relative;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glitch 2.5s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        text-shadow: none;
    }

    92% {
        text-shadow: 2px 0 var(--accent), -2px 0 var(--primary);
    }

    94% {
        text-shadow: -2px 0 var(--accent), 2px 0 var(--primary);
    }

    96% {
        text-shadow: 2px 0 var(--primary), -2px 0 var(--accent);
    }

    98% {
        text-shadow: -2px 0 var(--primary), 2px 0 var(--accent);
    }
}

/* Robot Animation */
.robot-container {
    margin-bottom: 2rem;
    position: relative;
}

.robot {
    font-size: 6rem;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(-3deg);
    }

    75% {
        transform: translateY(-10px) rotate(3deg);
    }
}

.robot-shadow {
    width: 80px;
    height: 20px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    margin: 0 auto;
    animation: shadow 3s ease-in-out infinite;
}

@keyframes shadow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(0.8);
        opacity: 0.3;
    }
}

.error-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.error-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

/* Buttons */
.error-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.btn {
    padding: 0.95rem 1.85rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(99, 102, 241, 0.45);
    }

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

    .btn-secondary:hover {
        border-color: var(--primary-light);
        background: rgba(99, 102, 241, 0.1);
    }

/* Quick Links */
.quick-links {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

    .quick-links h3 {
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-muted);
        margin-bottom: 1.25rem;
    }

.quick-links-grid {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

    .quick-link:hover {
        color: var(--accent);
        border-color: var(--accent);
        background: rgba(34, 211, 238, 0.1);
    }

    .quick-link svg {
        width: 18px;
        height: 18px;
    }

/* Floating Elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    font-size: 2rem;
    opacity: 0.1;
    animation: floatRandom 20s infinite linear;
}

    .floating-element:nth-child(1) {
        top: 10%;
        left: 10%;
        animation-delay: 0s;
    }

    .floating-element:nth-child(2) {
        top: 20%;
        left: 80%;
        animation-delay: -5s;
    }

    .floating-element:nth-child(3) {
        top: 60%;
        left: 15%;
        animation-delay: -10s;
    }

    .floating-element:nth-child(4) {
        top: 70%;
        left: 75%;
        animation-delay: -15s;
    }

    .floating-element:nth-child(5) {
        top: 40%;
        left: 50%;
        animation-delay: -7s;
    }

@keyframes floatRandom {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(20px, -20px) rotate(90deg);
    }

    50% {
        transform: translate(-10px, 20px) rotate(180deg);
    }

    75% {
        transform: translate(-20px, -10px) rotate(270deg);
    }
}

/* Search Box */
.search-box {
    margin: 2rem 0;
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

    .search-box input {
        flex: 1;
        padding: 1rem 1.25rem;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 1rem;
        transition: border-color 0.3s;
    }

        .search-box input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .search-box input::placeholder {
            color: var(--text-muted);
        }

    .search-box button {
        padding: 1rem;
        background: var(--gradient-1);
        border: none;
        border-radius: var(--radius-md);
        color: white;
        cursor: pointer;
        transition: all 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .search-box button:hover {
            transform: scale(1.05);
        }

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 5rem 1.5rem 3rem;
    }

    .error-code {
        font-size: 7rem;
    }

    .robot {
        font-size: 4rem;
    }

    .error-title {
        font-size: 1.5rem;
    }

    .quick-links {
        padding: 1.5rem;
    }

    .quick-links-grid {
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.75rem 1rem;
    }

    .error-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .search-box {
        flex-direction: column;
    }

        .search-box button {
            width: 100%;
        }
}
