:root {
    --input-text-color: #EDE8DC;
    --input-bg-color: rgba(20, 28, 44, 0.6);
    --input-border-color: rgba(212, 175, 55, 0.12);
    --input-placeholder-color: #706858;
    --404-gold: #D4AF37;
    --404-gold-light: #F4D03F;
    --404-gold-dark: #8B6914;
}

body.light-mode {
    --input-text-color: #000000;
    --input-bg-color: #FFFFFF;
    --input-border-color: rgba(139, 105, 20, 0.3);
    --input-placeholder-color: #888888;
}

/* ==================== استایل‌های اختصاصی 404 ==================== */
.error-404-section {
    min-height: calc(100vh - 300px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

/* ذرات طلایی پس‌زمینه */
.gold-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.gold-particle {
    position: absolute;
    background: var(--404-gold);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px) scale(2);
        opacity: 0;
    }
}

@keyframes particleFloatReverse {
    0% {
        transform: translateY(0) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.05;
    }
    100% {
        transform: translateY(-100vh) translateX(-50px) scale(1.8);
        opacity: 0;
    }
}

/* محتوای اصلی 404 */
.error-404-content {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 90vw;
    max-width: 650px;
}

/* کانتینر عدد 404 */
.error-visual {
    position: relative;
    width: clamp(200px, 40vw, 320px);
    height: clamp(200px, 40vw, 320px);
    margin: 0 auto clamp(24px, 4vw, 40px);
}

/* حلقه‌های مداری */
.orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.25);
    transform: translate(-50%, -50%);
    animation: orbitSpin linear infinite;
}

.orbit-ring:nth-child(1) {
    width: 100%;
    height: 100%;
    animation-duration: 28s;
}

.orbit-ring:nth-child(2) {
    width: 82%;
    height: 82%;
    animation-duration: 20s;
    animation-direction: reverse;
    border-color: rgba(212, 175, 55, 0.35);
}

.orbit-ring:nth-child(3) {
    width: 64%;
    height: 64%;
    animation-duration: 24s;
    border-style: dashed;
    border-color: rgba(212, 175, 55, 0.2);
}

.orbit-ring:nth-child(4) {
    width: 46%;
    height: 46%;
    animation-duration: 16s;
    animation-direction: reverse;
    border-color: rgba(244, 208, 63, 0.3);
}

@keyframes orbitSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* نقطه‌های نورانی روی حلقه‌ها */
.orbit-gem {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--404-gold-light);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--404-gold), 0 0 25px var(--404-gold);
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    animation: gemGlow 2s ease-in-out infinite;
}

.orbit-ring:nth-child(2) .orbit-gem {
    width: 10px;
    height: 10px;
    background: #F4D03F;
    box-shadow: 0 0 18px #F4D03F, 0 0 35px #D4AF37;
    top: -5px;
    animation-delay: 0.5s;
}

.orbit-ring:nth-child(3) .orbit-gem {
    width: 5px;
    height: 5px;
    background: #C9A84C;
    box-shadow: 0 0 8px #C9A84C, 0 0 15px #D4AF37;
    top: -2.5px;
    animation-delay: 1s;
}

.orbit-ring:nth-child(4) .orbit-gem {
    width: 6px;
    height: 6px;
    background: #E8C547;
    box-shadow: 0 0 10px #E8C547, 0 0 20px #D4AF37;
    top: -3px;
    animation-delay: 1.5s;
}

@keyframes gemGlow {
    0%, 100% {
        box-shadow: 0 0 12px var(--404-gold), 0 0 25px var(--404-gold);
    }
    50% {
        box-shadow: 0 0 20px var(--404-gold-light), 0 0 40px var(--404-gold), 0 0 60px rgba(212, 175, 55, 0.5);
    }
}

/* عدد ۴۰۴ */
.error-number-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(70px, 13vw, 120px);
    font-weight: 900;
    background: linear-gradient(135deg, #8B6914 0%, #D4AF37 25%, #F4D03F 50%, #C9A84C 75%, #8B6914 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmer 4s ease-in-out infinite;
    letter-spacing: -4px;
    line-height: 1;
}

@keyframes goldShimmer {
    0%, 100% {
        background-position: 0% 50%;
        filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.5));
    }
    25% {
        background-position: 100% 0%;
        filter: drop-shadow(0 0 40px rgba(244, 208, 63, 0.7));
    }
    50% {
        background-position: 100% 100%;
        filter: drop-shadow(0 0 35px rgba(212, 175, 55, 0.6));
    }
    75% {
        background-position: 0% 100%;
        filter: drop-shadow(0 0 30px rgba(201, 168, 76, 0.5));
    }
}

/* الماس‌های شناور */
.floating-diamond {
    position: absolute;
    width: clamp(16px, 3vw, 24px);
    height: clamp(16px, 3vw, 24px);
    animation: diamondWander 5s ease-in-out infinite;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.floating-diamond svg {
    width: 100%;
    height: 100%;
    stroke: var(--404-gold);
    stroke-width: 1.5;
    fill: none;
}

.floating-diamond.top-right {
    top: 8%;
    right: -8px;
    animation-delay: 0s;
}

.floating-diamond.bottom-left {
    bottom: 12%;
    left: -6px;
    animation-delay: 1.8s;
    width: clamp(12px, 2vw, 18px);
    height: clamp(12px, 2vw, 18px);
}

.floating-diamond.mid-right {
    top: 55%;
    right: -18px;
    animation-delay: 3.2s;
    width: clamp(10px, 1.8vw, 14px);
    height: clamp(10px, 1.8vw, 14px);
}

.floating-diamond.top-left {
    top: 20%;
    left: -14px;
    animation-delay: 0.8s;
    width: clamp(11px, 1.8vw, 16px);
    height: clamp(11px, 1.8vw, 16px);
}

@keyframes diamondWander {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-18px) rotate(90deg) scale(1.15);
        opacity: 1;
    }
    50% {
        transform: translateY(-8px) rotate(180deg) scale(0.95);
        opacity: 0.85;
    }
    75% {
        transform: translateY(-22px) rotate(270deg) scale(1.1);
        opacity: 0.9;
    }
}

/* متن‌ها */
.error-message h2 {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.error-message .gold-text {
    background: linear-gradient(135deg, #D4AF37, #F4D03F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .error-message .gold-text {
    background: linear-gradient(135deg, #8B6914, #D4AF37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-description {
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: clamp(24px, 4vw, 36px);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error-description .highlight {
    color: var(--404-gold);
    font-weight: 600;
}

/* جداکننده */
.luxury-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: clamp(24px, 4vw, 36px);
}

.luxury-divider .line {
    width: clamp(50px, 10vw, 90px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
}

.luxury-divider .gem {
    width: clamp(10px, 1.5vw, 14px);
    height: clamp(10px, 1.5vw, 14px);
    animation: gemSpin 3s linear infinite;
}

.luxury-divider .gem svg {
    width: 100%;
    height: 100%;
    stroke: var(--404-gold);
    fill: var(--404-gold);
}

@keyframes gemSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* دکمه‌ها */
.error-actions {
    display: flex;
    gap: clamp(10px, 1.8vw, 16px);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: clamp(24px, 4vw, 36px);
}

.btn-gold-404 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: clamp(12px, 1.8vw, 16px) clamp(20px, 3vw, 32px);
    background: linear-gradient(135deg, #D4AF37, #C9A84C);
    border: none;
    border-radius: 50px;
    color: #0A0A0A;
    font-family: 'Peyda', sans-serif;
    font-weight: 700;
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-gold-404:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(212, 175, 55, 0.35);
    background: linear-gradient(135deg, #F4D03F, #D4AF37);
}

.btn-gold-404:active {
    transform: translateY(-1px);
    transition: all 0.1s ease;
}

.btn-outline-404 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: clamp(12px, 1.8vw, 16px) clamp(20px, 3vw, 32px);
    background: transparent;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 50px;
    color: var(--404-gold);
    font-family: 'Peyda', sans-serif;
    font-weight: 600;
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-outline-404:hover {
    border-color: var(--404-gold-light);
    background: rgba(212, 175, 55, 0.08);
    color: var(--404-gold-light);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.12);
}

/* جعبه جستجو */
.error-search {
    display: flex;
    gap: 8px;
    max-width: 420px;
    margin: 0 auto clamp(20px, 3vw, 28px);
}

.error-search input {
    flex: 1;
    padding: clamp(11px, 1.5vw, 14px) clamp(14px, 2vw, 20px);
    background: var(--input-bg-color);
    border: 1px solid var(--input-border-color);
    border-radius: 50px;
    color: var(--input-text-color);
    font-family: 'Peyda', sans-serif;
    font-size: clamp(0.82rem, 1.2vw, 0.9rem);
    outline: none;
    transition: all 0.3s ease;
    -webkit-text-fill-color: var(--input-text-color);
    box-shadow: none;
}

body.light-mode .error-search input {
    border-color: rgba(139, 105, 20, 0.3);
    background: #FFFFFF;
}

.error-search input:focus {
    border-color: var(--404-gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.08);
}

.error-search input::placeholder {
    color: var(--input-placeholder-color);
}

.error-search button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: clamp(11px, 1.5vw, 14px) clamp(16px, 2.5vw, 24px);
    background: linear-gradient(135deg, #D4AF37, #C9A84C);
    border: none;
    border-radius: 50px;
    color: #0A0A0A;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Peyda', sans-serif;
    font-size: clamp(0.82rem, 1.2vw, 0.9rem);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.error-search button svg {
    width: 16px;
    height: 16px;
    stroke: #0A0A0A;
    stroke-width: 2;
}

.error-search button:hover {
    background: linear-gradient(135deg, #F4D03F, #D4AF37);
}

/* لینک‌های کمکی */
.helpful-links {
    display: flex;
    gap: clamp(12px, 2vw, 24px);
    justify-content: center;
    flex-wrap: wrap;
    padding-top: clamp(14px, 2vw, 20px);
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}

.helpful-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: clamp(0.75rem, 1.1vw, 0.83rem);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 3px;
}

.helpful-links a svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

.helpful-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--404-gold);
    transition: width 0.3s ease;
}

.helpful-links a:hover {
    color: var(--404-gold);
}

.helpful-links a:hover::after {
    width: 100%;
}

/* رسپانسیو */
@media (max-width: 768px) {
    .error-404-section {
        padding: 50px 0;
        min-height: calc(100vh - 250px);
    }

    .error-visual {
        width: 180px;
        height: 180px;
    }

    .error-number-display {
        font-size: 60px;
    }

    .floating-diamond {
        width: 14px;
        height: 14px;
    }

    .floating-diamond.bottom-left {
        width: 11px;
        height: 11px;
    }

    .floating-diamond.mid-right,
    .floating-diamond.top-left {
        display: none;
    }
}

@media (max-width: 576px) {
    .error-404-section {
        padding: 36px 0;
        min-height: calc(100vh - 220px);
    }

    .error-visual {
        width: 150px;
        height: 150px;
        margin-bottom: 20px;
    }

    .error-number-display {
        font-size: 50px;
        letter-spacing: -2px;
    }

    .error-message h2 {
        font-size: 1.2rem;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .btn-gold-404,
    .btn-outline-404 {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .error-search {
        flex-direction: column;
        max-width: 100%;
    }

    .error-search button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .helpful-links {
        gap: 14px;
    }

    .floating-diamond {
        display: none;
    }

    .orbit-ring:nth-child(4) {
        display: none;
    }
}

@media (max-width: 380px) {
    .error-visual {
        width: 130px;
        height: 130px;
    }

    .error-number-display {
        font-size: 42px;
    }

    .error-message h2 {
        font-size: 1.05rem;
    }

    .error-description {
        font-size: 0.78rem;
    }

    .btn-gold-404,
    .btn-outline-404 {
        font-size: 0.8rem;
        padding: 10px 16px;
    }

    .helpful-links a {
        font-size: 0.72rem;
    }
}
