/* ==========================================================================
   INSTITUTE GLOBAL THEME (Bootstrap 5 Optimized)
   ========================================================================== */

@font-face {
    font-family: 'Vazirmatn FA';
    src: url('../fonts/Vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn FA';
    src: url('../fonts/Vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
    /* 1. Global Bootstrap Overrides */
    --bs-primary: #63b467; /* Mapped to your brand green for buttons */
    --bs-primary-rgb: 99, 180, 103;
    --bs-body-bg: #f8fafc;
    --bs-body-color: #334155;
    --bs-font-sans-serif: 'Vazirmatn FA', 'Inter', system-ui, -apple-system, sans-serif;

    /* 2. Custom Brand Variables */
    --brand-dark: #3f6843;
    --brand-faded: #eef5e9;
    --brand-primary: #63b467;
}

/* --- BUTTON OVERRIDES --- */
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #529f56;
    border-color: #529f56;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 180, 103, 0.3);
}

.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-outline-primary:hover {
    background-color: var(--bs-primary);
    color: white;
}

/* --- CARD HOVER EFFECTS --- */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1) !important;
}

/* --- UTILITIES --- */
.bg-soft-warning {
    background-color: #fdf5e6;
    color: #d97706;
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-in-out forwards;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.bg-fade{
    background-color: var(--brand-faded);
}

/* --- NAVBAR STYLING --- */
.navbar-custom {
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.nav-brand-A {
    color: var(--brand-primary) !important;
    font-weight: 800;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.nav-animate {
    color: #444444 !important;
    font-weight: 600;
    position: relative;
    transition: color 0.3s ease;
}

.nav-animate:hover {
    color: var(--brand-primary) !important;
}

.dropdown-toggle-custom::after {
    display: none;
}

.messenger-badge {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        background-color: #ffffff;
        border: 1px solid #e2e8f0;
        color: var(--brand-dark);
        border-radius: 50rem;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0.25rem;
    }

/* ==========================================================================
   MOBILE ONLY OVERRIDES (Max-width 991.98px)
   ========================================================================== */
@media (max-width: 991.98px) {
    .mobile-offcanvas {
        max-width: 75vw !important;
        width: 340px !important;
    }

    /* FIX: Removed the rigid min-height that caused overflow. Let flexbox handle it. */
    .offcanvas-body {
        overflow-y: auto;
        padding-bottom: 1.5rem !important;
    }

    /* Mobile Link Styling */
    .mobile-nav-link {
        display: block;
        padding: 12px 16px;
        color: #4b5563 !important;
        font-size: 1.05rem;
        font-weight: 500;
        text-decoration: none;
        border-radius: 8px;
        margin-bottom: 8px;
        transition: all 0.2s ease;
        text-align: right;
    }

    [dir="ltr"] .mobile-nav-link {
        text-align: left;
    }

    /* Active Link Styles */
    .active-mobile {
        font-weight: 600;
        color: var(--brand-primary) !important;
        background-color: var(--brand-faded);
    }

    /* Mobile Language Select */
    .mobile-lang-select {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        width: 100%;
        padding: 12px 16px;
        font-size: 1.05rem;
        font-weight: 500;
        color: #4b5563;
        background-color: transparent;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        text-align: right;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%234b5563' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: left 16px center;
        background-size: 12px;
    }

    [dir="ltr"] .mobile-lang-select {
        text-align: left;
        background-position: right 16px center;
    }

    .mobile-lang-select:focus {
        outline: none;
        background-color: #f9fafb;
    }

    /* Ensure bottom section stays at visible bottom */
    .mobile-bottom-section {
        margin-top: auto !important;
        padding-top: 1rem;
    }

    .btn-mobile-auth {
        border-radius: 10px !important;
        font-size: 1rem;
    }
}