/* ==========================================
   1. BASE & HEADER LAYOUT
   ========================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
}

.top-bar {
    background-color: #00698a;
    color: #fff;
    width: 100%;
}

.site-header {
    display: block;
    width: 100%;
}

/* Fixed Navbar */
.navbar.main-navbar.is-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Navbar Logo */
.navbar-logo {
    max-height: 55px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
}


/* ==========================================
   2. NAVBAR LINKS
   ========================================== */

.main-navbar .nav-link {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    padding: 14px 12px !important;
    position: relative;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease-in-out;
}

.main-navbar .nav-link i {
    color: #6c757d;
    transition: color 0.3s ease;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    color: var(--bs-warning, #ffc107) !important;
}

.main-navbar .nav-link:hover i,
.main-navbar .nav-link.active i {
    color: var(--bs-warning, #ffc107) !important;
}

/* Hover Underline */
.main-navbar .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--bs-warning, #ffc107);
    transition: all 0.3s ease-in-out;
    transform: translateX(-50%);
}

.main-navbar .nav-link:hover::before,
.main-navbar .nav-link.active::before {
    width: 80%;
}


/* ==========================================
   3. DROPDOWN MENU
   ========================================== */

.main-navbar .dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.4em;
    vertical-align: middle;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.main-navbar .dropdown-menu {
    border: none;
    border-radius: 8px;
    padding: 8px;
    margin-top: 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.main-navbar .dropdown-item {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.main-navbar .dropdown-item:hover,
.main-navbar .dropdown-item.active {
    background-color: #fff9e6;
    color: var(--bs-warning, #ffc107);
}


/* ==========================================
   4. CONTACT & LANGUAGE SWITCHER
   ========================================== */

.phone-link {
    font-size: 16px;
}

/* Modern Language Switcher */
.lang-switch {
    position: relative;
}

.lang-switch .lang-btn,
.lang-switch .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.25s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.lang-switch .lang-globe {
    font-size: 13px;
    color: #ffd166;
    transition: transform 0.3s ease, color 0.2s ease;
}

.lang-switch .lang-btn:hover,
.lang-switch .btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
}

.lang-switch .lang-btn:hover .lang-globe,
.lang-switch .btn:hover .lang-globe {
    transform: rotate(20deg);
}

/* When dropdown is open / focused */
.lang-switch .lang-btn[aria-expanded="true"],
.lang-switch .btn.show,
.lang-switch .btn:focus-visible {
    background: #ffffff;
    color: #00698a;
    border-color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.lang-switch .lang-btn[aria-expanded="true"] .lang-globe,
.lang-switch .btn.show .lang-globe {
    color: #00698a;
}

/* Chevron indicator */
.lang-switch .dropdown-toggle::after {
    margin-left: 6px;
    vertical-align: 0.15em;
    border-top: 0.32em solid;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
    transition: transform 0.25s ease;
}

.lang-switch .lang-btn[aria-expanded="true"]::after,
.lang-switch .btn.show::after {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.lang-switch .dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 6px;
    min-width: 140px;
    margin-top: 8px !important;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: langFadeIn 0.2s ease;
}

@keyframes langFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-switch .dropdown-item {
    font-size: 13.5px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 8px;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.18s ease;
}

.lang-switch .dropdown-item:hover {
    background-color: #f1f5f9;
    color: #00698a;
    padding-left: 14px;
}

.lang-switch .dropdown-item.active {
    background-color: #e6f4f8;
    color: #00698a;
    font-weight: 700;
}

.lang-switch .dropdown-item .lang-check {
    font-size: 14px;
    color: #00698a;
}

@media (min-width: 768px) {
    .phone-link {
        font-size: 20px;
    }
}

@media (min-width: 992px) {
    .phone-link {
        font-size: 24px;
    }
}


/* ==========================================
   5. LANGUAGE SPECIFIC STYLES
   ========================================== */

/* Sinhala */
html:lang(si) body {
    line-height: 1.6;
}

html:lang(si) .main-navbar .nav-link {
    font-size: 0.85rem;
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
}

/* Tamil */
html:lang(ta) body {
    line-height: 1.65;
}

html:lang(ta) .main-navbar .nav-link {
    font-size: 0.85rem;
    padding-left: 0.45rem !important;
    padding-right: 0.45rem !important;
}

html:lang(ta) .header-contact .small {
    font-size: 0.8rem;
}

html:lang(ta) .top-bar {
    font-size: 0.85rem;
}


/* ==========================================
   6. TABLET & MOBILE NAVBAR
   ========================================== */

@media (max-width: 991.98px) {

    /* Navbar */
    .navbar.main-navbar {
        width: 100%;
    }

    /* Collapsed Menu */
    .main-navbar .navbar-collapse {
        width: 100%;
        padding: 15px;
        max-height: calc(100vh - 100px);
        max-height: calc(100dvh - 100px);
        overflow-y: auto;
        overflow-x: hidden;
        background-color: #fff;
    }

    /* Navigation List */
    .main-navbar .navbar-nav {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .main-navbar .nav-item {
        width: 100%;
    }

    /* Navigation Links */
    .main-navbar .nav-link {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: start;
        padding: 12px 15px !important;
        font-size: 15px;
        white-space: normal;
    }

    /* Remove Hover Underline */
    .main-navbar .nav-link::before {
        display: none;
    }

    /* Dropdown */
    .main-navbar .dropdown-menu {
        position: static !important;
        width: 100%;
        border: none;
        border-radius: 5px;
        box-shadow: none;
        background-color: #f8f9fa;
        padding: 5px 15px;
        margin: 0;
    }

    .main-navbar .dropdown-item {
        padding: 10px 12px;
        white-space: normal;
    }

    /* Fixed Navbar */
    .navbar.main-navbar.is-fixed {
        left: 0;
        right: 0;
        width: 100%;
        max-height: 100vh;
    }

    /* Logo */
    .navbar-logo {
        max-height: 45px;
        max-width: 180px;
    }

    /* Top Bar */
    .top-bar {
        font-size: 12px;
        overflow-wrap: break-word;
    }

    .top-bar .container {
        width: 100%;
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Contact */
    .phone-link {
        font-size: 16px;
    }

    /* Language Buttons */
    .lang-switch .lang-btn,
    .lang-switch .btn {
        font-size: 12px;
        padding: 3px 10px;
    }
}


/* ==========================================
   7. SMALL MOBILE DEVICES
   ========================================== */

@media (max-width: 575.98px) {

    .navbar-logo {
        max-height: 38px;
        max-width: 145px;
    }

    .main-navbar .navbar-collapse {
        padding: 10px;
    }

    .main-navbar .nav-link {
        font-size: 14px;
        padding: 11px 10px !important;
    }

    .main-navbar .dropdown-item {
        font-size: 13px;
        padding: 9px 10px;
    }

    .top-bar {
        font-size: 11px;
    }

    .phone-link {
        font-size: 14px;
    }

    .lang-switch .lang-btn,
    .lang-switch .btn {
        font-size: 11px;
        padding: 3px 8px;
    }
    .lang-switch .lang-globe {
        font-size: 11px;
    }

    /* Sinhala Mobile */
    html:lang(si) .main-navbar .nav-link {
        font-size: 14px;
        white-space: normal;
    }

    /* Tamil Mobile */
    html:lang(ta) .main-navbar .nav-link {
        font-size: 14px;
        padding: 11px 10px !important;
        white-space: normal;
    }

    html:lang(ta) .header-contact .small {
        font-size: 12px;
    }

    html:lang(ta) .top-bar {
        font-size: 12px;
    }
}


/* ==========================================
   8. DESKTOP NAVBAR
   ========================================== */

@media (min-width: 992px) {

    .main-navbar .navbar-nav {
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
    }

    .main-navbar .nav-link {
        white-space: nowrap;
    }

    .main-navbar .navbar-collapse {
        overflow: visible;
    }
}


/* ==========================================
   9. EXTRA SMALL SCREEN FIXES
   ========================================== */

@media (max-width: 360px) {

    .navbar-logo {
        max-width: 125px;
        max-height: 35px;
    }

    .main-navbar .nav-link {
        font-size: 13px;
    }

    .lang-switch .lang-btn,
    .lang-switch .btn {
        font-size: 10px;
        padding: 2px 6px;
    }

    .phone-link {
        font-size: 13px;
    }
}


/* ==========================================
   10. ACCESSIBILITY
   ========================================== */

.main-navbar .nav-link:focus-visible,
.main-navbar .dropdown-item: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;
    }
}