/* static/css/design-system.css */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400&display=swap');

/* All styles are scoped under .pulsi-theme-dark – they will only apply when this class is present on a parent element */
.pulsi-theme-dark {
  --brand-bg:        #080e1d;
  --brand-surface:   #0f172a;
  --brand-surface2:  #111827;
  --brand-border:    rgba(255,255,255,0.06);
  --brand-blue:      #2563eb;
  --brand-blue-glow: rgba(37,99,235,0.18);
  --brand-emerald:   #10b981;
  --brand-amber:     #f59e0b;
  --brand-violet:    #7c3aed;
  --text-primary:    #f1f5f9;
  --text-secondary:  #94a3b8;
  --text-muted:      #475569;

  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--brand-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar (only when theme is active) */
.pulsi-theme-dark ::-webkit-scrollbar            { width: 5px; height: 5px; }
.pulsi-theme-dark ::-webkit-scrollbar-track      { background: transparent; }
.pulsi-theme-dark ::-webkit-scrollbar-thumb      { background: #1e293b; border-radius: 99px; }
.pulsi-theme-dark ::-webkit-scrollbar-thumb:hover{ background: #334155; }

/* Animations (global, can be used anywhere) */
@keyframes countUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
  50%       { box-shadow: 0 0 32px 8px rgba(37,99,235,0.15); }
}

@keyframes scanLine {
  0%   { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}

@keyframes progressFill {
  from { width: 0%; }
  to   { width: var(--target-width); }
}

/* Utility classes (only effective under .pulsi-theme-dark) */
.pulsi-theme-dark .font-jakarta { font-family: 'Plus Jakarta Sans', sans-serif; }

.pulsi-theme-dark .hero-score {
  font-size: clamp(4rem, 12vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  animation: countUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@media (min-width: 1024px) {
  .pulsi-theme-dark .hero-score { font-size: 5rem; }
}

.pulsi-theme-dark .score-pct {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  vertical-align: super;
  line-height: 1;
}

.pulsi-theme-dark .pillar-score {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}
.pulsi-theme-dark .regional-score {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}
.pulsi-theme-dark .hq-badge {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.pulsi-theme-dark .section-eyebrow {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.pulsi-theme-dark .section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.pulsi-theme-dark .glass-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
}
.pulsi-theme-dark .glass-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37,99,235,0.5);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.7);
}

.pulsi-theme-dark .card-glow:hover {
  box-shadow: 0 0 40px rgba(37,99,235,0.2), 0 20px 60px rgba(0,0,0,0.6);
}

.pulsi-theme-dark .pillar-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pulsi-theme-dark .pillar-card:hover {
  transform: translateY(-3px);
}

.pulsi-theme-dark .project-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.pulsi-theme-dark .project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.pulsi-theme-dark .float-badge {
  animation: floatBadge 4s ease-in-out infinite;
}

.pulsi-theme-dark .shimmer-text {
  background: linear-gradient(90deg, #94a3b8 0%, #f1f5f9 40%, #94a3b8 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

.pulsi-theme-dark .progress-bar {
  height: 3px;
  border-radius: 9px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.pulsi-theme-dark .glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,0.5), transparent);
}

.pulsi-theme-dark .bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
}

.pulsi-theme-dark .radial-hero {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37,99,235,0.15), transparent),
    radial-gradient(ellipse 50% 80% at 80% 50%, rgba(16,185,129,0.06), transparent),
    var(--brand-bg);
}

.pulsi-theme-dark .stat-chip {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
}

.pulsi-theme-dark .lang-btn.active {
  background: rgba(37,99,235,0.2);
  color: #93c5fd;
  border-color: rgba(37,99,235,0.4);
}

.pulsi-theme-dark .filter-btn.active {
  background: rgba(37,99,235,0.15);
  color: #93c5fd;
  border-color: rgba(37,99,235,0.4);
}

.pulsi-theme-dark .pillar-ring {
  background: conic-gradient(var(--ring-color) var(--ring-pct), rgba(255,255,255,0.04) 0%);
  border-radius: 50%;
  padding: 3px;
}

.pulsi-theme-dark .top-border-gradient {
  border-top: 1px solid;
  border-image: linear-gradient(90deg, transparent, rgba(37,99,235,0.4), transparent) 1;
}

/* SDG badge colors */
.pulsi-theme-dark .sdg-3  { background: #4c9b47; }
.pulsi-theme-dark .sdg-4  { background: #c5192d; }
.pulsi-theme-dark .sdg-6  { background: #26bde2; }
.pulsi-theme-dark .sdg-7  { background: #fcc30b; color: #111; }
.pulsi-theme-dark .sdg-8  { background: #a21942; }
.pulsi-theme-dark .sdg-9  { background: #fd6925; }
.pulsi-theme-dark .sdg-11 { background: #fd9d24; color: #111; }
.pulsi-theme-dark .sdg-12 { background: #bf8b2e; }
.pulsi-theme-dark .sdg-13 { background: #3f7e44; }
.pulsi-theme-dark .sdg-15 { background: #56c02b; }
.pulsi-theme-dark .sdg-16 { background: #00689d; }
.pulsi-theme-dark .sdg-17 { background: #19486a; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .pulsi-theme-dark .hero-score { font-size: clamp(4rem, 18vw, 6rem); }
}
/* Responsive adjustments for details panels */
@media (max-width: 640px) {
    .pulsi-theme-dark #selectedMunicipalityDetails,
    .pulsi-theme-dark #ministryDetails {
        padding: 1rem !important;
    }
    
    .pulsi-theme-dark #selectedMunicipalityDetails .grid,
    .pulsi-theme-dark #ministryDetails .grid {
        gap: 0.75rem;
    }
    
    .pulsi-theme-dark #aiNarrativeSection,
    .pulsi-theme-dark #aiNarrativeSection * {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .pulsi-theme-dark #aiNarrativeSection .absolute {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 0.5rem;
    }
    
    .pulsi-theme-dark #aiNarrativeSection .flex.items-center {
        flex-wrap: wrap;
    }
    
    .pulsi-theme-dark #procurementTableBody td,
    .pulsi-theme-dark #municipalityRecentActivitiesBody td {
        white-space: normal;
        word-break: break-word;
    }
    
    .pulsi-theme-dark .table-responsive {
        overflow-x: auto;
    }
    .pulsi-theme-dark .custom-file-button {
        cursor: pointer;
        border: 1px solid rgba(255,255,255,0.1);
    }
    .pulsi-theme-dark .custom-file-button:hover {
        background-color: #4b5563;
    }
}

/* ===== PILLAR CARD STYLES FOR LOCAL GOVERNMENT PAGE ===== */
.pillar-card-blue {
    background: linear-gradient(145deg, #1e3a8a, #1e40af);
    border: 1px solid #3b82f6;
}
.pillar-card-indigo {
    background: linear-gradient(145deg, #3730a3, #4f46e5);
    border: 1px solid #818cf8;
}
.pillar-card-emerald {
    background: linear-gradient(145deg, #065f46, #047857);
    border: 1px solid #10b981;
}
.pillar-card-amber {
    background: linear-gradient(145deg, #92400e, #b45309);
    border: 1px solid #f59e0b;
}
.pillar-grid-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}