:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --secondary: #10b981;
    --secondary-light: rgba(16, 185, 129, 0.1);
    --blue: #0ea5e9;
    --purple: #8b5cf6;
    --green: #10b981;
    --orange: #f59e0b;
    --red: #ef4444;
    --text-dark: #f8fafc;
    --text-light: #94a3b8;
    --text-lighter: #64748b;
    --bg-dark: #111827;
    --bg-darker: #0f172a;
    --bg-light: #1e293b;
    --white: #ffffff;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 41, 59, 0.9);
    --border-radius-sm: 8px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s ease;
}

.error-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 50px 0;
    background-color: var(--bg-darker);
}

.error-content {
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    z-index: 10;
    position: relative;
}

.error-number {
    font-size: 12rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 20px;
    position: relative;
    text-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
    letter-spacing: -5px;
}

.error-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.error-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
}

.error-buttons .btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.error-buttons .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}

.error-buttons .btn:hover::before {
    left: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn i {
    margin-left: 12px;
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.btn:hover i {
    transform: translateX(4px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--purple) 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.btn-outline:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Neural Network Background */
.neural-network {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.2;
    pointer-events: none;
}

/* 404 Animation Shapes */
.error-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 2;
    opacity: 0.2;
}

.error-shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    background: linear-gradient(45deg, var(--purple) 0%, var(--primary) 70%);
    animation: floatAnimation 15s infinite alternate ease-in-out;
}

.error-shape-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
    background: linear-gradient(45deg, var(--green) 0%, var(--blue) 70%);
    animation: floatAnimation 20s infinite alternate-reverse ease-in-out;
}

.error-shape-3 {
    width: 200px;
    height: 200px;
    top: 30%;
    left: 15%;
    background: linear-gradient(45deg, var(--red) 0%, var(--orange) 70%);
    animation: floatAnimation 17s infinite alternate ease-in-out;
}

/* 404 Icon Animations */
.error-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 3;
}

.error-icon {
    position: absolute;
    font-size: 24px;
    color: var(--text-lighter);
    opacity: 0.3;
    animation: floatIcon 8s infinite linear;
}

.error-icon:nth-child(1) {
    top: 15%;
    left: 15%;
    font-size: 26px;
    animation-duration: 12s;
}

.error-icon:nth-child(2) {
    top: 25%;
    right: 20%;
    font-size: 22px;
    animation-duration: 15s;
    animation-delay: 1s;
}

.error-icon:nth-child(3) {
    bottom: 20%;
    left: 25%;
    font-size: 24px;
    animation-duration: 18s;
    animation-delay: 2s;
}

.error-icon:nth-child(4) {
    bottom: 30%;
    right: 25%;
    font-size: 18px;
    animation-duration: 20s;
    animation-delay: 3s;
}

.error-icon:nth-child(5) {
    top: 40%;
    left: 40%;
    font-size: 20px;
    animation-duration: 16s;
    animation-delay: 4s;
}

/* 404 Images Animation */
.error-illustration {
    position: relative;
    height: 250px;
    margin-bottom: 40px;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.error-element {
    position: absolute;
    transition: var(--transition);
    transform-style: preserve-3d;
}

.error-astronaut {
    width: 120px;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: floatAstronaut 5s infinite alternate ease-in-out;
}

.error-planet {
    width: 200px;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    animation: rotatePlanet 30s infinite linear;
}

.error-satellite {
    width: 60px;
    top: 40px;
    left: calc(50% + 140px);
    animation: orbitSatellite 15s infinite linear;
}

.error-stars {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: var(--white);
    border-radius: 50%;
    animation: twinkle 5s infinite;
}

/* Links Grid */
.error-links {
    margin-top: 50px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.error-link-item {
    background-color: rgba(30, 41, 59, 0.5);
    border-radius: var(--border-radius);
    padding: 20px 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.error-link-item::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    transform: scaleX(0);
    transition: transform 0.5s;
}

.error-link-item:hover::before {
    transform: scaleX(1);
}

.error-link-item:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.error-link-icon {
    font-size: 32px;
    margin-bottom: 15px;
    color: var(--primary);
    transition: transform 0.5s ease;
    margin-left: auto; 
    margin-right: auto;
    display: inline-flex;
}

.error-link-item:hover .error-link-icon {
    transform: scale(1.2);
}

.error-link-title {
    font-size: 1.1rem;
    color: var(--white);
    font-weight: 600;
    display: block;
    text-decoration: none;
}

/* Missing dot animation */
.missing-dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--red) 0%, var(--primary) 100%);
    border-radius: 50%;
    position: relative;
    margin-right: 15px;
    top: -100px;
    animation: dropDot 1.5s forwards ease-in-out;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* Glitch Effect for 404 */
.glitch-wrapper {
    position: relative;
    display: inline-block;
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: "404";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--red);
    animation: glitch-animation 2s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch::after {
    left: -2px;
    text-shadow: 2px 0 var(--blue);
    animation: glitch-animation 3s infinite linear alternate-reverse;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

/* Pulse button */
.btn-pulse {
    position: relative;
}

.btn-pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    opacity: 0.6;
    z-index: -1;
    animation: pulse-animation 2s infinite;
}

/* Responsive Styles */
@media (max-width: 767px) {
    .error-number {
        font-size: 8rem;
    }
    
    .error-title {
        font-size: 1.8rem;
    }
    
    .error-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        width: 85%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .btn {
        width: 100%;
    }
    
    .error-illustration {
        height: 180px;
    }
    
    .error-astronaut {
        width: 90px;
    }
    
    .error-planet {
        width: 150px;
    }
    
    .error-satellite {
        width: 40px;
        left: calc(50% + 100px);
    }
    
    .error-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Icons using SVG data URIs */
.icon-arrow-right {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M14 5l7 7m0 0l-7 7m7-7H3'%3E%3C/path%3E%3C/svg%3E");
    width: 20px;
    height: 20px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 8px;
}

.icon-home {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6'%3E%3C/path%3E%3C/svg%3E");
    width: 20px;
    height: 20px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
}

.icon-refresh {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15'%3E%3C/path%3E%3C/svg%3E");
    width: 20px;
    height: 20px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 8px;
}

/* Animation Keyframes */
@keyframes floatAnimation {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(40px, 40px);
    }
}

@keyframes floatIcon {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes floatAstronaut {
    0% {
        transform: translateX(-50%) translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateX(-50%) translateY(-20px) rotate(5deg);
    }
    100% {
        transform: translateX(-50%) translateY(0) rotate(-5deg);
    }
}

@keyframes rotatePlanet {
    0% {
        transform: translateX(-50%) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) rotate(360deg);
    }
}

@keyframes orbitSatellite {
    0% {
        transform: rotate(0deg) translateX(80px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(80px) rotate(-360deg);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

@keyframes dropDot {
    0% {
        top: -100px;
        opacity: 0;
    }
    70% {
        top: 0;
        opacity: 1;
        transform: scale(1);
    }
    85% {
        transform: scale(1.2);
    }
    100% {
        top: 0;
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glitch-animation {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(1px);
    }
    50% {
        transform: translateX(-1px);
    }
    75% {
        transform: translateX(1px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes pulse-animation {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    70% {
        transform: scale(1.1);
        opacity: 0;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

@keyframes neural-animation {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}