/* ========================================
   SEÇÃO 404 - BEST DIGITAL
   Prefixo: err404-
   ======================================== */

/* ========================================
   IMPORTS E VARIÁVEIS
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ========================================
   SEÇÃO PRINCIPAL
   ======================================== */
.err404-section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0a 0%, #000000 50%, #0d0d0d 100%);
    overflow: hidden;
    font-family: "DM Sans", sans-serif;
}

/* ========================================
   BACKGROUND - PARTÍCULAS
   ======================================== */
.err404-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.err404-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FF4000;
    border-radius: 50%;
    opacity: 0;
    animation: err404-particle-float 8s ease-in-out infinite;
    box-shadow: 0 0 10px #FF4000, 0 0 20px rgba(255, 64, 0, 0.5);
}

@keyframes err404-particle-float {
    0%, 100% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}

/* ========================================
   BACKGROUND - GRID FUTURISTA
   ======================================== */
.err404-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 64, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 64, 0, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1;
    animation: err404-grid-move 20s linear infinite;
}

@keyframes err404-grid-move {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }
    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

/* ========================================
   LUZ AMBIENTE
   ======================================== */
.err404-ambient-light {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 64, 0, 0.15) 0%, transparent 70%);
    z-index: 1;
    animation: err404-ambient-pulse 4s ease-in-out infinite;
}

@keyframes err404-ambient-pulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */
.err404-container {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 20px;
    max-width: 800px;
    width: 100%;
}

/* ========================================
   NÚMERO 404 - EFEITO GLITCH
   ======================================== */
.err404-number-wrapper {
    position: relative;
    margin-bottom: 30px;
    display: inline-block;
}

.err404-number {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: clamp(120px, 25vw, 220px);
    font-weight: 800;
    line-height: 1;
    color: transparent;
    background: linear-gradient(135deg, #FF4000 0%, #FF8C00 50%, #FFB347 100%);
    -webkit-background-clip: text;
    background-clip: text;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 80px rgba(255, 64, 0, 0.5);
    animation: err404-number-glow 3s ease-in-out infinite;
}

@keyframes err404-number-glow {
    0%, 100% {
        filter: drop-shadow(0 0 30px rgba(255, 64, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 60px rgba(255, 140, 0, 0.8));
    }
}

.err404-digit {
    display: inline-block;
    position: relative;
    animation: err404-digit-float 3s ease-in-out infinite;
}

.err404-digit:nth-child(1) {
    animation-delay: 0s;
}

.err404-digit-middle {
    animation-delay: 0.2s;
    transform-origin: center;
}

.err404-digit:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes err404-digit-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Efeito Glitch/Tremedinha - Número sempre visível */
.err404-number::before,
.err404-number::after {
    content: '404';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #FF4000 0%, #FF8C00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    pointer-events: none;
}

/* Camada de tremedinha esquerda (cyan/azul) */
.err404-number::before {
    text-shadow: -2px 0 rgba(0, 255, 255, 0.3);
    animation: err404-glitch-1 3s infinite;
}

/* Camada de tremedinha direita (magenta/rosa) */
.err404-number::after {
    text-shadow: 2px 0 rgba(255, 0, 128, 0.3);
    animation: err404-glitch-2 3s infinite;
}

@keyframes err404-glitch-1 {
    0%, 89%, 91%, 93%, 95%, 100% {
        transform: translate(0);
    }
    90% {
        transform: translate(-3px, 1px);
    }
    92% {
        transform: translate(2px, -1px);
    }
    94% {
        transform: translate(-1px, 0);
    }
}

@keyframes err404-glitch-2 {
    0%, 84%, 86%, 88%, 90%, 100% {
        transform: translate(0);
    }
    85% {
        transform: translate(3px, -1px);
    }
    87% {
        transform: translate(-2px, 1px);
    }
    89% {
        transform: translate(1px, 0);
    }
}

/* Overlay de glitch */
.err404-glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        transparent 0%,
        rgba(255, 64, 0, 0.03) 50%,
        transparent 100%
    );
    animation: err404-scan 4s linear infinite;
    pointer-events: none;
}

/* Linha de scan */
.err404-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #FF4000, transparent);
    animation: err404-scan-move 3s ease-in-out infinite;
    opacity: 0.6;
    box-shadow: 0 0 20px #FF4000;
}

@keyframes err404-scan-move {
    0% {
        top: 0;
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ========================================
   ÓRBITAS INTERATIVAS
   ======================================== */
.err404-orbital-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    pointer-events: none;
}

.err404-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(255, 64, 0, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.err404-orbit-1 {
    width: 300px;
    height: 300px;
    animation: err404-orbit-rotate 15s linear infinite;
}

.err404-orbit-2 {
    width: 400px;
    height: 400px;
    animation: err404-orbit-rotate 20s linear infinite reverse;
}

.err404-orbit-3 {
    width: 500px;
    height: 500px;
    animation: err404-orbit-rotate 25s linear infinite;
}

@keyframes err404-orbit-rotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.err404-orbit-dot {
    position: absolute;
    top: 0;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #FF4000;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 15px #FF4000, 0 0 30px rgba(255, 64, 0, 0.5);
}

.err404-orbit-2 .err404-orbit-dot {
    width: 6px;
    height: 6px;
    background: #FF8C00;
    box-shadow: 0 0 15px #FF8C00;
}

.err404-orbit-3 .err404-orbit-dot {
    width: 4px;
    height: 4px;
    background: #FFB347;
    box-shadow: 0 0 15px #FFB347;
}

/* ========================================
   CONTEÚDO - TEXTOS
   ======================================== */
.err404-content {
    position: relative;
    z-index: 10;
}

.err404-title {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: clamp(24px, 5vw, 42px);
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.err404-description {
    font-family: "DM Sans", sans-serif;
    font-size: clamp(14px, 2.5vw, 18px);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    max-width: 500px;
    margin: 0 auto 40px auto;
}

/* ========================================
   BARRA DE STATUS FUTURISTA
   ======================================== */
.err404-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 30px;
    background: rgba(255, 64, 0, 0.05);
    border: 1px solid rgba(255, 64, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.err404-status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.err404-status-label {
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.err404-status-value {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #FF4000;
    letter-spacing: 1px;
}

.err404-blink {
    animation: err404-blink-anim 1s ease-in-out infinite;
}

@keyframes err404-blink-anim {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.err404-status-divider {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, transparent, rgba(255, 64, 0, 0.3), transparent);
}

/* ========================================
   BOTÕES DE AÇÃO
   ======================================== */
.err404-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.err404-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.err404-btn-primary {
    background: linear-gradient(135deg, #FF4000 0%, #FF8C00 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 10px 40px rgba(255, 64, 0, 0.3);
}

.err404-btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(255, 64, 0, 0.5);
    color: #ffffff;
}

.err404-btn-secondary {
    background: transparent;
    color: #FF4000;
    border: 2px solid rgba(255, 64, 0, 0.5);
}

.err404-btn-secondary:hover {
    background: rgba(255, 64, 0, 0.1);
    border-color: #FF4000;
    transform: translateY(-5px);
    color: #FF8C00;
}

.err404-btn-bg {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.err404-btn:hover .err404-btn-bg {
    left: 100%;
}

.err404-btn-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.err404-btn-text {
    position: relative;
    z-index: 2;
}

/* ========================================
   LINKS ÚTEIS
   ======================================== */
.err404-useful-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.err404-links-label {
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.err404-links-wrapper {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.err404-link {
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.err404-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #FF4000, #FF8C00);
    transition: width 0.3s ease;
}

.err404-link:hover {
    color: #FF4000;
}

.err404-link:hover::after {
    width: 100%;
}

/* ========================================
   ELEMENTOS DECORATIVOS DE CANTO
   ======================================== */
.err404-corner {
    position: absolute;
    width: 100px;
    height: 100px;
    z-index: 5;
    pointer-events: none;
}

.err404-corner::before,
.err404-corner::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, #FF4000, transparent);
}

.err404-corner-tl {
    top: 30px;
    left: 30px;
}

.err404-corner-tl::before {
    top: 0;
    left: 0;
    width: 60px;
    height: 2px;
}

.err404-corner-tl::after {
    top: 0;
    left: 0;
    width: 2px;
    height: 60px;
    background: linear-gradient(180deg, #FF4000, transparent);
}

.err404-corner-tr {
    top: 30px;
    right: 30px;
}

.err404-corner-tr::before {
    top: 0;
    right: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(270deg, #FF4000, transparent);
}

.err404-corner-tr::after {
    top: 0;
    right: 0;
    width: 2px;
    height: 60px;
    background: linear-gradient(180deg, #FF4000, transparent);
}

.err404-corner-bl {
    bottom: 30px;
    left: 30px;
}

.err404-corner-bl::before {
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
}

.err404-corner-bl::after {
    bottom: 0;
    left: 0;
    width: 2px;
    height: 60px;
    background: linear-gradient(0deg, #FF4000, transparent);
}

.err404-corner-br {
    bottom: 30px;
    right: 30px;
}

.err404-corner-br::before {
    bottom: 0;
    right: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(270deg, #FF4000, transparent);
}

.err404-corner-br::after {
    bottom: 0;
    right: 0;
    width: 2px;
    height: 60px;
    background: linear-gradient(0deg, #FF4000, transparent);
}

/* ========================================
   EFEITO DE LUZ PASSANDO (SWEEP)
   ======================================== */
.err404-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 64, 0, 0.03),
        rgba(255, 140, 0, 0.05),
        rgba(255, 64, 0, 0.03),
        transparent
    );
    animation: err404-light-sweep 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes err404-light-sweep {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    50.01%, 100% {
        left: -100%;
    }
}

/* ========================================
   RESPONSIVO - TABLET
   ======================================== */
@media (max-width: 992px) {
    .err404-orbital-container {
        width: 300px;
        height: 300px;
    }
    
    .err404-orbit-1 {
        width: 200px;
        height: 200px;
    }
    
    .err404-orbit-2 {
        width: 280px;
        height: 280px;
    }
    
    .err404-orbit-3 {
        width: 360px;
        height: 360px;
    }
    
    .err404-status-bar {
        padding: 15px 20px;
        gap: 15px;
    }
    
    .err404-corner {
        width: 60px;
        height: 60px;
    }
    
    .err404-corner::before {
        width: 40px !important;
    }
    
    .err404-corner::after {
        height: 40px !important;
    }
    
    .err404-corner-tl,
    .err404-corner-tr {
        top: 15px;
    }
    
    .err404-corner-bl,
    .err404-corner-br {
        bottom: 15px;
    }
    
    .err404-corner-tl,
    .err404-corner-bl {
        left: 15px;
    }
    
    .err404-corner-tr,
    .err404-corner-br {
        right: 15px;
    }
}

/* ========================================
   RESPONSIVO - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .err404-section {
        padding: 20px;
    }
    
    .err404-container {
        padding: 30px 15px;
    }
    
    .err404-number {
        font-size: clamp(80px, 20vw, 150px);
        gap: 5px;
    }
    
    .err404-title {
        font-size: clamp(20px, 5vw, 32px);
        letter-spacing: 2px;
    }
    
    .err404-description {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .err404-orbital-container {
        display: none;
    }
    
    .err404-status-bar {
        flex-direction: row;
        gap: 10px;
        padding: 15px;
    }
    
    .err404-status-divider {
        width: 1px;
        height: 25px;
    }
    
    .err404-status-label {
        font-size: 9px;
    }
    
    .err404-status-value {
        font-size: 12px;
    }
    
    .err404-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .err404-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }
    
    .err404-links-wrapper {
        gap: 15px;
    }
    
    .err404-link {
        font-size: 13px;
    }
    
    .err404-corner {
        width: 40px;
        height: 40px;
    }
    
    .err404-corner::before {
        width: 25px !important;
    }
    
    .err404-corner::after {
        height: 25px !important;
    }
    
    .err404-corner-tl,
    .err404-corner-tr {
        top: 10px;
    }
    
    .err404-corner-bl,
    .err404-corner-br {
        bottom: 10px;
    }
    
    .err404-corner-tl,
    .err404-corner-bl {
        left: 10px;
    }
    
    .err404-corner-tr,
    .err404-corner-br {
        right: 10px;
    }
    
    .err404-ambient-light {
        width: 400px;
        height: 400px;
    }
    
    .err404-grid {
        background-size: 30px 30px;
    }
}

/* ========================================
   RESPONSIVO - MOBILE PEQUENO
   ======================================== */
@media (max-width: 480px) {
    .err404-number {
        font-size: clamp(60px, 18vw, 100px);
    }
    
    .err404-title {
        font-size: 18px;
        letter-spacing: 1px;
    }
    
    .err404-description {
        font-size: 13px;
        line-height: 1.6;
    }
    
    .err404-status-bar {
        border-radius: 10px;
    }
    
    .err404-btn {
        font-size: 12px;
        padding: 12px 20px;
    }
    
    .err404-btn-icon {
        font-size: 16px;
    }
}

/* ========================================
   ACESSIBILIDADE - REDUZIR MOVIMENTO
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .err404-particle,
    .err404-grid,
    .err404-ambient-light,
    .err404-number,
    .err404-digit,
    .err404-number::before,
    .err404-number::after,
    .err404-scan-line,
    .err404-orbit,
    .err404-section::before {
        animation: none !important;
    }
    
    .err404-btn,
    .err404-link {
        transition: none !important;
    }
}

/* ========================================
   HOVER INTERATIVO - EFEITO MOUSE
   ======================================== */
.err404-section.err404-interactive .err404-number {
    transition: transform 0.1s ease-out;
}

/* ========================================
   ESTADOS DE FOCO PARA ACESSIBILIDADE
   ======================================== */
.err404-btn:focus {
    outline: 2px solid #FF4000;
    outline-offset: 4px;
}

.err404-link:focus {
    outline: 2px solid #FF4000;
    outline-offset: 2px;
}

/* ========================================
   MODO ESCURO (JÁ É ESCURO, MAS GARANTIR)
   ======================================== */
.err404-section {
    color-scheme: dark;
}