/* Custom Styles for Heads of Agencies Website */

:root {
    --primary-color: #1965b6;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --bs-body-font-size: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transform: none !important;
        transition-property: none !important;
    }
    
    .hero-section,
    .page-header-gradient {
        animation: none !important;
        background: linear-gradient(135deg, #1e3c72 0%, #1965b6 100%);
    }
    /* Skip link still appears on focus; only animation is reduced (WCAG 2.3.3) */
    .skip-link:focus {
        top: 0.5rem;
    }
}

/* Skip link: visible when focused for keyboard/screen reader users (WCAG 2.4.1) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0.5rem;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #0A3C7D;
    font-weight: bold;
    text-decoration: none;
    border: 0.125rem solid #0A3C7D;
    border-radius: 0.25rem;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0.5rem;
    outline: 0.125rem solid #fff;
    outline-offset: 0.125rem;
}

/* Screen-reader-only text (WCAG 3.3.2, 2.4.4); matches Bootstrap .visually-hidden */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 10.625rem; /* 170px */
}

/* Override Bootstrap primary color */
.bg-primary {
    background-color: #0A3C7D !important;
}

.text-primary {
    color: #1965b6 !important;
}

.btn-primary {
    background-color: #1965b6;
    border-color: #1965b6;
    color:#ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #144a8c;
    border-color: #144a8c;
    color:#ffffff !important;
}

.btn-outline-primary {
    color: #1965b6;
    border-color: #1965b6;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: #1965b6;
    border-color: #1965b6;
    color: #fff;
}

.table-primary {
    background-color: rgba(25, 101, 182, 0.1);
}

.table-primary th {
    background-color: #1965b6;
    color: #fff;
}

.alert-info {
    background-color: rgba(25, 101, 182, 0.1);
    border-color: rgba(25, 101, 182, 0.2);
    color: #1965b6;
}

.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 0.25rem; /* 4px */
}

.navbar-dark .navbar-nav .nav-link:focus {
    outline: 0.125rem solid #fff; /* 2px */
    outline-offset: 0.25rem; /* 4px */
}

/* Links */
a {
    color: #1965b6;
}

a:hover,
a:focus {
    color: #144a8c;
    text-decoration: underline;
}

/* Breadcrumb links */
.breadcrumb a:hover,
.breadcrumb a:focus {
    text-decoration: underline;
    text-underline-offset: 0.125rem; /* 2px */
}

/* Logo styling */
.navbar-brand img {
    border-radius: 0.25rem; /* 4px */
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1); /* 0 2px 4px */
    transition: transform 0.2s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-brand:focus {
    outline: 0.125rem solid #fff; /* 2px */
    outline-offset: 0.25rem; /* 4px */
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

.text-light-50 {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1e3c72 0%, #1965b6 50%, #2a5298 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

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

/* Page Header (for other pages) */
.page-header-gradient {
    background: linear-gradient(135deg, #1e3c72 0%, #1965b6 50%, #2a5298 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

.page-header-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-image {
    max-width: 18.75rem; /* 300px */
    filter: drop-shadow(0 0.625rem 1.875rem rgba(0, 0, 0, 0.1)); /* 0 10px 30px */
}

/* Cards */
#bfrmap {
    transition: none !important;
    transform: none !important;
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
}

.feature-icon {
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease, text-decoration 0.3s ease;
    font-size: 18px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: underline;
    text-underline-offset: 0.25rem; /* 4px */
}

/* Navbar toggler (mobile menu button): hover like focus, animated hamburger → X */
.navbar-toggler:hover,
.navbar-toggler:focus {
    outline: 0.125rem solid #fff; /* 2px */
    outline-offset: 0.25rem; /* 4px */
    box-shadow: none;
}

/* Custom hamburger icon (3 lines) that animates to X when open */
.navbar-toggler-icon.custom-toggler-icon {
    background-image: none !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.3125rem; /* 5px */
    width: 1.25em;
    height: 1.25em;
}

.custom-toggler-icon .toggler-line {
    display: block;
    width: 100%;
    height: 0.125rem; /* 2px */
    background-color: currentColor;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Open state: top and bottom lines rotate to form X, middle fades out */
.navbar-toggler[aria-expanded="true"] .custom-toggler-icon .toggler-line:nth-child(1) {
    transform: translateY(0.4375rem) rotate(45deg); /* 7px */
}

.navbar-toggler[aria-expanded="true"] .custom-toggler-icon .toggler-line:nth-child(2) {
    opacity: 0;
}

.navbar-toggler[aria-expanded="true"] .custom-toggler-icon .toggler-line:nth-child(3) {
    transform: translateY(-0.4375rem) rotate(-45deg);
}

/* Buttons */
.btn {
    border-radius: 0.625rem; /* 10px */
    font-weight: 500;
    padding: 0.75rem 1.5rem; /* 12px 24px */
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.9375rem 1.875rem; /* 15px 30px */
    font-size: 1.1rem;
}

.btn:hover {
    transform: translateY(-0.125rem); /* -2px */
    box-shadow: 0 0.3125rem 0.9375rem rgba(0, 0, 0, 0.2); /* 0 5px 15px */
}

/* Sections */
section {
    position: relative;
}

/* Layout consistency: subpage content */
.page-header-gradient .container .row {
    justify-content: center;
}

.page-header-gradient h1 {
    font-size: clamp(1.75rem, 4vw, 3rem);
}

.subpage-content-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.subpage-content-section .section-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    margin-bottom: 1.5rem;
}

.subpage-content-section .content-block {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

.subpage-content-section .content-block p {
    margin-bottom: 1.25rem;
}

.subpage-content-section .content-block p:last-child {
    margin-bottom: 0;
}

.presidency-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.updates-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Flag Icons */
.flag-icon {
    width: 5rem; /* 80px */
    height: 5rem; /* 80px */
    background: linear-gradient(135deg, var(--success-color), var(--info-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 0.3125rem 0.9375rem rgba(0, 0, 0, 0.1); /* 0 5px 15px */
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.625rem; /* 10px */
    border: 0.125rem solid #e9ecef; /* 2px */
    padding: 0.75rem 1rem; /* 12px 16px */
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #1965b6;
    box-shadow: 0 0 0 0.2rem rgba(25, 101, 182, 0.25);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.875rem; /* 30px */
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.9375rem; /* 15px */
    top: 0;
    bottom: 0;
    width: 0.125rem; /* 2px */
    background: #1965b6;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.875rem; /* 30px */
    padding: 1.25rem; /* 20px */
    background: white;
    border-radius: 0.9375rem; /* 15px */
    box-shadow: 0 0.3125rem 0.9375rem rgba(0, 0, 0, 0.1); /* 0 5px 15px */
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.375rem; /* -22px */
    top: 1.875rem; /* 30px */
    width: 0.75rem; /* 12px */
    height: 0.75rem; /* 12px */
    background: #1965b6;
    border-radius: 50%;
    border: 0.1875rem solid white; /* 3px */
    box-shadow: 0 0 0 0.1875rem #1965b6; /* 0 0 0 3px */
}

/* Member Cards */
.member-card {
    background: white;
    border-radius: 0.9375rem; /* 15px */
    padding: 1.5625rem; /* 25px */
    text-align: center;
    transition: all 0.3s ease;
    border: 0.125rem solid transparent; /* 2px */
}

.member-card:hover {
    border-color: #1965b6;
    transform: translateY(-0.3125rem); /* -5px */
    box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.15); /* 0 10px 30px */
}

.member-flag {
    width: 3.75rem; /* 60px */
    height: 3.75rem; /* 60px */
    background: linear-gradient(135deg, #1965b6, var(--info-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.9375rem; /* 0 auto 15px */
    font-size: 1.5rem;
    color: white;
}

/* Mission list: blue bullets, no checkmarks, consistent spacing */
.mission-list {
    list-style: none;
    padding-left: 0;
}
.mission-list > li {
    position: relative;
    padding-left: 1.5rem;
}
.mission-list > li::before {
    content: '\2022';
    color: #1965b6;
    font-weight: bold;
    position: absolute;
    left: 0;
}
.mission-sublist li {
    position: relative;
    padding-left: 1rem;
}
.mission-sublist li::before {
    content: '\2013';
    color: #1965b6;
    position: absolute;
    left: 0;
}

/* Footer: unified block alignment and line length */
footer .text-footer {
    max-width: 42ch;
}

.text-justify {
    text-align: justify;
}

.footer-bottom .col-md-6:last-child .text-footer {
    max-width: none;
}

/* Footer: more space in the right-hand columns (Quick Links, Legal) */
footer .row:first-of-type .col-lg-4:last-child {
    padding-right: 1.5rem;
}
@media (min-width: 992px) {
    footer .row:first-of-type .col-lg-4:nth-child(2) {
        padding-left: 3rem;
    }
    footer .row:first-of-type .col-lg-4:nth-child(3) {
        padding-left: 3rem;
    }
    footer .row:first-of-type .col-lg-4:last-child {
        padding-right: 2rem;
    }
}

.card-button {
    margin-top: -52px;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #0A3C7D 0%, #082d5c 100%);
}

footer a:hover,
footer a:focus {
    color: white !important;
    text-decoration: underline !important; /* override .text-decoration-none on footer links */
    text-underline-offset: 0.1875rem; /* 3px */
}

footer a {
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

footer a:focus {
    outline: 0.125rem solid #fff; /* 2px */
    outline-offset: 0.1875rem; /* 3px */
}

.bi-shield-fill-check::before {
    color: var(--light-color);
}

/* Responsive Design */
@media (max-width: 48rem) { /* 768px */
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .timeline {
        padding-left: 1.25rem; /* 20px */
    }
    
    .timeline::before {
        left: 0.625rem; /* 10px */
    }
    
    .timeline-item::before {
        left: -1.0625rem; /* -17px */
    }
}

@media (max-width: 36rem) { /* 576px */
    .btn-lg {
        padding: 0.75rem 1.25rem; /* 12px 20px */
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
}

.btn.btn-outline-primary.btn-sm.mb-2 {
    width: 230px;
    min-width: 230px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(1.875rem); /* 30px */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Print Styles */
@media print {
    .navbar, footer {
        display: none !important;
    }
    
    .card {
        border: 0.0625rem solid #ccc !important; /* 1px */
        box-shadow: none !important;
    }
}

.text-justify {
    text-align: justify;
    text-justify: inter-word;
}
