* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: url('images/background.webp') center/cover no-repeat fixed;
    color: #ffffff;
    overflow-x: hidden;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(20, 30, 48, 0.85) 100%);
    z-index: 1;
}

.container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 900px;
    text-align: center;
}

.logo-container {
    margin-bottom: 2rem;
    animation: fadeInDown 1s ease-out;
}

.logo {
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #a8d5ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out 0.2s both;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.3);
}

.subtitle {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    color: #e0e0e0;
    max-width: 600px;
    line-height: 1.6;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.countdown-container {
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.countdown-label {
    font-size: 1.2rem;
    color: #b0c4de;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.countdown {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.time-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem 2rem;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.time-box:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.time-value {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.time-label {
    font-size: 0.9rem;
    color: #b0c4de;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.time-separator {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    opacity: 0.6;
    animation: blink 2s ease-in-out infinite;
}

.info-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    max-width: 600px;
    animation: fadeInUp 1s ease-out 0.8s both;
}

.icon {
    width: 30px;
    height: 30px;
    color: #a8d5ff;
    flex-shrink: 0;
}

.info-message p {
    font-size: 1rem;
    color: #e0e0e0;
    line-height: 1.5;
    text-align: left;
}

.footer {
    padding: 2rem 0 1rem;
    color: #b0c4de;
    font-size: 0.9rem;
    animation: fadeIn 1s ease-out 1s both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.2;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .logo {
        max-width: 200px;
    }
    
    .time-box {
        min-width: 80px;
        padding: 1rem 1.5rem;
    }
    
    .time-value {
        font-size: 2rem;
    }
    
    .time-separator {
        font-size: 1.5rem;
    }
    
    .countdown {
        gap: 0.5rem;
    }
    
    .info-message {
        flex-direction: column;
        text-align: center;
    }
    
    .info-message p {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .time-box {
        min-width: 70px;
        padding: 0.8rem 1rem;
    }
    
    .time-value {
        font-size: 1.5rem;
    }
    
    .time-label {
        font-size: 0.75rem;
    }
}


/* ========================================
   PWA - TEMA MOBILE EXCLUSIVO
   ======================================== */

/* Detectar mobile e aplicar tema específico */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    body {
        background-attachment: scroll;
    }
    
    .overlay {
        background: linear-gradient(135deg, rgba(10, 20, 40, 0.92) 0%, rgba(30, 50, 80, 0.95) 100%);
    }
    
    .container {
        padding: 1.5rem 1rem;
    }
    
    .content {
        gap: 1.5rem;
    }
    
    /* Logo otimizada para mobile */
    .logo {
        max-width: 180px;
        filter: drop-shadow(0 5px 20px rgba(0, 0, 0, 0.6));
    }
    
    /* Título mobile */
    .title {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding: 0 0.5rem;
    }
    
    /* Countdown mobile otimizado */
    .countdown-container {
        width: 100%;
        margin-bottom: 2rem;
    }
    
    .countdown-label {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .countdown {
        gap: 0.4rem;
        padding: 0 0.5rem;
    }
    
    .time-box {
        min-width: 70px;
        padding: 1rem 0.8rem;
        background: rgba(255, 255, 255, 0.12);
        border: 1.5px solid rgba(255, 255, 255, 0.25);
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }
    
    .time-box:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.15);
    }
    
    .time-value {
        font-size: 1.8rem;
        font-weight: 800;
    }
    
    .time-label {
        font-size: 0.7rem;
    }
    
    .time-separator {
        font-size: 1.5rem;
        margin: 0 -0.2rem;
    }
    
    /* Info message mobile */
    .info-message {
        padding: 1.2rem 1.5rem;
        background: rgba(255, 255, 255, 0.12);
        border: 1.5px solid rgba(255, 255, 255, 0.25);
        margin: 0 0.5rem;
    }
    
    .info-message p {
        font-size: 0.95rem;
        text-align: center;
    }
    
    .icon {
        width: 26px;
        height: 26px;
    }
    
    /* Footer mobile */
    .footer {
        font-size: 0.85rem;
        padding: 1.5rem 0 1rem;
    }
}

/* Tema específico para telas muito pequenas */
@media (max-width: 380px) {
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .time-box {
        min-width: 60px;
        padding: 0.8rem 0.6rem;
    }
    
    .time-value {
        font-size: 1.5rem;
    }
    
    .time-label {
        font-size: 0.65rem;
    }
    
    .countdown {
        gap: 0.3rem;
    }
}

/* ========================================
   PWA - INSTALL PROMPT
   ======================================== */

.install-prompt {
    position: fixed;
    bottom: -200px;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem;
    transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.install-prompt.show {
    bottom: 0;
}

.install-content {
    background: linear-gradient(135deg, #4a90e2 0%, #2c5aa0 100%);
    border-radius: 16px 16px 0 0;
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.install-icon {
    width: 32px;
    height: 32px;
    color: #ffffff;
    flex-shrink: 0;
}

.install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.install-text strong {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 600;
}

.install-text span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

.install-btn {
    background: #ffffff;
    color: #2c5aa0;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.install-btn:active {
    transform: scale(0.95);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.9);
}

/* Ocultar prompt em desktop */
@media (min-width: 769px) {
    .install-prompt {
        display: none;
    }
}

/* ========================================
   PWA - SAFE AREAS (iPhone notch, etc)
   ======================================== */

@supports (padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    .install-prompt {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* ========================================
   PWA - STANDALONE MODE (quando instalado)
   ======================================== */

@media (display-mode: standalone) {
    body {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
    
    .logo {
        -webkit-user-drag: none;
        user-drag: none;
    }
    
    /* Adicionar padding extra no topo quando em modo standalone */
    .container {
        padding-top: max(2rem, env(safe-area-inset-top));
    }
}

/* Animação de pull-to-refresh customizada */
@media (max-width: 768px) {
    body {
        overscroll-behavior-y: contain;
    }
}

/* Otimizações de performance para mobile */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .time-box,
    .install-btn,
    .close-btn {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Desabilitar animações complexas em dispositivos de baixa performance */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}
