/* ============================================
   DESIGN PHILOSOPHY: Dark/Hacker Aesthetic
   - Mobile-first absolute
   - Canvas animado (Matrix style)
   - Card central focado em conversão
   - Tipografia clara e hierárquica
   ============================================ */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background-color: #000000;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 500;
}

/* Canvas animado (fundo) */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.5;
    pointer-events: none;
    display: block;
}

/* Overlay de conteúdo */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    min-height: 100vh;
    pointer-events: auto;
}

/* Card principal */
.card {
    width: 90%;
    max-width: 380px;
    background: linear-gradient(135deg, #0a0a0a 0%, #0f0f0f 100%);
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    animation: slideUp 0.6s ease-out;
}

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

/* Header do card - Logo */
.card-header {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.logo-img {
    margin-bottom: -3rem;
    width: 180px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 2px rgba(124, 92, 255, 0.2));
}

/* Título principal */
.title {
    font-size: clamp(22px, 6vw, 30px);
    font-weight: 800;
    text-align: center;
    color: #ffffff;
    margin-bottom: 14px;
    line-height: 1.35;
    letter-spacing: -0.8px;
}

.title .highlight {
    background: linear-gradient(135deg, #5a3fa0 0%, #7c5cff 50%, #4a90ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

/* Subtexto */
.subtitle {
    font-size: 13px;
    color: #999999;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.2px;
}

/* Input wrapper */
.input-wrapper {
    position: relative;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 16px;
    color: #7c5cff;
    font-weight: 600;
    font-size: 16px;
    pointer-events: none;
}

.input-field {
    width: 100%;
    padding: 14px 16px 14px 36px;
    background-color: #0a0a0a;
    border: 1px solid #2a2a3e;
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input-field::placeholder {
    color: #666666;
    font-weight: 500;
}

.input-field:focus {
    outline: none;
    border-color: #7c5cff;
    box-shadow: 0 0 12px rgba(124, 92, 255, 0.25);
    background-color: #0f0f0f;
}

.input-field:hover {
    border-color: #3a3a4e;
}

/* Badges informativos */
.badges {
    display: flex;
    justify-content: space-around;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: nowrap;
}

.badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    font-size: 12px;
    color: #999999;
    font-weight: 700;
    flex: 1;
    justify-content: center;
    min-width: auto;
    white-space: nowrap;
}

.badge i {
    font-size: 14px;
    color: #7c5cff;
}

.badge-text {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

/* CTA Button */
.cta-button {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #5a3fa0 0%, #7c5cff 50%, #4a90ff 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(107, 76, 255, 0.35);
    margin-bottom: 18px;
    min-height: 50px;
    touch-action: manipulation;
}

.cta-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(107, 76, 255, 0.4);
}

.cta-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(107, 76, 255, 0.3);
}

.cta-button:disabled {
    background: #333333;
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cta-text {
    font-weight: 700;
}

/* Footer informativo - Fora do card */
.footer-text {
    font-size: 12px;
    color: #999999;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-top: 20px;
}

.footer-text #stats-number {
    background: linear-gradient(135deg, #5a3fa0 0%, #7c5cff 50%, #4a90ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Modal de resultado */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 90%;
    max-width: 420px;
    background: linear-gradient(135deg, #0b0b0b 0%, #121212 100%);
    border-radius: 20px;
    padding: 32px 24px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 40px rgba(124, 92, 255, 0.2);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #b0b0b0;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #ffffff;
}

#result-container {
    margin-top: 24px;
}

/* Estilos para resultados */
.result-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(124, 92, 255, 0.2);
}

.result-title {
    font-size: 24px;
    font-weight: 800;
    color: #7c5cff;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(124, 92, 255, 0.2);
}

.result-subtitle {
    font-size: 14px;
    color: #b0b0b0;
    font-weight: 400;
}

/* Stats cards */
.result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: rgba(74, 144, 255, 0.05);
    border: 1px solid rgba(74, 144, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #b0b0b0;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #5a3fa0 0%, #7c5cff 50%, #4a90ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(74, 144, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c5cff 0%, #4a90ff 100%);
    transition: width 0.6s ease;
    border-radius: 2px;
}

/* Result sections */
.result-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Activity times */
.activity-times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.time-badge {
    background-color: rgba(124, 92, 255, 0.1);
    border: 1px solid rgba(124, 92, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #7c5cff;
    font-weight: 600;
}

/* Categories */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.2) 0%, rgba(74, 144, 255, 0.1) 100%);
    border: 1px solid rgba(124, 92, 255, 0.3);
    border-radius: 16px;
    padding: 8px 14px;
    font-size: 13px;
    color: #4a90ff;
    font-weight: 500;
}

/* Legal text */
.legal-text {
    font-size: 12px;
    color: #888888;
    line-height: 1.6;
    background-color: rgba(100, 100, 100, 0.05);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #7c5cff;
}

/* Result action button */
.result-action-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #7c5cff 0%, #4a90ff 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
}

.result-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
}

.result-action-btn:active {
    transform: translateY(0);
}

/* Responsividade */
@media (max-width: 480px) {
    .card {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .title {
        font-size: 20px;
    }

    .badges {
        gap: 6px;
        flex-wrap: wrap;
    }

    .badge {
        flex: 0 1 auto;
        font-size: 11px;
    }

    .modal-content {
        padding: 24px 16px;
    }

    .result-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 20px;
    }
}

/* Suporte a safe-area para notch */
@supports (padding: max(0px)) {
    body {
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Animação de carregamento */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(124, 92, 255, 0.2);
    border-top-color: #7c5cff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
