/* ==========================================================================
   SLOTH — Tesouro Direto Explorer
   Global stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.navbar-brand {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand .sloth-icon {
    font-size: 1.5rem;
}

.brand-full { display: inline; }
.brand-short { display: none; font-weight: 700; }

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
}

.navbar-nav .nav-link i {
    font-size: 1.1rem;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 991px) {
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    .navbar-collapse {
        margin-top: 0.5rem;
    }
}

@media (max-width: 576px) {
    .brand-full { display: none; }
    .brand-short { display: inline; }
    .navbar-brand { font-size: 0.95rem; }
}

@media (min-width: 992px) {
    .navbar .nav-item.dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
    margin-top: 3rem;
    padding: 2rem 0;
    background-color: #f8f9fa;
}

/* --------------------------------------------------------------------------
   HTMX loading indicator
   -------------------------------------------------------------------------- */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Stat cards  (used on home, admin, investor_detail)
   -------------------------------------------------------------------------- */
.stat-card {
    border-left: 4px solid #0d6efd;
    transition: transform 0.15s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
}
.stat-card.green  { border-left-color: #198754; }
.stat-card.orange { border-left-color: #fd7e14; }
.stat-card.purple { border-left-color: #6610f2; }
.stat-card.red    { border-left-color: #dc3545; }

/* Overrides for detailed investor cards */
.stat-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
}
.stat-card .card-subtitle { margin-bottom: 0.25rem; }
.stat-card .card-title    { margin: 0; font-size: 1.4rem; }

/* --------------------------------------------------------------------------
   Scrollable tables
   -------------------------------------------------------------------------- */
.table-responsive {
    max-height: 600px;
    overflow-y: auto;
}

/* --------------------------------------------------------------------------
   Heatmap / cross-tab tables  (demographics pages)
   Always wrapped in .table-responsive: horizontal scroll on small screens,
   no overflow outside the card and no truncated cell content.
   -------------------------------------------------------------------------- */
.heatmap-table {
    margin-bottom: 0;
}
.heatmap-table th,
.heatmap-table td {
    font-size: 0.82rem;
    white-space: nowrap;
}
.heatmap-table thead th {
    white-space: normal;   /* headers may wrap to keep data columns narrow */
    vertical-align: bottom;
    min-width: 4.2rem;
}
/* First column (row label): sticky while scrolling horizontally; long
   labels wrap instead of truncating. */
.heatmap-table th.row-label,
.heatmap-table td.row-label {
    position: sticky;
    left: 0;
    z-index: 1;
    text-align: left;
    white-space: normal;
    min-width: 6rem;
    max-width: 11rem;
    background-color: #fff;
}
.heatmap-table thead th.row-label {
    z-index: 2;
    background-color: #f8f9fa;   /* match .table-light */
}

/* --------------------------------------------------------------------------
   Admin section
   -------------------------------------------------------------------------- */
.admin-header {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
    color: #fff;
    padding: 2rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.badge-admin { background-color: #6610f2; }
.user-row td { vertical-align: middle; }

/* --------------------------------------------------------------------------
   Auth pages  (login, register, change_password)
   -------------------------------------------------------------------------- */
.auth-card {
    max-width: 420px;
    margin: 2rem auto;
}
.auth-card .card {
    border: none;
    box-shadow: 0 4px 24px rgba(13, 110, 253, 0.10);
    border-radius: 1rem;
}
.auth-card .card-header {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 60%);
    color: #fff;
    border-radius: 1rem 1rem 0 0 !important;
    padding: 1.5rem;
    text-align: center;
}
.password-hint { font-size: 0.8rem; }

/* Collapsible executive summaries (SEO/GEO) */
.executive-summary-details summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
}
.executive-summary-details summary::-webkit-details-marker {
    display: none;
}
.executive-summary-details[open] summary .toggle-icon {
    transform: rotate(180deg);
}
.executive-summary-details .toggle-icon {
    transition: transform 0.2s ease;
}
