/* --- Base --- */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: #f3f4f6;
    transition: background-color 0.2s ease, color 0.2s ease;
    overflow-x: hidden;
}

#root {
    min-height: 100vh;
    min-width: 0;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* --- Landing: grid overlay (extraído de teste-landingpage, sem <style> no HTML) --- */
.landing-bg-grid {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

@keyframes rpv-landing-slide-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-anim-up {
    opacity: 0;
    animation: rpv-landing-slide-up 0.75s ease-out forwards;
}

.landing-anim-delay-1 { animation-delay: 0.08s; }
.landing-anim-delay-2 { animation-delay: 0.16s; }
.landing-anim-delay-3 { animation-delay: 0.24s; }
.landing-anim-delay-4 { animation-delay: 0.32s; }
.landing-anim-delay-5 { animation-delay: 0.40s; }
.landing-anim-delay-6 { animation-delay: 0.48s; }

/* Botão "Entrar" na nav da landing: não usar bg-white (é sobrescrito em theme-dark) */
.landing-nav-cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    background-color: #f8fafc;
    color: #020617;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.12), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.landing-nav-cta-primary:hover {
    background-color: #e2e8f0;
    color: #020617;
    border-color: rgba(148, 163, 184, 0.75);
}

/* --- Authenticated shell: light default, escuro com body.theme-dark --- */
.rpv-shell-page {
    background-color: #f8fafc;
}

body.theme-dark .rpv-shell-page {
    background-color: #020617;
    color: #94a3b8;
}

.rpv-topnav {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

body.theme-dark .rpv-topnav {
    background-color: #0f172a;
    border-bottom-color: #1e293b;
}

.rpv-page-title-bar {
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

body.theme-dark .rpv-page-title-bar {
    background-color: #0f172a;
    border-bottom-color: rgba(30, 41, 55, 0.85);
}

body.theme-dark .rpv-table-divide > tr {
    border-color: #1e293b;
}

body.theme-dark .rpv-flight-row:hover {
    background-color: rgba(30, 58, 138, 0.18) !important;
}

body.theme-dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.theme-dark ::-webkit-scrollbar-track {
    background: #0f172a;
}

body.theme-dark ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

body.theme-dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* --- Tema escuro (preferência do utilizador) --- */
body.theme-dark {
    background-color: #020617;
    color: #90a8c7;
}

body.theme-dark .glass-panel {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(100, 116, 139, 0.4);
}

body.theme-dark .bg-white,
body.theme-dark .bg-white\/90 {
    background-color: #0f172a !important;
}

body.theme-dark .bg-slate-50,
body.theme-dark .bg-slate-100 {
    background-color: #111827 !important;
}

body.theme-dark .border-slate-100,
body.theme-dark .border-slate-200 {
    border-color: #334155 !important;
}

body.theme-dark .text-slate-800 {
    color: #f1f5f9 !important;
}

body.theme-dark .text-slate-700 {
    --tw-text-opacity: 1;
    color: rgb(51 65 85 / var(--tw-text-opacity, 1));
}

body.theme-dark .text-slate-600,
body.theme-dark .text-slate-500,
body.theme-dark .text-slate-400 {
    color: #90a8c7 !important;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    background-color: #0b1220 !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
    color: #64748b !important;
}

body.theme-dark .shadow-blue-200 {
    --tw-shadow-color: none;
}

#flight-map {
    height: 400px;
    width: 100%;
    border-radius: 0.5rem;
    z-index: 1;
}

/* --- Dashboard: cards e resultados responsivos --- */
.rpv-dashboard-card {
    min-width: 0;
}

.rpv-flight-card {
    cursor: pointer;
}

.rpv-flight-card:hover {
    border-color: #bfdbfe;
    background-color: #f8fafc;
}

body.theme-dark .rpv-flight-card {
    background-color: #0f172a;
    border-color: #334155;
}

body.theme-dark .rpv-flight-card:hover {
    border-color: #3b82f6;
    background-color: rgba(30, 58, 138, 0.15);
}

.rpv-results-scroll-hint {
    position: relative;
}

@media (max-width: 1023px) {
    .rpv-results-scroll-hint::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 1.5rem;
        pointer-events: none;
        background: linear-gradient(to left, rgba(248, 250, 252, 0.95), transparent);
    }

    body.theme-dark .rpv-results-scroll-hint::after {
        background: linear-gradient(to left, rgba(15, 23, 42, 0.95), transparent);
    }
}
