/* Scoped styles for Citizen’s Charter page */
.charter-page {
    --guidelines-bg: #eef5ff;
    --guidelines-border: #0d6efd;
    --steps-bg: #ecf9f1;
    --steps-border: #198754;
    --text-dark: #2c3e50;
    --muted: #6c757d;
}

.charter-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1rem;
    margin-top: 60px;
}

@media (min-width: 768px) {
    .charter-header {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        margin-top: 0;
    }
}

.section-highlight {
    border: 1px solid rgba(0,0,0,0.05);
    border-left-width: 6px;
    border-radius: .75rem;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.05);
    margin: 0 0.5rem 1.5rem;
}

@media (max-width: 576px) {
    .section-highlight {
        border-radius: 0.5rem;
        border-left-width: 4px;
        margin: 0 0 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-header h3 {
        font-size: 1.1rem;
    }
}

.section-guidelines {
    background: var(--guidelines-bg);
    border-left-color: var(--guidelines-border);
}

.section-steps {
    background: var(--steps-bg);
    border-left-color: var(--steps-border);
}

.card.hoverable { transition: transform .2s ease, box-shadow .2s ease; }
.card.hoverable:hover { transform: translateY(-4px); box-shadow: 0 1rem 2rem rgba(0,0,0,.1); }

/* List with icons */
.charter-list { margin: 0; padding: 0; list-style: none; }
.charter-list li {
    display: flex;
    gap: .615rem;
    align-items: start;
    padding: 1rem;
    background: #fff;
    border-radius: .5rem;
    margin-bottom: .50rem;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .charter-list li {
        padding: 0.875rem;
        gap: 0.5rem;
    }
    
    .charter-list li i {
        font-size: 1.1rem;
        margin-top: 0.2rem;
    }
    
    .charter-list li span {
        font-size: 0.95rem;
        flex: 1;
    }
}
.charter-list li i { color: #0dfd35; margin-top: .2rem; }
.charter-list li span { color: var(--text-dark); }

/* Horizontal stepper / timeline */
.stepper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    position: relative;
    margin-bottom: 1.25rem;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .stepper {
        grid-template-columns: repeat(5, 1fr);
        gap: 1rem;
    }
    
    .stepper::before {
        content: "";
        position: absolute;
        top: 28px;
        left: 0;
        right: 0;
        height: 3px;
        background: rgba(0,0,0,.1);
    }
}
.step { position: relative; text-align: center; }
.step .step-icon {
    width: clamp(48px, 12vw, 56px);
    height: clamp(48px, 12vw, 56px);
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--steps-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--steps-border);
    font-size: clamp(1rem, 3vw, 1.25rem);
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

.step .step-label {
    margin-top: .5rem;
    font-weight: 700;
    color: var(--text-dark);
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    text-align: center;
}

.step .step-sub {
    color: var(--muted);
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    text-align: center;
}

@media (max-width: 767px) {
    .step {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 12px;
    }
}
.step.completed .step-icon { background: var(--steps-border); color: #fff; }

/* Progress Bar (visual aid below stepper) */
.progress.thin { height: .5rem; background: rgba(0,0,0,.08); }
.progress-bar.steps { background: linear-gradient(90deg, #20c997, #198754); }

/* Accessibility: focus styles */
a:focus, button:focus { outline: 3px solid #ffd54f; outline-offset: 2px; }


/* Mobile adjustments */
@media (max-width: 768px) {
    .stepper { grid-template-columns: 1fr 1fr; }
    .stepper::before { display: none; }
}
/* Larger titles and text for readability */
.charter-title {
    font-weight: 800;
    font-size: clamp(1.75rem, 5vw, 3rem);
    color: #f2f4f6;
    line-height: 1.2;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

@media (max-width: 576px) {
    .charter-title {
        margin-top: 2rem;
    }
}
.charter-list li span { font-size: 1.05rem; }

/* Sticky TOC and skip link */
.toc-sticky { position: sticky; top: 90px; }
.toc-card { background: #ffffff; border: 1px solid #e9ecef; border-radius: .75rem; box-shadow: 0 .25rem .75rem rgba(0,0,0,.06); }
.toc-sticky .list-group-item { border: none; padding-left: 0; background: transparent; }
.toc-sticky .list-group-item-action { font-size: 0.95rem; color: #343a40; display: flex; align-items: center; gap: .5rem; padding: .35rem 0; }
.toc-sticky .list-group-item-action:hover { color: #0d6efd; }
.toc-sticky .list-group-item-action.active { color: #0d6efd; font-weight: 700; background: transparent !important; box-shadow: none; }

.content-col { border-left: 1px solid rgba(0,0,0,.1); }
@media (max-width: 991.98px) { .content-col { border-left: none; } }

.charter-page p, .charter-page li { color: #212529; font-size: 1.05rem; }
.charter-page h3 { color: #1f2d3d; }

.skip-link { position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: static; width: auto; height: auto; padding: .5rem 1rem; background: #ffd54f; color: #000; z-index: 1000; }

.office-strip { background: #fff3cd; color: #664d03; border: 1px solid #ffe69c; border-radius: .5rem; padding: .5rem .75rem; }
.office-strip .status-open { color: #198754; font-weight: 700; }
.office-strip .status-closed { color: #dc3545; font-weight: 700; }

@media print { .toc-sticky, .office-strip, .skip-link { display: none !important; } }

/* Contact page background gradient applied here */
.charter-body { background: linear-gradient(135deg, #FF3AAE 0%, #FF73C3 100%); }

/* Scroll behavior and offsets */
html { scroll-behavior: smooth; }
#maincontent { position: relative; padding-top: 100px; }
@media (max-width: 768px) { #maincontent { padding-top: 120px; } }
section[id] { scroll-margin-top: 120px; }

/* Back to top button */
#backToTop { position: fixed; right: 16px; bottom: 24px; z-index: 1050; display: none; }

/* Step in-view highlight */
.step.in-view .step-icon { box-shadow: 0 0 0 4px rgba(25,135,84,.15); transform: scale(1.03); }

/* Breadcrumb contrast on gradient */
.breadcrumb .breadcrumb-item a { color: #ffffff; text-decoration: none; }
.breadcrumb .breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb .breadcrumb-item.active { color: #f8f9fa; }

/* Charter Image Gallery Styles */
.charter-image-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    height: 100%;
    margin: 0.5rem;
}

@media (max-width: 576px) {
    .charter-image-card {
        margin: 0.25rem;
    }
    
    .charter-image-wrapper {
        padding-top: 66.67%; /* 3:2 aspect ratio for mobile */
    }
    
    .charter-image-card .card-body {
        padding: 0.75rem;
    }
    
    .charter-image-card .card-body h5 {
        font-size: 1rem;
    }
}

.charter-image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Image wrapper with fixed aspect ratio */
.charter-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
}

/* Thumbnail image styling */
.charter-thumbnail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.charter-image-wrapper:hover .charter-thumbnail-image {
    transform: scale(1.08);
}

/* Overlay badge */
.image-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 2;
}

.charter-image-wrapper:hover .image-overlay {
    opacity: 1;
}

/* Modal image styling with zoom capability */
.modal-body .charter-modal-image {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    display: block;
    cursor: zoom-in;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.modal-body .charter-modal-image.zoomed {
    cursor: zoom-out;
    max-width: none;
    max-height: none;
    width: 150%;
    transform-origin: center center;
}

/* Card body styling */
.charter-image-card .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.charter-image-card .card-body h5 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* Section highlight for images */
#images .section-highlight {
    border-left: 4px solid #17b8b0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .charter-image-wrapper {
        padding-top: 66%; /* Slightly different ratio on mobile */
    }
    
    .charter-image-card .card-body {
        padding: 0.75rem;
    }
    
    .charter-image-card .card-body h5 {
        font-size: 0.95rem;
    }
    
    .charter-image-card .card-body p {
        font-size: 0.85rem;
    }
}

@media (min-width: 1200px) {
    .charter-image-wrapper {
        padding-top: 70%; /* Optimize for larger screens */
    }
}

/* Grid improvements */
#images .row.g-4 {
    row-gap: 1.5rem !important;
}

/* Footer adjustments - remove top border line if present */
.footer {
    background: linear-gradient(135deg, #FF3AAE 0%, #FF73C3 100%);
    color: white;
    padding: 3rem 0 1rem;
    text-align: center;
    font-size: 14px;
    margin-top: auto;
    width: 100%;
}

.footer .container {
    justify-content: center;  /* Center content horizontally */
    flex-direction: column;   /* Stack elements vertically */
    align-items: center;
    text-align: center;
}

/* === IDMS Text === */
/* Fullscreen loader background */
#loader-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000; /* dark background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* Hide loader when not active */
#loader-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* ✅ allows clicks to pass through */
}

/* Centered loader */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Glowing animated gradient text */
.loader-text {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  background: linear-gradient(
    90deg,
    #973BED,
    #007CFF,  
    #FFC800,
    #00E0ED,
    #973BED
  );
  background-size: 400%;
  animation: gradientMove 4s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Gradient movement animation */
@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 400% 50%;
  }
}

/* Sticky TOC and skip link */
.toc-sticky { position: sticky; top: 90px; }
.toc-card { background: #ffffff; border: 1px solid #e9ecef; border-radius: .75rem; box-shadow: 0 .25rem .75rem rgba(0,0,0,.06); }
.toc-sticky .list-group-item { border: none; padding-left: 0; background: transparent; }
.toc-sticky .list-group-item-action { font-size: 0.95rem; color: #343a40; display: flex; align-items: center; gap: .5rem; padding: .35rem 0; }
.toc-sticky .list-group-item-action:hover { color: #0d6efd; }
.toc-sticky .list-group-item-action.active { color: #0d6efd; font-weight: 700; background: transparent !important; box-shadow: none; }

/* Mobile TOC adjustments */
@media (max-width: 991.98px) {
    .toc-sticky {
        position: static;
        margin-bottom: 1.5rem;
    }
    
    .toc-card {
        border-radius: 0.5rem;
    }
}