/* EFGAS Website :: Main Stylesheet */

/* 1. Variables & Base */
:root {
    /* Brand Colors */
    --bs-primary: #0056b3;
    --bs-primary-dark: #003d82;
    --bs-secondary: #6c757d;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
    --bs-success: #198754;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-info: #0dcaf0;
    
    /* Typography */
    --bs-font-sans-serif: 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-font-monospace: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    --font-heading: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Layout */
    --body-bg: #fdfdff;
    --body-color: #333;
    --link-color: var(--bs-primary);
    --link-hover-color: var(--bs-primary-dark);
    --focus-ring: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    
    /* Transitions */
    --transition-base: all 0.2s ease-in-out;
    
    /* Spacing */
    --spacer: 1rem;
    
    /* Z-index */
    --zindex-skip-link: 1070;
    --zindex-fixed: 1030;
    --zindex-sticky: 1020;
    --zindex-modal-backdrop: 1040;
    --zindex-modal: 1050;
}

/* Base Styles */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--bs-font-sans-serif);
    font-size: 1rem;
    line-height: 1.6;
    background-color: var(--body-bg);
    color: var(--body-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Skip Link */
.visually-hidden-focusable {
    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;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    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;
}

.visually-hidden-focusable:focus {
    z-index: var(--zindex-skip-link);
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    padding: .5rem 1rem !important;
    margin: .5rem 0 0 .5rem !important;
    color: #fff !important;
    background-color: var(--bs-primary) !important;
    border-radius: .25rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    text-decoration: none !important;
}

/* Focus Styles */
:focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    .no-print,
    .no-print * {
        display: none !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
        line-height: 1.3;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 80%;
    }
    
    a[href^="#"]:after,
    a[href^="mailto:"]:after {
        content: "";
    }
    
    .container {
        width: auto;
        max-width: 100%;
        padding: 0 1cm;
    }
    
    .navbar {
        display: none;
    }
    
    .card {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .btn, .btn * {
        color: #000 !important;
        background-color: #fff !important;
        border: 1px solid #000 !important;
    }
    
    @page {
        margin: 2cm;
    }
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--bs-dark);
}

.lead {
    font-size: 1.15rem;
    font-weight: 400;
}

/* 2. Layout & Sections */
.section {
    padding: 4rem 0;
    position: relative;
    overflow: visible; /* Changed from hidden to visible */
}

/* FAQ specific styles */
#faq-accordion {
    margin: 2rem 0; /* Adjusted margin */
    position: relative;
    z-index: 1;
    background: #fff; /* Ensure white background */
    border-radius: 0.5rem; /* Match card border radius */
}

/* Ensure content is properly structured for screen readers */
[role="banner"],
[role="navigation"],
[role="main"],
[role="contentinfo"] {
    display: block;
}

/* Improve link contrast */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover,
a:focus {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Form elements */
button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: var(--transition-base);
}

.btn:focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.5);
}

.btn-primary {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-primary:hover {
    background-color: var(--bs-primary-dark);
    border-color: var(--bs-primary-dark);
    color: #fff;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Ensure images have alt text */
img:not([alt]) {
    outline: 2px dashed #f00;
}

/* Tables */
table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

th {
    text-align: inherit;
    text-align: -webkit-match-parent;
}

thead,
tbody,
tfoot,
tr,
td,
th {
    border-color: inherit;
    border-style: solid;
    border-width: 0;
}

th, td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

/* Lists */
ul, ol {
    padding-left: 1.5rem;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--bs-dark);
}

h1, .h1 {
    font-size: calc(1.375rem + 1.5vw);
}

@media (min-width: 1200px) {
    h1, .h1 {
        font-size: 2.5rem;
    }
}

h2, .h2 {
    font-size: calc(1.325rem + 0.9vw);
}

@media (min-width: 1200px) {
    h2, .h2 {
        font-size: 2rem;
    }
}

h3, .h3 {
    font-size: calc(1.3rem + 0.6vw);
}

@media (min-width: 1200px) {
    h3, .h3 {
        font-size: 1.75rem;
    }
}

h4, .h4 {
    font-size: calc(1.275rem + 0.3vw);
}

@media (min-width: 1200px) {
    h4, .h4 {
        font-size: 1.5rem;
    }
}

h5, .h5 {
    font-size: 1.25rem;
}

h6, .h6 {
    font-size: 1rem;
}

/* Paragraphs */
p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Horizontal rule */
hr {
    margin: 1rem 0;
    color: inherit;
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0.25;
}

/* Code */
code {
    font-size: 0.875em;
    color: #d63384;
    word-wrap: break-word;
}

/* Blockquote */
blockquote {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

blockquote > :last-child {
    margin-bottom: 0;
}

/* Figure */
figure {
    margin: 0 0 1rem;
}

/* Images and content */
img,
svg {
    vertical-align: middle;
}

/* Tables */
table {
    caption-side: bottom;
    border-collapse: collapse;
}

/* Forms */
label {
    display: inline-block;
    margin-bottom: 0.5rem;
}

input,
button,
select,
optgroup,
textarea {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button,
select {
    text-transform: none;
}

[role="button"] {
    cursor: pointer;
}

/* Navbar */
.navbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Cards */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.25rem;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

/* Alerts */
.alert {
    position: relative;
    padding: 1rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-dismissible {
    padding-right: 3rem;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 1.25rem 1rem;
}

/* Close button */
.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.25rem;
    opacity: 0.5;
}

/* Responsive images */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Text utilities */
.text-center {
    text-align: center !important;
}

.text-primary {
    color: var(--bs-primary) !important;
}

/* Spacing utilities */
.mt-4 {
    margin-top: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Flex utilities */
.d-flex {
    display: flex !important;
}

.flex-column {
    flex-direction: column !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-center {
    justify-content: center !important;
}

/* Position utilities */
.position-relative {
    position: relative !important;
}

/* Display utilities */
.d-none {
    display: none !important;
}

.d-inline-block {
    display: inline-block !important;
}

/* Sizing utilities */
.w-100 {
    width: 100% !important;
}

.h-100 {
    height: 100% !important;
}

/* Text utilities */
.text-white {
    color: #fff !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Background utilities */
.bg-light {
    background-color: #f8f9fa !important;
}

/* Border utilities */
.rounded {
    border-radius: 0.25rem !important;
}

/* Shadow utilities */
.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Visibility utilities */
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    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;
}

/* Print utilities */
@media print {
    .d-print-none {
        display: none !important;
    }
    
    .d-print-block {
        display: block !important;
    }
    
    .d-print-inline {
        display: inline !important;
    }
    
    .d-print-inline-block {
        display: inline-block !important;
    }
}

/* High contrast mode */
@media (forced-colors: active) {
    :root {
        --bs-primary: #004494;
        --bs-primary-dark: #002d5a;
    }
    
    a, button, [role="button"], input, select, textarea {
        forced-color-adjust: none;
    }
}

.hero {
    background-color: var(--bs-light);
    padding: 5rem 0;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.hero h1 {
    font-size: 3rem;
}

/* 3. Components */

/* Buttons */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.3rem;
    letter-spacing: 0.5px;
    transition: all 0.2s ease-in-out;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-primary {
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.35);
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.07);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 700;
    font-size: 1.2rem;
    font-family: var(--font-heading);
}

/* Forms */
.form-control, .form-select {
    min-height: 48px;
    border-radius: 0.3rem;
    border: 1px solid #ced4da;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    background-color: var(--bs-light);
    border: 1px solid #ced4da;
}

/* Accordion */
.accordion {
    position: relative;
    z-index: 1;
}

.accordion-item {
    border-radius: 0.5rem !important;
    overflow: hidden;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

.accordion-item:last-child {
    margin-bottom: 0;
}

.accordion-button:not(.collapsed) {
    color: var(--bs-primary);
    background-color: rgba(13, 110, 253, 0.05);
    box-shadow: none;
}

.accordion-body {
    padding: 1rem 1.25rem;
}

.accordion-button {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
}

.accordion-button:not(.collapsed) {
    color: var(--bs-primary);
    background-color: rgba(13, 110, 253, 0.05);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* CTA Section */
.cta-section {
    position: relative;
    padding: 4rem 0;
    background-color: var(--bs-primary);
    color: #fff;
    margin-top: 3rem;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.cta-section .btn-light {
    background: #fff;
    color: var(--bs-primary);
    border-color: #fff;
    transition: all 0.3s ease;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
}

.cta-section .btn-outline-light {
    border: 2px solid #fff;
    color: #fff;
    background: transparent;
    transition: all 0.3s ease;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
}

.cta-section .btn-light:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cta-section .btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cta-section .lead {
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .cta-section {
        padding: 3rem 0;
    }
    
    .cta-section .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .cta-section .btn:last-child {
        margin-bottom: 0;
    }
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    background-color: #fff;
}

.navbar-brand img {
    max-height: 45px;
    transition: transform 0.3s ease;
}

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

.nav-link {
    font-weight: 600;
    font-family: var(--font-heading);
}

/* 4. Footer */
footer.main-footer {
    background-color: var(--bs-dark);
    color: #adb5bd;
    padding: 3rem 0;
    font-size: 0.9rem;
    position: relative;
    z-index: 2; /* Ensure footer stays above other elements */
    margin-top: 2rem; /* Add some space above the footer */
}

footer.main-footer h5 {
    color: #fff;
    font-family: var(--font-heading);
    margin-bottom: 1.5rem;
}

footer.main-footer img {
    height: 24px;
    width: auto;
    margin-top: 1rem;
}

footer.main-footer a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer.main-footer a:hover {
    color: #fff;
}

footer.main-footer .social-links a {
    font-size: 1.2rem;
    margin-right: 1rem;
}

.footer-bottom {
    background-color: #1a1e21;
    padding: 1rem 0;
    border-top: 1px solid #343a40;
}

/* 5. Utilities */
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; }

.fi {
    font-size: 1.5rem;
    border-radius: 3px;
}

/* School image container */
.school-image-container {
    height: 200px !important;
}

.school-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* 6. Responsive & Mobile Polish */
/* Improve navbar usability on mobile */
@media (max-width: 991.98px) {
  .navbar .navbar-collapse {
    padding: 0.75rem 0;
    background: #fff;
    border-radius: 0 0 .5rem .5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }
  .navbar .nav-link.btn {
    width: 100%;
    text-align: center;
    margin-top: .5rem;
  }
  .navbar .nav-item + .nav-item {
    margin-left: 0 !important;
  }
}

/* Increase visibility of the navbar toggler on light backgrounds */
.navbar-light .navbar-toggler {
  border-color: rgba(0,0,0,.15);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.navbar-light .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0,0,0,0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Fluid, clamped typography for better scaling */
h1, .h1 { font-size: clamp(1.75rem, 1.25rem + 2.5vw, 2.75rem); }
h2, .h2 { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem); }
h3, .h3 { font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem); }
.lead { font-size: clamp(1rem, 0.95rem + 0.5vw, 1.15rem); }

/* Hero refinements */
.hero {
  padding: clamp(2.5rem, 2rem + 3vw, 5rem) 0;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
.hero h1 { letter-spacing: 0.2px; }

/* Section spacing responsive tweaks */
.section { padding: clamp(2.5rem, 2rem + 2vw, 4rem) 0; }

/* Card imagery: consistent media aspect ratio */
.card-img-top,
.card .media-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-top-left-radius: .5rem;
  border-top-right-radius: .5rem;
}

/* Improve tap targets on mobile */
@media (max-width: 767.98px) {
  .btn { min-height: 48px; }
  .form-control, .form-select { min-height: 48px; }
  .nav-link { padding: .75rem 1rem; }
}

/* Make tables scrollable on small screens */
.table-responsive-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-responsive-wrap > table { min-width: 600px; }

/* Footer mobile layout spacing */
@media (max-width: 767.98px) {
  footer.main-footer {
    padding: 2rem 0;
    text-align: left;
  }
  footer.main-footer .social-links a { margin-right: .75rem; }
}

/* Subtle focus ring harmonized with brand */
:focus-visible {
  outline-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.35);
}

/* Reduce motion respect already present; add smooth scrolling otherwise */
@media (prefers-reduced-motion: no-preference) {
  html:focus-within { scroll-behavior: smooth; }
}

/* Hero CTA responsiveness */
@media (max-width: 575.98px) {
  .hero .d-flex { flex-wrap: wrap; }
  .hero .d-flex > .btn {
    flex: 1 1 100%;
    width: 100%;
  }
  .hero .btn-lg {
    padding: .75rem 1rem;
    font-size: 1rem;
  }
  .hero .display-3 {
    font-size: clamp(1.75rem, 1.4rem + 4vw, 2.25rem);
  }
}

