/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #141432 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alterado para flex-start para mobile */
    padding: 15px;
    min-height: 100vh;
    overflow-y: auto; /* Permite rolagem vertical */
}

/* EFEITO DE ONDAS NO FUNDO */
.waves-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: linear-gradient(90deg, 
        transparent,
        rgba(0, 150, 255, 0.1),
        transparent);
    animation: waveMove 10s linear infinite;
    opacity: 0.5;
}

.wave-1 { animation-duration: 15s; bottom: 20%; }
.wave-2 { animation-duration: 12s; bottom: 40%; opacity: 0.3; }
.wave-3 { animation-duration: 8s; bottom: 60%; opacity: 0.2; }

@keyframes waveMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* CONTAINER PRINCIPAL */
.maintenance-container {
    width: 100%;
    max-width: 400px;
    background: rgba(15, 15, 35, 0.95);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    position: relative;
    z-index: 10;
    border: 2px solid #00aaff;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 170, 255, 0.3);
    backdrop-filter: blur(5px);
    animation: containerSlide 0.8s ease-out;
    margin: 10px 0; /* Margem para mobile */
}

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

/* BOTÃO DE ÁUDIO */
.audio-control {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #0066cc;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #00aaff;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
    transition: all 0.3s;
    animation: buttonAppear 0.5s ease-out 0.2s both;
}

@keyframes buttonAppear {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.audio-control:hover {
    transform: scale(1.1);
    background: #0088ff;
}

.audio-control:active {
    transform: scale(0.95);
}

.audio-control i {
    font-size: 22px;
    color: white;
}

.audio-control.playing {
    background: #0088ff;
    box-shadow: 0 0 20px rgba(0, 136, 255, 0.6);
    animation: audioPulse 2s infinite;
}

@keyframes audioPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 136, 255, 0.6); }
    50% { box-shadow: 0 0 30px rgba(0, 136, 255, 0.9); }
}

/* LOGO */
.logo-container {
    margin: 10px 0 25px 0;
    animation: logoReveal 0.8s ease-out 0.3s both;
}

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

.logo-img {
    width: 180px;
    height: 80px;
    margin: 0 auto 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(0, 50, 100, 0.2);
    padding: 10px;
    border: 2px solid #00aaff;
    box-shadow: 0 5px 15px rgba(0, 170, 255, 0.2);
}

.logo-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: logoFadeIn 0.5s ease-out;
}

@keyframes logoFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #00aaff;
    font-weight: bold;
    font-size: 20px;
}

.logo-text h1 {
    font-size: 24px;
    color: #00aaff;
    margin-bottom: 5px;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-text p {
    font-size: 13px;
    color: #88ccff;
    letter-spacing: 1.5px;
}

/* TÍTULO */
.title {
    font-size: 28px;
    color: #00aaff;
    margin: 15px 0 10px 0;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: titleReveal 0.6s ease-out 0.5s both;
}

@keyframes titleReveal {
    from { 
        letter-spacing: 10px;
        opacity: 0;
    }
    to { 
        letter-spacing: 2px;
        opacity: 1;
    }
}

.subtitle {
    font-size: 16px;
    color: #aaddff;
    margin-bottom: 25px;
    line-height: 1.5;
    animation: fadeInUp 0.6s ease-out 0.7s both;
}

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

/* CONTAGEM REGRESSIVA */
.countdown-container {
    margin: 25px 0;
    animation: fadeInUp 0.6s ease-out 0.8s both;
}

.countdown-title {
    font-size: 18px;
    color: #00aaff;
    margin-bottom: 20px;
    font-weight: 600;
}

.countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.countdown-item {
    background: rgba(0, 40, 80, 0.4);
    border-radius: 12px;
    padding: 15px 5px;
    border: 1px solid rgba(0, 170, 255, 0.3);
    position: relative;
    overflow: hidden;
    animation: countdownAppear 0.5s ease-out both;
    animation-delay: calc(var(--delay) * 0.1s + 0.9s);
}

@keyframes countdownAppear {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.countdown-value {
    font-size: 32px;
    font-weight: 800;
    color: #00aaff;
    font-family: 'Courier New', monospace;
    display: block;
    line-height: 1;
    margin-bottom: 5px;
}

.countdown-label {
    font-size: 12px;
    color: #88ccff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* STATUS */
.status-container {
    background: rgba(0, 30, 60, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #00aaff;
    animation: slideInRight 0.6s ease-out 1.1s both;
}

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.status-title {
    color: #00aaff;
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.status-title i {
    margin-right: 10px;
    font-size: 18px;
}

.status-list {
    list-style: none;
}

.status-list li {
    font-size: 14px;
    color: #cceeff;
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.4;
    animation: listItemAppear 0.4s ease-out both;
    animation-delay: calc(var(--delay) * 0.1s + 1.2s);
}

@keyframes listItemAppear {
    from { 
        transform: translateX(-20px);
        opacity: 0;
    }
    to { 
        transform: translateX(0);
        opacity: 1;
    }
}

.status-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #00aaff;
    font-weight: bold;
}

/* RODAPÉ */
.footer-section {
    animation: fadeInUp 0.6s ease-out 1.4s both;
}

.contact-info {
    font-size: 14px;
    color: #88ccff;
    line-height: 1.6;
    margin-bottom: 15px;
}

.contact-info a {
    color: #00aaff;
    text-decoration: none;
    font-weight: 600;
}

.audio-status {
    font-size: 12px;
    color: #66ff88;
    margin-top: 10px;
    font-weight: 600;
    animation: statusBlink 2s infinite;
    display: none; /* Escondido por padrão, visível apenas em mobile */
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* BOTÃO DE CONTATO */
.emergency-contact {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    transition: all 0.3s;
    animation: fadeInUp 0.6s ease-out 1.5s both;
    box-shadow: 0 5px 20px rgba(255, 0, 0, 0.3);
}

.emergency-contact:active {
    transform: scale(0.98);
}

/* ANIMAÇÕES DE CARROS */
.car-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.car {
    position: absolute;
    color: rgba(0, 170, 255, 0.4);
    font-size: 30px;
    animation: driveCar 20s linear infinite;
}

.car-1 { top: 20%; animation-delay: 0s; }
.car-2 { top: 50%; animation-delay: 5s; }
.car-3 { top: 70%; animation-delay: 10s; animation-direction: reverse; }

@keyframes driveCar {
    0% { left: -50px; }
    100% { left: calc(100% + 50px); }
}

/* ============================================= */
/* RESPONSIVIDADE - CORREÇÕES PARA MOBILE */
/* ============================================= */

/* Mobile: Telas menores que 480px */
@media (max-width: 480px) {
    body {
        padding: 10px;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
        display: block;
        align-items: flex-start;
    }
    
    .maintenance-container {
        max-width: 100%;
        padding: 20px 15px;
        margin: 5px auto 20px auto;
        border-radius: 15px;
    }
    
    .audio-control {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .audio-control i {
        font-size: 20px;
    }
    
    .logo-container {
        margin: 5px 0 20px 0;
    }
    
    .logo-img {
        width: 140px;
        height: 65px;
    }
    
    .logo-text h1 {
        font-size: 20px;
    }
    
    .logo-text p {
        font-size: 11px;
    }
    
    .title {
        font-size: 22px;
        margin: 10px 0 8px 0;
        letter-spacing: 1px;
    }
    
    .subtitle {
        font-size: 14px;
        margin-bottom: 20px;
        padding: 0 5px;
    }
    
    .countdown-container {
        margin: 20px 0;
    }
    
    .countdown-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .countdown {
        gap: 8px;
    }
    
    .countdown-item {
        padding: 12px 5px;
    }
    
    .countdown-value {
        font-size: 26px;
    }
    
    .countdown-label {
        font-size: 11px;
    }
    
    .status-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .status-title {
        font-size: 15px;
    }
    
    .status-list li {
        font-size: 13px;
        margin: 8px 0;
    }
    
    .contact-info {
        font-size: 13px;
    }
    
    .emergency-contact {
        padding: 15px;
        font-size: 15px;
    }
    
    .audio-status {
        display: block; /* Mostra status do áudio em mobile */
        margin-top: 8px;
        font-size: 11px;
    }
    
    /* Otimiza performance em mobile */
    .car-animation {
        display: none;
    }
    
    .waves-bg {
        opacity: 0.7;
    }
}

/* Mobile muito pequeno (iPhone SE, etc) */
@media (max-width: 320px) {
    .maintenance-container {
        padding: 15px 12px;
        margin: 0;
    }
    
    .logo-img {
        width: 120px;
        height: 55px;
    }
    
    .title {
        font-size: 20px;
    }
    
    .countdown {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 6px;
    }
    
    .countdown-item {
        padding: 10px 3px;
    }
    
    .countdown-value {
        font-size: 22px;
    }
    
    .countdown-label {
        font-size: 10px;
    }
    
    .emergency-contact {
        padding: 14px;
        font-size: 14px;
    }
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 20px;
        align-items: center;
    }
    
    .maintenance-container {
        max-width: 90%;
        margin: 20px auto;
    }
    
    .logo-img {
        width: 160px;
        height: 75px;
    }
}

/* Desktop pequeno */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding: 30px;
    }
    
    .maintenance-container {
        max-width: 450px;
    }
}