/* ============================================================
   SEEL - Public CSS
   Estilos do frontend público: mapa, detalhe, embed
   ============================================================ */

/* ============================================================
   BASE
   ============================================================ */
.public-body {
    font-family: 'Inter', sans-serif;
    background: #F8FAFC;
    color: #1E293B;
    margin: 0;
    padding: 0;
}

/* ============================================================
   NAVBAR PÚBLICO
   ============================================================ */
.public-navbar {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    z-index: 1000;
}
.public-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.125rem;
    color: white !important;
}

/* ============================================================
   MAIN
   ============================================================ */
.public-main { min-height: calc(100vh - 52px); }
.public-main.fullscreen { height: calc(100vh - 52px); overflow: hidden; }

/* ============================================================
   MAPA - Layout
   ============================================================ */
.map-container {
    display: flex;
    height: 100%;
    position: relative;
}

/* Sidebar */
.map-sidebar {
    width: 360px;
    background: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,.06);
    z-index: 10;
    flex-shrink: 0;
}
.sidebar-header-public {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #E2E8F0;
}
.sidebar-filters {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #F1F5F9;
}
.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Toggle sidebar mobile */
.sidebar-toggle {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 20;
    background: white;
    border: none;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.sidebar-toggle:hover { background: #F1F5F9; }

/* Map area */
.map-area { flex: 1; min-height: 300px; }

/* ============================================================
   FILTROS - Chips
   ============================================================ */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    background: white;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.15s ease;
}
.filter-chip:hover { border-color: #3B82F6; color: #3B82F6; }
.filter-chip.active {
    background: #3B82F6;
    border-color: #3B82F6;
    color: white;
}
.filter-chip.active .chip-count {
    background: rgba(255,255,255,.2);
    color: white;
}
.chip-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.chip-count {
    background: #F1F5F9;
    padding: 0 0.375rem;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
}

/* ============================================================
   CARDS DE OBRA (sidebar do mapa)
   ============================================================ */
.obra-card {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #F1F5F9;
    margin-bottom: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.obra-card:hover { background: #F8FAFC; border-color: #E2E8F0; }
.obra-card.active {
    background: #EFF6FF;
    border-color: #3B82F6;
    box-shadow: 0 0 0 1px #3B82F6;
}
.obra-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.obra-card-location {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-bottom: 0.25rem;
}
.obra-card-dates {
    font-size: 0.6875rem;
    color: #94A3B8;
    margin-top: 0.375rem;
}

/* Badges de status */
.obra-status-badge { font-size: 0.625rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 4px; white-space: nowrap; }
.status-planejamento  { background: #ECFEFF; color: #0E7490; }
.status-em_andamento  { background: #DCFCE7; color: #166534; }
.status-pausada       { background: #FEF3C7; color: #92400E; }
.status-concluida     { background: #F3F4F6; color: #4B5563; }
.status-cancelada     { background: #FEE2E2; color: #991B1B; }
.pub-status { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.625rem; border-radius: 6px; }

/* Info Window do mapa */
.map-info-window { font-family: 'Inter', sans-serif; }
.iw-title { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.25rem; color: #1E293B; }
.iw-location { font-size: 0.75rem; color: #64748B; margin-bottom: 0.375rem; }
.iw-desc { font-size: 0.75rem; color: #64748B; margin-bottom: 0.375rem; }
.iw-dates { font-size: 0.6875rem; color: #94A3B8; }

/* ============================================================
   DETALHE PÚBLICO
   ============================================================ */
.pub-hero {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.pub-hero-title { font-size: 1.5rem; font-weight: 700; color: #0F172A; margin-bottom: 0.5rem; }
.pub-hero-desc { color: #64748B; font-size: 0.9375rem; margin-bottom: 0; }
.pub-hero-stats { display: flex; gap: 1.25rem; flex-shrink: 0; }
.pub-stat { text-align: center; }
.pub-stat-label { font-size: 0.6875rem; color: #94A3B8; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; }
.pub-stat-value { font-size: 1rem; font-weight: 700; color: #1E293B; }

/* Tabs */
.pub-tabs .nav-link {
    font-size: 0.875rem; font-weight: 500; color: #64748B;
    border: none; padding: 0.625rem 1rem;
}
.pub-tabs .nav-link.active {
    color: #3B82F6;
    border-bottom: 2px solid #3B82F6;
    background: transparent;
}

/* Cards genéricos */
.pub-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
}

/* Cards de área (organograma público) */
.pub-area-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    border: 2px solid transparent;
}
.pub-area-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-1px); }
.pub-area-card.active { border-color: #3B82F6; }
.pub-area-bar { height: 4px; }
.pub-area-body { padding: 0.875rem; }
.pub-avatar-sm {
    width: 26px; height: 26px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 0.6875rem; flex-shrink: 0;
}

/* ============================================================
   GANTT PÚBLICO
   ============================================================ */
.pub-gantt { overflow-x: auto; }
.pub-gantt-header {
    display: flex; border-bottom: 1px solid #E2E8F0; background: #F8FAFC;
}
.pub-gantt-month {
    text-align: center; font-size: 0.6875rem; font-weight: 600;
    color: #94A3B8; padding: 0.5rem 0.125rem; border-right: 1px solid #F1F5F9;
}
.pub-gantt-row {
    position: relative; height: 32px; border-bottom: 1px solid #F8FAFC;
}
.pub-gantt-row.is-child { background: #FAFBFC; }
.pub-gantt-label {
    position: absolute; left: 0; top: 0; height: 100%; z-index: 2;
    display: flex; align-items: center; gap: 0.25rem;
    padding: 0 0.625rem; font-size: 0.75rem; font-weight: 500;
    white-space: nowrap; color: #334155;
}
.pub-gantt-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.pub-gantt-pct { font-size: 0.625rem; color: #94A3B8; }
.pub-gantt-bar {
    position: absolute; top: 6px; height: 20px;
    border-radius: 4px; opacity: 0.2; min-width: 3px;
}
.pub-gantt-fill {
    position: absolute; top: 0; left: 0; height: 100%;
    background: inherit; opacity: 1; border-radius: 4px;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 991.98px) {
    .map-sidebar {
        position: absolute;
        top: 0; left: 0; bottom: 0;
        width: 320px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .map-sidebar.open {
        transform: translateX(0);
    }
    .map-area { width: 100%; }
}

@media (max-width: 575.98px) {
    .map-sidebar { width: 100%; }
    .pub-hero { padding: 1rem; }
    .pub-hero-title { font-size: 1.25rem; }
    .pub-hero-stats { flex-wrap: wrap; gap: 0.75rem; }
    .pub-tabs .nav-link { font-size: 0.8125rem; padding: 0.5rem 0.75rem; }
}
