/* ═══════════════════════════════════════════════════════════════════════════
   Atlas H₂V Angola — Global Styles (extraídos do planta.html)
   ═══════════════════════════════════════════════════════════════════════════ */

* {
    font-family: 'Inter', sans-serif;
}

body {
    background: #0b1628;
    color: #e8edf5;
}

/* ─── Scroll personalizado ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #1a273a;
}
::-webkit-scrollbar-thumb {
    background: #c49a2a;
    border-radius: 8px;
}

/* ─── Sidebar ─── */
.sidebar-link {
    transition: all 0.2s;
}
.sidebar-link:hover {
    background-color: rgba(196, 154, 42, 0.1);
    color: #c49a2a;
}
.sidebar-link.active {
    background-color: rgba(196, 154, 42, 0.2);
    color: #c49a2a;
    border-left: 3px solid #c49a2a;
}

/* ─── Cards ─── */
.card-glass {
    background: rgba(7, 16, 30, 0.75);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.card-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.card-gold {
    background: linear-gradient(145deg, #003b5c, #001e33);
    border: 1px solid rgba(196, 154, 42, 0.25);
}

.card-dark {
    background-color: #07101e;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.card-gradient {
    background: linear-gradient(135deg, #003b5c 0%, #001e33 100%);
    border: 1px solid rgba(196, 154, 42, 0.2);
}

/* ─── Badges ─── */
.badge-gold {
    background: rgba(196, 154, 42, 0.15);
    color: #c49a2a;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ─── Botões ─── */
.btn-gold {
    background: #c49a2a;
    color: #000;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.btn-gold:hover {
    background: #eab308;
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(196, 154, 42, 0.3);
}
.btn-gold:active {
    transform: scale(0.98);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d1d9e6;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    transition: 0.2s;
    cursor: pointer;
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}
.btn-ghost:active {
    transform: scale(0.97);
}

.btn-primary {
    background: #c49a2a;
    color: #000;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover {
    background: #eab308;
}

.btn-success {
    background: #22c55e;
    color: #000;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.btn-success:hover {
    background: #34d96b;
    transform: scale(1.02);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.btn-danger:hover {
    background: #f87171;
    transform: scale(1.02);
}

/* ─── Títulos ─── */
.subsection-title {
    border-left: 3px solid #c49a2a;
    padding-left: 0.75rem;
}

/* ─── Tooltips ─── */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(196, 154, 42, 0.2);
    border: 1px solid rgba(196, 154, 42, 0.3);
    color: #c49a2a;
    font-size: 9px;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s;
}
.tooltip-trigger:hover {
    background: #c49a2a;
    color: #000;
}
.tooltip-text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: #1a2b44;
    border: 1px solid #c49a2a;
    color: #e8edf5;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.7rem;
    line-height: 1.4;
    width: 220px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.tooltip-container:hover .tooltip-text {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}
.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #c49a2a;
}

/* ─── Animações KPI ─── */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.kpi-animate {
    animation: countUp 0.5s ease-out;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196, 154, 42, 0); }
    50% { box-shadow: 0 0 20px 4px rgba(196, 154, 42, 0.15); }
}
.kpi-flash {
    animation: pulse-glow 0.6s ease-out;
}

/* ─── Avisos de validação ─── */
.validation-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-left: 4px solid #eab308;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #fde68a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}
.validation-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 4px solid #ef4444;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}
.validation-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-left: 4px solid #22c55e;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #86efac;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

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

/* ─── Checkbox personalizado para falhas múltiplas ─── */
.failure-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.8rem;
    color: #9ca3af;
}
.failure-checkbox:hover {
    background: rgba(255,255,255,0.05);
}
.failure-checkbox input[type="checkbox"] {
    accent-color: #c49a2a;
    width: 16px;
    height: 16px;
}
.failure-checkbox.active {
    color: #e8edf5;
}

/* ─── Cenários personalizados ─── */
.custom-scenario-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(196, 154, 42, 0.15);
    border: 1px solid rgba(196, 154, 42, 0.3);
    color: #c49a2a;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}
.custom-scenario-tag:hover {
    background: rgba(196, 154, 42, 0.25);
}
.custom-scenario-tag .delete {
    color: #ef4444;
    cursor: pointer;
    font-size: 0.65rem;
    margin-left: 0.2rem;
}

/* ─── Break-even chart interactivo ─── */
.breakeven-slider-container {
    background: rgba(7, 16, 30, 0.5);
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.06);
}
.breakeven-slider-container input[type="range"] {
    width: 100%;
}

/* ─── Loading spinner ─── */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(196, 154, 42, 0.3);
    border-top-color: #c49a2a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Chat ─── */
.chat-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    background: #c49a2a;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #0b1628;
    box-shadow: 0 8px 32px rgba(196, 154, 42, 0.4);
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
}
.chat-fab:hover {
    transform: scale(1.08) rotate(-6deg);
    box-shadow: 0 12px 40px rgba(196, 154, 42, 0.6);
}
.chat-fab .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-panel {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 420px;
    max-width: 90vw;
    height: 560px;
    max-height: 70vh;
    background: #0f1a2c;
    border-radius: 1.5rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(196, 154, 42, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1000;
}
.chat-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.chat-panel .header {
    background: #07101e;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-panel .header h4 {
    font-weight: 600;
    color: #c49a2a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.chat-panel .header button {
    background: none;
    border: none;
    color: #8a9bb5;
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s;
}
.chat-panel .header button:hover {
    color: #fff;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.chat-messages .msg {
    max-width: 85%;
    padding: 0.6rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    animation: fadeUp 0.3s ease;
}
.chat-messages .msg.user {
    background: #1a2b44;
    color: #e8edf5;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}
.chat-messages .msg.ia {
    background: #0b1628;
    border: 1px solid #2a3a55;
    color: #cdd9e9;
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

.chat-input {
    padding: 0.75rem 1.5rem 1.5rem;
    background: #07101e;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 0.75rem;
}
.chat-input input {
    flex: 1;
    background: #1a273a;
    border: 1px solid #2a3a55;
    border-radius: 2rem;
    padding: 0.6rem 1.2rem;
    color: #e8edf5;
    font-size: 0.875rem;
    outline: none;
    transition: 0.2s;
}
.chat-input input:focus {
    border-color: #c49a2a;
}
.chat-input button {
    background: #c49a2a;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: #0b1628;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-input button:hover {
    background: #eab308;
    transform: scale(1.05);
}

.chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.chat-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ─── Inputs ─── */
input[type="range"] {
    accent-color: #c49a2a;
    height: 6px;
    background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: #25344f;
    border-radius: 3px;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c49a2a;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(196, 154, 42, 0.4);
    margin-top: -6px;
    transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
input[type="range"]::-moz-range-track {
    height: 6px;
    background: #25344f;
    border-radius: 3px;
    border: none;
}
input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c49a2a;
    cursor: pointer;
    border: none;
}

select,
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"] {
    background: #111f33;
    border: 1px solid #25344f;
    color: #e8edf5;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    outline: none;
    transition: 0.2s;
}
select:focus,
input:focus {
    border-color: #c49a2a;
}

/* ─── KPI ─── */
.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a9bb5;
}

/* ─── Risk badges ─── */
.risk-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.risk-low {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}
.risk-medium {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}
.risk-high {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ─── IA Messages ─── */
.ia-msg {
    background: #0f172a;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem 0.75rem 0.75rem 0;
    max-width: 80%;
}
.user-msg {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem 0.75rem 0 0.75rem;
    max-width: 80%;
    align-self: flex-end;
}

/* ─── Selected region ─── */
.selected-region {
    border: 2px solid #c49a2a;
}

/* ─── Scenario buttons ─── */
.scenario-btn {
    transition: all 0.2s;
    border: 2px solid transparent;
    cursor: pointer;
}
.scenario-btn:hover {
    border-color: rgba(196, 154, 42, 0.4);
    background-color: rgba(196, 154, 42, 0.08);
}
.scenario-btn.active {
    border-color: #c49a2a;
    background-color: rgba(196, 154, 42, 0.15);
}

/* ─── Pipeline steps ─── */
.pipeline-step {
    position: relative;
    padding-left: 2rem;
}
.pipeline-step::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #c49a2a;
}
.pipeline-step:last-child::before {
    display: none;
}
.pipeline-dot {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    background: #c49a2a;
    border-radius: 50%;
}

/* ─── Highlight box ─── */
.highlight-box {
    border-left: 4px solid #c49a2a;
    background: rgba(196, 154, 42, 0.08);
}

/* ─── Tabela de cenários melhorada ─── */
.table-scenarios {
    width: 100%;
    border-collapse: collapse;
}
.table-scenarios th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a9bb5;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.table-scenarios td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.85rem;
}
.table-scenarios tr:hover td {
    background: rgba(255,255,255,0.03);
}

/* ─── Print-friendly ─── */
@media print {
    .sidebar-desktop, .chat-fab, .chat-panel, .chat-overlay,
    #btn-salvar, #btn-comparar, #btn-relatorio, #btn-export-pdf,
    .btn-ghost, .btn-gold {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    .card-glass, .card-gold {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    .card-glass:hover, .card-gold:hover {
        transform: none !important;
    }
    .kpi-value, .kpi-label, .text-white, .text-gray-300, .text-gray-400 {
        color: black !important;
    }
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .chat-panel {
        right: 1rem;
        bottom: 5.5rem;
        width: calc(100vw - 2rem);
        height: 65vh;
        border-radius: 1rem;
    }
    .chat-fab {
        width: 56px;
        height: 56px;
        font-size: 24px;
        bottom: 1.25rem;
        right: 1.25rem;
    }
}

@media (max-width: 1024px) {
    .sidebar-desktop {
        display: none;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }
}

@media (min-width: 1025px) {
    .sidebar-mobile-toggle {
        display: none;
    }
}

/* ─── Transition utilities ─── */
.transition-slide {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}
.transition-fast {
    transition: all 0.15s ease;
}

/* ─── Chips de detalhes do site (planeamento) ─── */
.chip-real {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .22rem .6rem;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.09);
}
.chip-real i { color: #c49a2a; font-size: .65rem; }
