/**
 * Header & Menu UI Improvements
 * CollegeVaani - Professional Header Styling
 * Version: 1.0
 */

/* ============================================
   1. LOGO IMPROVEMENTS
   ============================================ */
.navbar-brand {
    padding: 5px 0;
}

.navbar-brand img {
    height: 55px !important;
    width: auto !important;
    max-width: 180px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

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

/* ============================================
   2. APPLY NOW BUTTON IMPROVEMENTS
   ============================================ */
.nav-right-btn .theme-btn {
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.nav-right-btn .theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.nav-right-btn {
    margin-top: 0 !important;
    margin-left: 10px;
}

/* ============================================
   3. NAVIGATION IMPROVEMENTS
   ============================================ */
.main-navigation {
    padding: 8px 0;
}

.navbar-nav .nav-item {
    margin: 0 2px;
}

.navbar-nav .nav-link {
    padding: 10px 14px !important;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================
   4. NAV RIGHT AREA (Search, Wishlist, Apply)
   ============================================ */
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
}

.nav-right-link {
    width: 40px;
    height: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    color: #333;
    transition: all 0.3s ease;
    padding: 0 !important;
}

.nav-right-link:hover {
    background: #667eea;
    color: #fff;
}

.nav-right-link i {
    font-size: 16px;
}

/* Wishlist badge positioning */
.nav-right-link.position-relative .badge {
    font-size: 10px !important;
    padding: 3px 6px;
    min-width: 18px;
}

/* ============================================
   5. TOOLS MEGA MENU STYLING
   ============================================ */
/* Tools mega menu: use same full-width positioning as other mega menus.
   Base theme sets .nav-item.mega-menu { position: static } and
   .navbar .nav-item.mega-menu .dropdown-menu { width: 98%; left: 12px }
   We do NOT override those — this prevents right-side overflow. */
.tools-mega-menu .dropdown-menu {
    padding: 20px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Constrain the tools content inside the full-width dropdown */
.tools-mega-menu .mega-content .row {
    max-width: 800px;
    margin: 0 auto;
}

.tools-mega-menu .mega-content {
    padding: 0;
}

.tools-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.tool-card {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border-radius: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 10px;
}

.tool-card:hover {
    background: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.tool-card:hover .tool-icon,
.tool-card:hover .tool-title,
.tool-card:hover .tool-desc {
    color: #fff !important;
}

.tool-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #fff;
    color: #667eea;
    font-size: 20px;
    margin-right: 15px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.tool-card:hover .tool-icon {
    background: rgba(255, 255, 255, 0.2);
}

.tool-content {
    flex: 1;
}

.tool-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-title .badge {
    font-size: 10px;
    padding: 3px 8px;
}

.tool-desc {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* ============================================
   6. DROPDOWN IMPROVEMENTS
   ============================================ */
.dropdown-menu.fade-down {
    animation: fadeDown 0.3s ease;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Regular dropdown styling to match mega menus */
.nav-item.dropdown > .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
}

.nav-item.dropdown .dropdown-item {
    padding: 10px 20px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-item.dropdown .dropdown-item:hover {
    background: #667eea;
    color: #fff;
}

.nav-item.dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
}

/* ============================================
   7. MOBILE RESPONSIVENESS
   ============================================ */
@media (max-width: 1200px) {
    .navbar-nav .nav-link {
        padding: 10px 10px !important;
        font-size: 13px;
    }
    
    .nav-right-btn .theme-btn {
        padding: 10px 18px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 991px) {
    .navbar-brand img {
        height: 45px !important;
    }
    
    .nav-right {
        margin-left: 0;
        gap: 5px;
    }
    
    .nav-right-btn .theme-btn {
        padding: 8px 16px !important;
        font-size: 12px !important;
        min-width: auto;
    }
    
    .nav-right-link {
        width: 36px;
        height: 36px;
    }
    
    .nav-right-link i {
        font-size: 14px;
    }
    
    /* Mobile menu improvements */
    .navbar-collapse {
        background: #fff;
        padding: 15px;
        border-radius: 10px;
        margin-top: 10px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-nav .nav-item {
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .nav-link {
        padding: 12px 15px !important;
    }
    
    /* Tools mega menu on mobile */
    .tools-mega-menu .dropdown-menu {
        min-width: 100%;
        position: static !important;
        box-shadow: none;
        border: 1px solid #f0f0f0;
        margin-top: 5px;
    }
    
    .tool-card {
        padding: 12px;
    }
    
    .tool-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .navbar-brand img {
        height: 40px !important;
    }
    
    .nav-right-btn {
        display: none;
    }
    
    .mobile-menu-right .nav-right-btn {
        display: block;
    }
    
    .nav-right-link {
        width: 34px;
        height: 34px;
    }
    
    .tools-mega-menu .dropdown-menu {
        padding: 15px;
    }
    
    .tool-card {
        flex-direction: column;
        text-align: center;
    }
    
    .tool-icon {
        margin: 0 auto 10px;
    }
}

/* ============================================
   8. HEADER TOP BAR IMPROVEMENTS
   ============================================ */
.header-top {
    padding: 6px 0;
}

.header-top-social span {
    font-size: 13px;
}

.header-top-social a {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

.header-top-contact ul li a {
    font-size: 13px;
}

/* ============================================
   9. ACCESSIBILITY IMPROVEMENTS
   ============================================ */
.nav-link:focus,
.dropdown-item:focus,
.theme-btn:focus,
.nav-right-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #667eea;
    color: #fff;
    padding: 10px 20px;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}

/* ============================================
   10. PERFORMANCE OPTIMIZATIONS
   ============================================ */
.navbar-brand img,
.tool-icon,
.nav-right-link {
    will-change: transform;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .navbar-brand img,
    .tool-card,
    .theme-btn,
    .nav-right-link,
    .dropdown-menu {
        transition: none !important;
        animation: none !important;
    }
}
