/* =========================================
   1. THEME COLORS & GLOBAL SETTINGS
========================================= */

:root {
    --primary-color: #ffa000;
    --primary-dark: #e69500;
    --primary-light: #fff3d6;
    --text-color: #333333;
    --secondary-text: #666666;
    --bg-soft: #f8fafc;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    color: var(--text-color);
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Sinhala", "Noto Sans Tamil", sans-serif;
    line-height: 1.6;
}

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

.bg-soft {
    background-color: var(--bg-soft, #f8fafc);
}

.section-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    line-height: 1.35;
    margin-bottom: 1rem;
}

.page-heading {
    color: var(--text-color);
    font-size: clamp(1.35rem, 3.5vw, 2.1rem);
    line-height: 1.3;
}

.tracking-wide {
    letter-spacing: 1px;
}

.about-tab-title {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    color: var(--text-color);
}


/* =========================================
   2. TOP BAR
========================================= */

.top-bar {
    background-color: #00698a;
    font-size: 0.85rem;
    color: #fff;
}

.top-bar a {
    color: #ffffff;
    text-decoration: none;
}


/* =========================================
   3. FLOATING BUTTONS (WHATSAPP & BACK TO TOP)
========================================= */

.whatsapp-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.whatsapp-btn i {
    font-size: 32px;
    line-height: 1;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 95px;
    right: 31px;
    width: 48px;
    height: 48px;
    background: #00698a;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s ease, box-shadow 0.25s ease;
    padding: 0;
}

.back-to-top-btn i {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.25s ease;
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background-color: var(--primary-color, #ffa000);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transform: translateY(-3px);
}

.back-to-top-btn:hover i {
    transform: translateY(-2px);
}

.back-to-top-btn:active {
    transform: translateY(0);
}


/* =========================================
   4. HERO CAROUSEL
========================================= */

.hero-carousel {
    position: relative;
    overflow: hidden;
    background: #111;
    width: 100%;
}

.responsive-carousel-height {
    height: 620px;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 7s ease;
}

.carousel-item.active .hero-img {
    transform: scale(1.06);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.50) 55%,
        rgba(0, 0, 0, 0.20) 100%
    );
    z-index: 1;
}

/* Caption styling & positioning override for Bootstrap defaults */
.hero-carousel .carousel-caption,
.hero-caption {
    position: absolute;
    top: 50%;
    bottom: auto;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(-50%);
    padding: 0;
    z-index: 2;
    text-align: left;
}

.hero-title {
    color: #fff;
    font-size: clamp(1.8rem, 4.5vw, 3.4rem);
    line-height: 1.25;
    font-weight: 800;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.5);
    animation: heroText 1s ease;
}

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

/* Indicators */
.hero-carousel .carousel-indicators {
    z-index: 5;
    margin-bottom: 25px;
    gap: 8px;
}

.hero-carousel .carousel-indicators button {
    width: 28px;
    height: 6px;
    border: 0;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.55);
    opacity: 1;
    transition: all 0.3s ease;
    padding: 6px 0;
    background-clip: content-box;
}

.hero-carousel .carousel-indicators button.active {
    width: 50px;
    background-color: var(--primary-color, #ffa000);
}

/* Navigation arrows */
.hero-control {
    width: 65px;
    opacity: 1;
    z-index: 5;
}

.carousel-control-icon-box {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.hero-control:hover .carousel-control-icon-box {
    background: var(--primary-color, #ffa000);
    border-color: var(--primary-color, #ffa000);
    transform: scale(1.1);
}


/* =========================================
   5. FEATURE CARDS
========================================= */

.feature-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.feature-box {
    background: #fff;
    padding: 38px 25px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-box:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color, #ffa000);
}

.icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff8eb;
    color: var(--primary-color, #ffa000);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    transition: all 0.3s ease;
}

.feature-box:hover .icon-circle {
    background: var(--primary-color, #ffa000);
    color: #fff;
    transform: scale(1.05);
}

.feature-title {
    font-weight: 700;
    margin-bottom: 12px;
    color: #1e293b;
    font-size: 1.2rem;
}

.feature-desc {
    color: #64748b;
    line-height: 1.65;
    margin-bottom: 18px;
    flex-grow: 1;
    font-size: 0.95rem;
}

.feature-more {
    color: var(--primary-color, #ffa000);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.feature-box:hover .feature-more {
    gap: 10px;
}


/* =========================================
   6. ABOUT TABS
========================================= */

.about-tabs {
    display: flex;
    justify-content: center;
    gap: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.about-tabs .nav-link {
    background: transparent !important;
    color: #64748b;
    border: none;
    border-radius: 0;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 600;
    position: relative;
    transition: color 0.3s ease;
}

.about-tabs .nav-link:hover {
    color: var(--primary-color, #ffa000);
}

.about-tabs .nav-link.active {
    color: var(--primary-color, #ffa000) !important;
    background: transparent !important;
}

.about-tabs .nav-link::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-color, #ffa000);
    border-radius: 3px 3px 0 0;
    transition: width 0.3s ease;
}

.about-tabs .nav-link.active::after {
    width: 100%;
}

.about-image {
    width: 100%;
    height: 340px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.tab-content {
    padding: 15px 0;
}

.tab-content p {
    color: #4b5563;
    line-height: 1.85;
    margin-bottom: 16px;
    font-size: 1rem;
}


/* =========================================
   7. SECRETARY'S MESSAGE
========================================= */

.secretary-image-wrapper {
    max-width: 320px;
    width: 100%;
    margin: 0 auto;
}

.secretary {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    object-position: center top;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.secretary-message {
    position: relative;
    padding: 5px 0;
}

.secretary-message p {
    color: #4b5563;
    line-height: 1.85;
    text-align: left;
    margin-bottom: 16px;
    font-size: 1rem;
}

.quote-icon {
    font-size: 40px;
    color: var(--primary-color, #ffa000);
    opacity: 0.35;
    line-height: 1;
    margin-bottom: 10px;
    display: inline-block;
}


/* =========================================
   8. SERVICES CARDS
========================================= */

.service-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px 24px;
    height: 100%;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card i {
    color: var(--primary-color, #ffa000);
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color, #ffa000);
}

.service-card:hover i {
    transform: scale(1.1);
}


/* =========================================
   9. FOOTER
========================================= */

.site-footer {
    background-color: #1a202c;
    color: #cbd5e0;
    font-size: 0.95rem;
}

.site-footer h4 {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2d3748;
}

.site-footer .contact-icon {
    color: #63b3ed;
    font-size: 1.1rem;
}

.site-footer .social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.site-footer .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background-color: #2d3748;
    color: #ffffff;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.site-footer .social-links a:hover {
    background-color: #0d6efd;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid #2d3748;
    margin-top: 3rem;
    padding-top: 1.5rem;
    font-size: 0.85rem;
    color: #a0aec0;
}


/* =========================================
   10. TABLET RESPONSIVE (768px - 991px)
========================================= */

@media (min-width: 768px) and (max-width: 991.98px) {
    .responsive-carousel-height {
        height: 480px;
    }

    .hero-title {
        font-size: 2.3rem;
    }

    .service-card {
        padding: 24px;
    }

    .feature-box {
        padding: 30px 20px;
    }

    .secretary-image-wrapper {
        max-width: 280px;
    }

    .about-image {
        height: 280px;
    }

    .tab-content {
        padding: 20px 0;
    }
}


/* =========================================
   11. MOBILE RESPONSIVE (Max 767.98px)
========================================= */

@media (max-width: 767.98px) {
    /* Prevent overflow on mobile */
    .container,
    .container-fluid {
        max-width: 100%;
    }

    /* Top Bar */
    .top-bar {
        font-size: 12px;
    }

    /* Hero Carousel */
    .responsive-carousel-height {
        height: 380px;
    }

    .hero-overlay {
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.45) 0%,
            rgba(0, 0, 0, 0.65) 60%,
            rgba(0, 0, 0, 0.80) 100%
        );
    }

    .hero-carousel .carousel-caption,
    .hero-caption {
        padding: 0 15px;
    }

    .hero-title {
        font-size: clamp(1.4rem, 6vw, 2.1rem);
        line-height: 1.3;
        margin-bottom: 0;
    }

    .hero-control {
        display: none;
    }

    .hero-carousel .carousel-indicators {
        margin-bottom: 12px;
    }

    .hero-carousel .carousel-indicators button {
        width: 22px;
        height: 5px;
    }

    .hero-carousel .carousel-indicators button.active {
        width: 38px;
    }

    /* Floating Buttons */
    .whatsapp-btn {
        width: 52px;
        height: 52px;
        bottom: 18px;
        right: 18px;
    }

    .whatsapp-btn i {
        font-size: 28px;
    }

    .back-to-top-btn {
        width: 44px;
        height: 44px;
        bottom: 78px;
        right: 22px;
    }

    .back-to-top-btn i {
        font-size: 18px;
    }

    /* Feature Cards */
    .feature-box {
        padding: 28px 20px;
    }

    .icon-circle {
        width: 64px;
        height: 64px;
        font-size: 24px;
        margin-bottom: 16px;
    }

    .feature-title {
        font-size: 1.1rem;
    }

    .feature-desc {
        font-size: 0.92rem;
    }

    /* About Tabs - Smooth Horizontal Scroll on Mobile */
    .about-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        justify-content: flex-start;
        gap: 12px;
        padding: 0 6px 4px;
        border-bottom: 2px solid #e2e8f0;
    }

    .about-tabs::-webkit-scrollbar {
        display: none;
    }

    .about-tabs .nav-item {
        flex: 0 0 auto;
    }

    .about-tabs .nav-link {
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 13.5px;
    }

    .about-image {
        height: 250px;
        margin-bottom: 18px;
    }

    .tab-content {
        padding: 16px 0;
    }

    .tab-content p {
        font-size: 0.95rem;
        line-height: 1.75;
    }

    /* Secretary */
    .secretary-image-wrapper {
        max-width: 260px;
        margin: 0 auto 20px;
    }

    .secretary {
        max-height: 330px;
    }

    .secretary-message p {
        font-size: 0.95rem;
        line-height: 1.75;
    }

    .quote-icon {
        font-size: 32px;
    }

    /* Services */
    .service-card {
        padding: 22px 18px;
    }

    /* Footer */
    .site-footer {
        font-size: 0.9rem;
    }

    .site-footer h4 {
        font-size: 1.05rem;
    }

    .footer-bottom {
        margin-top: 2rem;
        padding-top: 1rem;
        text-align: center;
    }
}


/* =========================================
   12. SMALL MOBILE (Max 575.98px)
========================================= */

@media (max-width: 575.98px) {
    .top-bar {
        font-size: 11px;
    }

    /* Hero */
    .responsive-carousel-height {
        height: 340px;
    }

    .hero-title {
        font-size: clamp(1.3rem, 6.5vw, 1.85rem);
    }

    /* Floating Buttons */
    .whatsapp-btn {
        width: 48px;
        height: 48px;
        bottom: 15px;
        right: 15px;
    }

    .whatsapp-btn i {
        font-size: 24px;
    }

    .back-to-top-btn {
        width: 42px;
        height: 42px;
        bottom: 70px;
        right: 18px;
    }

    .back-to-top-btn i {
        font-size: 17px;
    }

    /* Feature */
    .feature-box {
        padding: 24px 16px;
    }

    .icon-circle {
        width: 58px;
        height: 58px;
        font-size: 22px;
    }

    /* About Tabs */
    .about-tabs .nav-link {
        padding: 9px 12px;
        font-size: 12.5px;
    }

    .about-image {
        height: 220px;
    }

    /* Secretary */
    .secretary-image-wrapper {
        max-width: 230px;
    }

    .secretary {
        max-height: 290px;
    }

    /* Services */
    .service-card {
        padding: 20px 16px;
        border-radius: 10px;
    }

    /* Footer */
    .site-footer {
        font-size: 0.85rem;
    }

    .site-footer h4 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .site-footer .social-links a {
        width: 35px;
        height: 35px;
    }
}


/* =========================================
   13. EXTRA SMALL MOBILE (Max 380px)
========================================= */

@media (max-width: 380px) {
    .responsive-carousel-height {
        height: 320px;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .about-tabs .nav-link {
        padding: 8px 10px;
        font-size: 11.5px;
    }

    .about-image {
        height: 190px;
    }

    .service-card {
        padding: 18px 14px;
    }

    .feature-box {
        padding: 20px 14px;
    }

    .back-to-top-btn {
        width: 38px;
        height: 38px;
        bottom: 66px;
        right: 17px;
    }

    .back-to-top-btn i {
        font-size: 15px;
    }
}


/* =========================================
   14. LARGE DESKTOP (Min 1200px)
========================================= */

@media (min-width: 1200px) {
    .responsive-carousel-height {
        height: 620px;
    }

    .hero-title {
        font-size: 3.25rem;
    }

    .service-card {
        padding: 35px;
    }

    .feature-box {
        padding: 40px 25px;
    }
}


/* =========================================
   15. SINHALA & TAMIL SUPPORT
========================================= */

html:lang(si) body {
    line-height: 1.7;
}

html:lang(si) .hero-title,
html:lang(si) .feature-title,
html:lang(si) .section-title,
html:lang(si) .page-heading {
    line-height: 1.45;
}

html:lang(ta) body {
    line-height: 1.75;
}

html:lang(ta) .hero-title,
html:lang(ta) .feature-title,
html:lang(ta) .section-title,
html:lang(ta) .page-heading {
    line-height: 1.5;
}

@media (max-width: 767.98px) {
    html:lang(si) .hero-title,
    html:lang(ta) .hero-title {
        line-height: 1.4;
    }

    html:lang(si) .section-title,
    html:lang(ta) .section-title {
        line-height: 1.4;
    }
}


/* =========================================
   16. ACCESSIBILITY & REDUCED MOTION
========================================= */

a:focus-visible,
button:focus-visible {
    outline: 2px solid #00698a;
    outline-offset: 3px;
}

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