/* ============================================================
   AE4RIA — unified theme for the AI Skills (Dash) app
   Matches the SDG Tracker look. Auto-loaded from /assets/.
   Overrides the app's inline styles with !important where
   needed. Touches ZERO application logic.
   ============================================================ */

/* Font Awesome (the app references fa-* icons but doesn't load FA) */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css');

:root {
    --navy: #0a1f44;
    --navy-2: #12305f;
    --blue: #1D76B6;
    --blue-2: #2e8bc0;
    --blue-light: #4a90e2;
    --ink: #1a2438;
    --muted: #5b6b85;
    --muted-2: #8a97ac;
    --line: #e3e8f0;
    --line-2: #eef2f8;
    --bg: #f4f7fb;
    --bg-tint: #eef3fa;
    --card: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 20px rgba(10,31,68,0.07);
    --shadow-lg: 0 14px 46px rgba(10,31,68,0.13);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Page background (same tinted look as the Tracker) ---------- */
html, body {
    background:
        radial-gradient(1100px 460px at 50% -160px, var(--bg-tint) 0%, rgba(238,243,250,0) 70%),
        var(--bg) !important;
    color: var(--ink);
}

/* ---------- Typography: Segoe UI everywhere Roboto is hard-coded ---------- */
body, .container, .container * { font-family: var(--font); }
[style*="Roboto"] { font-family: var(--font) !important; }
/* keep icon fonts intact */
.fa, .fas, .far, .fal, .fab, [class^="fa-"], [class*=" fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
}
.fab { font-family: "Font Awesome 6 Brands" !important; }

/* ---------- Header (logo + "AI Skills") ---------- */
/* the header is the first centered flex block */
.container > .row:first-child .text-center.my-4 {
    padding: 6px 0 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 26px !important;
    position: relative;
}
.container > .row:first-child .text-center.my-4::after {
    content: ""; position: absolute; left: 50%; transform: translateX(-50%);
    bottom: -1px; width: 128px; height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, var(--blue) 0%, var(--blue-light) 100%);
}
/* "AI Skills" wordmark → navy to match the Tracker's titles */
.text-center.my-4 span[style*="2.5rem"] {
    color: var(--navy) !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
}

/* ---------- Cards: unified shadow / border / radius ---------- */
.card {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
    background: var(--card) !important;
}
/* the main upload card gets a slightly stronger lift */
.container > .row:nth-child(2) .card { box-shadow: var(--shadow-lg) !important; }

/* ---------- Upload drop-zone (#upload-data) ---------- */
#upload-data {
    border-width: 2px !important;
    border-style: dashed !important;
    border-color: #c4d0e4 !important;
    background: #fafbfe !important;
    border-radius: var(--radius) !important;
    height: 168px !important;
    transition: border-color .18s ease, background .18s ease !important;
}
#upload-data:hover { border-color: var(--blue) !important; background: #f2f7ff !important; }

/* upload inner content */
#upload-text { text-align: center; }
#upload-text i.fas, #upload-text i.fa, #upload-text .fa-cloud-upload-alt {
    color: var(--blue) !important;
    background: rgba(29,118,182,0.10);
    width: 62px; height: 62px; line-height: 62px;
    border-radius: 15px; display: inline-block; margin-bottom: 10px !important;
    font-size: 26px !important;
}
#upload-text span { color: var(--ink) !important; font-weight: 600 !important; }
#upload-text a {
    color: var(--blue) !important;
    border-bottom: 2px solid var(--blue) !important;
    font-weight: 700 !important;
}
#upload-text a:hover { color: var(--navy) !important; border-bottom-color: var(--navy) !important; }

/* ---------- Tabs (#analysis-tabs) ---------- */
#analysis-tabs .tab-container, #analysis-tabs { border: none !important; }
#analysis-tabs .tab {
    background: #ffffff !important;
    color: var(--muted) !important;
    border: 1px solid var(--line) !important;
    border-bottom: none !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 14px 26px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    transition: color .15s ease, background .15s ease !important;
}
#analysis-tabs .tab:hover { color: var(--blue) !important; background: #f6f9fe !important; }
#analysis-tabs .tab--selected {
    background: linear-gradient(120deg, var(--blue) 0%, var(--blue-light) 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    border-top: 3px solid var(--blue) !important;
    box-shadow: 0 -2px 10px rgba(29,118,182,0.22) !important;
}

/* ---------- Buttons: gradient like the Tracker ---------- */
.btn-primary, .btn-info {
    background: linear-gradient(120deg, var(--blue) 0%, var(--blue-light) 100%) !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}
.btn-primary:hover, .btn-info:hover {
    filter: brightness(1.05);
    box-shadow: 0 8px 22px rgba(29,118,182,0.34) !important;
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--navy) !important; border: none !important;
    border-radius: var(--radius-sm) !important; font-weight: 700 !important;
}
.btn-secondary:hover { background: var(--navy-2) !important; }

/* ---------- HTML headings → navy hierarchy ---------- */
h1, h2, h3, h4, .card-body h4 { color: var(--navy); }

/* ---------- dbc alerts: rounder, softer ---------- */
.alert { border-radius: var(--radius-sm) !important; border: 1px solid transparent; }
.alert-info { background: rgba(29,118,182,0.08) !important; color: #14496f !important; border-color: rgba(29,118,182,0.18) !important; }
.alert-warning { border-radius: var(--radius-sm) !important; }
.alert-danger { border-radius: var(--radius-sm) !important; }

/* ---------- Skill / course cards (inner) refinements ---------- */
.skill-card, .course-item {
    border-radius: 12px !important;
    transition: transform .15s ease, box-shadow .15s ease !important;
}
.skill-card:hover, .course-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow) !important;
}

/* ---------- Scrollbars (subtle, on-brand) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c9d4e5; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-light); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ============================================================
   TWEAKS (appended — later rules win)
   ============================================================ */

/* 1) SINGLE dashed drop-zone: remove the wrapping card's frame around the upload */
.container > .row:nth-child(2) .card { border: none !important; box-shadow: none !important; background: transparent !important; }
.container > .row:nth-child(2) .card-body { padding: 0 !important; }

/* 2) "AI Skills" wordmark in AE4RIA blue (not near-black navy) */
.text-center.my-4 span[style*="2.5rem"] { color: var(--blue) !important; }

/* 3) Hide the empty Plotly chart's stray axes on first load.
      A rendered PIE chart uses the pie layer (not cartesian), so it is unaffected. */
#skill-pie-chart .cartesianlayer,
#skill-pie-chart .xaxislayer-above,
#skill-pie-chart .yaxislayer-above,
#skill-pie-chart .xtick,
#skill-pie-chart .ytick,
#skill-pie-chart .gridlayer,
#skill-pie-chart .zerolinelayer,
#skill-pie-chart .xlines-above,
#skill-pie-chart .ylines-above { display: none !important; }

/* ============================================================
   TWEAKS 2 — header BAR + footer (like the SDG Tracker)
              + single dashed drop-zone (container-fluid safe)
   ============================================================ */

/* ---------- Header BAR ---------- */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 14px rgba(10,31,68,0.06);
    position: sticky; top: 0; z-index: 50;
}
.site-header::after {
    content: ""; display: block; height: 3px;
    background: linear-gradient(90deg, var(--blue) 0%, var(--blue-light) 55%, var(--navy) 100%);
}
.site-header-inner {
    max-width: 1180px; margin: 0 auto; padding: 12px 26px;
    display: flex; align-items: center; gap: 16px;
}
.site-logo { height: 42px; width: auto; display: block; }
.brand-sub {
    font-size: 13px; font-weight: 700; color: var(--navy);
    text-transform: uppercase; letter-spacing: 2.5px; line-height: 1;
    border-left: 2px solid var(--line); padding-left: 16px;
}

/* ---------- Footer ---------- */
.site-footer {
    background: #ffffff; border-top: 1px solid var(--line);
    margin-top: 34px; padding: 22px 26px 26px;
    text-align: center; color: var(--muted); font-size: 12px;
}
.site-footer p { max-width: 960px; margin: 0 auto 8px; line-height: 1.55; }
.site-footer .copyright { font-weight: 700; color: var(--navy); font-size: 12.5px; margin-bottom: 0; }
.site-footer .footer-link { color: var(--blue) !important; font-weight: 700; text-decoration: none; }
.site-footer .footer-link:hover { color: var(--navy) !important; text-decoration: underline; }

/* ---------- SINGLE dashed drop-zone (robust: :has, no container dependency) ---------- */
.card:has(#upload-data) { border: none !important; box-shadow: none !important; background: transparent !important; }
.card:has(#upload-data) .card-body { padding: 0 !important; }
#upload-data { border: 2px dashed #c4d0e4 !important; box-shadow: none !important; }
#upload-data:hover { border-color: var(--blue) !important; }
#upload-data > div { border: none !important; box-shadow: none !important; background: transparent !important; }
