/* =========================================
   Layout Styles (Navbar, Footer, Top Bar)
   ========================================= */

/* Top Bar (navbar-top.blade.php) */
.top-navbar {
    background-color: #0b1f33;
    /* Darker navy */
    color: #ffffff;
    padding: 12px 0;
    /* Slightly more padding */
    font-size: 0.9rem;
    /* Slightly larger readable text */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1002;
    letter-spacing: 0.3px;
}

.top-navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 30px;
    /* Better padding */
}

.top-nav-links {
    display: flex;
    gap: 25px;
    /* More spacing */
}

.top-nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.top-nav-links a:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Social Icons in Top Bar */
.social-icons {
    display: flex;
    gap: 18px;
    /* More spacing */
}

.social-icons a {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
}

.social-icons a:hover {
    color: #4facfe;
    transform: translateY(-3px) scale(1.1);
    /* Nice pop effect */
}

/* Main Navbar Redesign (Ultra Premium) */
.main-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 40px rgba(11, 31, 51, 0.05);
    /* Subtle navy shadow */
    position: sticky;
    top: 0;
    z-index: 1001;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    width: 100%;
    border-bottom: none;
    /* Removed harsh border */
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 95px;
    /* Taller, elegant presence */
    padding: 0 40px;
    /* Wider padding */
    max-width: 1400px;
    /* Maximize space for large screens */
    margin: 0 auto;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    /* Recommended for English */
    font-size: 1.6rem;
    color: #0b1f33;
    /* Brand Navy */
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.brand-logo:hover {
    opacity: 0.85;
}

.brand-logo img {
    height: 80px;
    /* Increased for larger logo display */
    max-width: 100%;
    width: auto;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.brand-logo:hover img {
    transform: scale(1.05);
}

.brand-logo span {
    color: #0b1f33;
    background: linear-gradient(135deg, #0b1f33 0%, #0052cc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    white-space: nowrap;
    /* Prevent text wrap */
}

/* Desktop Menu Container */
.desktop-menu {
    display: flex;
    gap: 4px;
    /* Reduced gap to save precious space */
    align-items: center;
    background: rgba(241, 245, 249, 0.7);
    /* Subtle gray pill box */
    padding: 6px;
    border-radius: 100px;
    margin: 0 15px;
    /* Small margin to keep it away from edges */
}

/* Navbar Link Items */
.nav-item {
    color: #475569;
    /* Slate 600 */
    font-weight: 600;
    font-size: 0.95rem;
    /* Slightly smaller text for better fitting */
    padding: 10px 16px;
    /* Smaller horizontal padding */
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    white-space: nowrap;
    position: relative;
    /* overflow: hidden; REMOVED because it hides the dropdown */
}

/* Hover and Active State */
.nav-item:hover,
.nav-item.active {
    color: #ffffff;
    background-color: #0b1f33;
    /* Deep navy background */
    box-shadow: 0 4px 15px rgba(11, 31, 51, 0.2);
    /* Soft glow */
    transform: translateY(-1px);
}

/* Action Buttons Container in Navbar */
.desktop-actions {
    margin-right: 20px;
    /* Space from menu */
}

.desktop-actions .btn {
    white-space: nowrap;
    padding: 14px 32px;
    /* Large, clickable button */
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    background: linear-gradient(135deg, #0b1f33 0%, #1a73e8 100%);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.25);
    border: none;
    transition: all 0.3s ease;
    color: #ffffff;
}

.desktop-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.35);
    color: #ffffff;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown>span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% - 3px);
    /* Adjusted to sit nicely under the pill */
    left: 50%;
    right: auto !important;
    margin-left: -85px;
    /* Center alignment */
    transform: translateY(15px);
    background: white;
    width: 170px;
    min-width: 170px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    border-top: 3px solid #1a73e8;
    /* Updated to new primary blue */
}

.dropdown-menu::before {
    /* Triangle arrow */
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    right: auto !important;
    margin-left: -7px;
    transform: translateY(0);
    border-width: 0 8px 8px 8px;
    border-style: solid;
    border-color: transparent transparent #00A8E8 transparent;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-main, #333333);
    transition: background var(--transition-fast, 150ms ease);
    text-align: right;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background-color: var(--background-light, #F8F9FA);
    color: #1a3c6d;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-main, #333333);
    transition: all 0.3s;
}

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -300px;
    right: auto;
    /* Prevent RTL conflicts */
    width: 300px;
    height: 100vh;
    background: white;
    z-index: 1006;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    /* Adjusted shadow for left side */
    transition: left var(--transition-normal, 300ms ease);
    display: flex;
    flex-direction: column;
}

.mobile-drawer.active {
    left: 0;
}

.drawer-header {
    padding: 20px;
    background: #1a3c6d;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-drawer {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.drawer-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    scrollbar-width: none;
    /* Hide scrollbar for Firefox */
}

.drawer-content::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome/Safari */
}

.drawer-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: var(--text-main, #333333);
    font-weight: 500;
    text-decoration: none;
}

.drawer-item:hover {
    color: #1a3c6d;
    background: var(--background-light, #F8F9FA);
}

/* Secondary drawer items (from top bar) */
.drawer-item-secondary {
    font-size: 0.9rem;
    color: #64748b;
    padding: 10px 12px;
}

.drawer-item-secondary:hover {
    color: #1a3c6d;
    background: var(--background-light, #F8F9FA);
}

/* Blog Accordion in Drawer */
.drawer-accordion {
    border-bottom: 1px solid #eee;
}

.drawer-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-main, #333333);
    text-align: right;
    transition: background 0.2s ease;
}

.drawer-accordion-toggle:hover {
    background: var(--background-light, #f8fafc);
    color: #1a3c6d;
}

.drawer-accordion-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: #64748b;
}

.drawer-accordion.open .drawer-accordion-icon {
    transform: rotate(180deg);
}

.drawer-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
}

.drawer-accordion-content.open {
    max-height: 300px;
}

.drawer-sub-item {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #475569;
    font-size: 0.95rem;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.drawer-sub-item:hover {
    color: #1a73e8;
    padding-right: 28px;
    background: #e8f0fe;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1005;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal, 300ms ease);
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
    left: 300px;
    /* Start after the drawer so links inside are clickable */
    width: calc(100% - 300px);
}

/* Footer Styles */
.footer {
    background-color: #1a3c6d;
    /* Logo Dark Blue */
    color: var(--text-light, #ffffff);
    padding: 60px 0 30px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: #00A8E8;
    /* Cyan */
    font-size: 1.2rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 2px;
    background-color: #00A8E8;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition-fast, 150ms ease);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.footer-links a:hover {
    color: #00A8E8;
    padding-right: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Modern Social Links */
.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-normal, 300ms ease);
    text-decoration: none;
}

.social-links a:hover {
    background: #00A8E8;
    color: white;
    transform: translateY(-3px);
}

/* Base Responsive */
/* Dropdown Menu Styles */
.nav-item.dropdown {
    position: relative;
    display: inline-block;
}

.nav-item.dropdown .dropdown-menu {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-white, #ffffff);
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    z-index: 1000;
    padding: 15px 0;
    margin-top: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(15px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Invisible bridge so mouse hover doesn't break when moving down */
.nav-item.dropdown::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 25px;
    /* extends down to the menu */
    top: 100%;
    left: 0;
    background-color: transparent;
}

.nav-item.dropdown:hover .dropdown-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    color: var(--text-dark, #2c3e50);
    padding: 12px 25px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: right;
    position: relative;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background-color: var(--primary-main, #0b1f33);
    border-radius: 4px;
    transition: height 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-light, #f8f9fa);
    color: var(--primary-main, #0b1f33);
    padding-right: 30px;
}

.dropdown-item:hover::before {
    height: 15px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {

    .desktop-menu,
    .desktop-actions {
        display: none;
    }

    .mobile-toggle {
        display: flex;
        margin-right: auto;
        /* Ensure it pushes to the far left in RTL */
    }

    /* Hide hamburger toggle when the drawer is open to prevent z-index conflicts */
    .mobile-drawer.active~* .mobile-toggle,
    body.drawer-open .mobile-toggle {
        visibility: hidden;
        pointer-events: none;
    }

    .navbar-container {
        height: 80px;
        padding: 0 15px;
        /* Reduce padding to give more space */
        justify-content: flex-start;
        /* Align logo to the right, toggle to the left */
        gap: 10px;
    }

    .brand-logo img {
        height: 65px;
        /* Increased logo size for mobile as requested */
    }

    .brand-logo span {
        display: none;
    }
}