/* Header Styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Top Bar Styles */
.top-bar {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 12px 0;
    border-bottom: 1px solid #e3e6ea;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    opacity: 1;
}

.top-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(0, 123, 255, 0.02) 0%, rgba(0, 123, 255, 0.01) 100%);
}

/* This class will be used by JavaScript to hide the top bar */
.top-bar.hidden {
    transform: translateY(-100%) !important;
    opacity: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    margin-top: -1px !important;
}

.contact-info {
    position: relative;
    z-index: 2;
}

.contact-info span {
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.contact-info i {
    color: #007bff;
    margin-right: 8px;
    font-size: 13px;
}

.top-bar-right {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-links a {
    color: #6c757d;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
}

.social-links a:hover {
    color: #ffffff;
    background: #007bff;
    transform: translateY(-2px);
}

.top-bar .btn-outline-primary {
    border: 2px solid #007bff;
    color: #007bff;
    font-size: 13px;
    padding: 6px 16px;
    font-weight: 600;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.top-bar .btn-outline-primary:hover {
    background: #007bff;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Main Navigation */
.main-nav {
    background: #ffffff;
    padding: 16px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.main-nav.scrolled {
    padding: 12px 0;
}

/* Logo Styles */
.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.logo-img {
    margin-top: -50px;
    margin-bottom: -50px;
    padding-bottom: -50px;
    padding-top: -50px;
    height: 105px;
    margin-right: 12px;
    border-radius: 8px;
}

.logo-text h4 {
    margin: 0;
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text small {
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Navigation Links */
.navbar-nav {
    align-items: center;
}

.navbar-nav .nav-link {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 18px;
    margin: 0 2px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    letter-spacing: 0.3px;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #007bff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active,
.navbar-nav .nav-link[aria-expanded="true"] {
    color: #007bff;
    background: rgba(0, 123, 255, 0.08);
}

.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before,
.navbar-nav .nav-link[aria-expanded="true"]::before {
    width: 80%;
}

/* Modern Dropdown Styles */
.navbar-nav .dropdown {
    position: relative;
}

.modern-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1050;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 8px 0;
    backdrop-filter: blur(10px);
}

.modern-dropdown.show {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

.dropdown-content {
    padding: 0;
}

.modern-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    transition: all 0.2s ease;
    border-radius: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modern-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.modern-dropdown .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.08) 0%, rgba(0, 123, 255, 0.12) 100%);
    color: #007bff;
    transform: translateX(5px);
}

.modern-dropdown .dropdown-item i {
    width: 20px;
    margin-right: 12px;
    color: #6b7280;
    transition: color 0.2s ease;
    text-align: center;
}

.modern-dropdown .dropdown-item:hover i {
    color: #007bff;
}

.modern-dropdown .dropdown-item div {
    display: flex;
    flex-direction: column;
}

.modern-dropdown .dropdown-item strong {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    line-height: 1.3;
}

.modern-dropdown .dropdown-item small {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.2;
}

.modern-dropdown .dropdown-item:hover small {
    color: #374151;
}

/* Debug styles to ensure dropdowns are visible */
.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle:focus {
    outline: none;
}

/* Mobile Close Button Enhanced */
.mobile-close-btn {
    background: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 1;
}

.mobile-close-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: #0056b3;
    transform: scale(1.05);
}

/* Tablet Responsive Styles */
@media (min-width: 768px) and (max-width: 991.98px) {
    .navbar-brand .logo-img {
        height: 80px;
    }

    .navbar-brand .logo-text h4 {
        font-size: 18px;
    }

    .navbar-nav .nav-link {
        font-size: 14px;
        padding: 10px 15px;
    }

    .modern-dropdown {
        min-width: 280px;
    }

    .search-btn .btn {
        width: 40px;
        height: 40px;
    }

    .profile-nav-item .nav-link {
        width: 40px;
        height: 40px;
    }
}

/* Mobile Navigation Improvements */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white;
        border-radius: 12px;
        margin-top: 10px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(0, 0, 0, 0.1);
        max-height: 80vh;
        overflow-y: auto;
    }

    /* Hide dropdowns by default on mobile */
    .modern-dropdown {
        position: static !important;
        display: none !important;
        opacity: 0 !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        border-radius: 8px;
        background: #f8f9fa;
        margin: 0 15px;
        padding: 0;
        min-width: auto;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    /* Show dropdown when active */
    .modern-dropdown.show {
        display: block !important;
        opacity: 1 !important;
        max-height: 500px !important;
        padding: 8px 0 !important;
        margin: 5px 15px !important;
    }

    .modern-dropdown .dropdown-item {
        padding: 10px 15px;
        font-size: 14px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .modern-dropdown .dropdown-item:hover {
        transform: none;
        background: #e9ecef;
    }

    .nav-link.dropdown-toggle {
        position: relative;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .nav-link.dropdown-toggle::after {
        content: '\f107';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        border: none;
        vertical-align: 0;
        margin-left: auto;
        transition: transform 0.3s ease;
        font-size: 14px;
    }

    .nav-link.dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }

    /* Visual feedback for expanded state on mobile */
    .nav-link.dropdown-toggle[aria-expanded="true"] {
        background: rgba(0, 123, 255, 0.12) !important;
        color: #007bff !important;
    }

    .navbar-nav .nav-link {
        padding: 15px 20px !important;
        border-bottom: 1px solid #f0f0f0;
        margin: 0;
        border-radius: 0 !important;
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }

    /* Mobile dropdown animation */
    .modern-dropdown {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .modern-dropdown.show {
        animation: mobileDropdownSlide 0.3s ease-out;
    }

    @keyframes mobileDropdownSlide {
        0% {
            max-height: 0;
            opacity: 0;
            transform: translateY(-10px);
        }

        100% {
            max-height: 500px;
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Search Button */
.search-btn .btn {
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-btn .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.search-btn .btn i {
    font-size: 16px;
    color: #ffffff;
}

/* Mobile Menu Toggle */
.navbar-toggler {
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile Menu Close Button */
.btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 2px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    opacity: 1;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background-color: rgba(0, 123, 255, 0.1);
    border-color: #0056b3;
    opacity: 1;
}

/* Search Modal Styles */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 24px 32px 20px;
}

.modal-title {
    color: #1a1a1a;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.3px;
}

.modal-body {
    padding: 24px 32px 32px;
}

.search-form .form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-form .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-form .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
}

.search-form .form-select {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 15px;
}

.popular-searches h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 12px;
}

.popular-tags .badge {
    background: #f8f9fa;
    color: #495057;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 500;
    margin: 4px 4px 4px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popular-tags .badge:hover {
    background: #007bff;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .main-nav {
        padding: 12px 0;
    }

    .navbar-collapse {
        background: white;
        border-radius: 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        margin-top: 10px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .navbar-nav {
        padding: 0 15px 15px;
    }

    .navbar-nav .nav-link {
        padding: 15px 20px !important;
        border-bottom: 1px solid #f0f0f0;
        margin: 0;
        border-radius: 0 !important;
    }

    .navbar-nav .nav-link::before {
        display: none;
    }

    .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background: #f8f9fa;
        margin: 0;
        border-radius: 0;
        padding-left: 20px;
    }

    .dropdown-item {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .search-btn {
        margin-top: 15px;
        text-align: center;
    }

    .search-btn .btn {
        width: 100%;
        border-radius: 8px;
        height: 50px;
    }
}

@media (max-width: 767.98px) {
    .top-bar {
        padding: 8px 0;
    }

    .contact-info {
        text-align: center;
        margin-bottom: 8px;
        font-size: 13px;
    }

    .contact-info span {
        display: block;
        margin-bottom: 4px;
    }

    .top-bar-right {
        text-align: center !important;
        flex-direction: column;
        gap: 8px;
    }

    .social-links {
        justify-content: center;
        margin-bottom: 0 !important;
    }

    .social-links a {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .top-bar .btn-outline-primary {
        font-size: 12px;
        padding: 4px 12px;
    }
}

/* Smooth animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dropdownOpenPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.dropdown-menu {
    animation: fadeInDown 0.3s ease;
}

/* Additional scroll effects */
.site-header.scrolled .logo-img {
    margin-top: -90px;
    margin-bottom: -90px;
    padding-bottom: -90px;
    padding-top: -90px;
    height: 80px;
}

.site-header.scrolled .logo-text h4 {
    font-size: 18px;
}

.site-header.scrolled .navbar-nav .nav-link {
    padding: 10px 18px;
}

/* Profile Dropdown Styles */
.profile-nav-item .nav-link {
    background: rgba(0, 123, 255, 0.05);
    border: 2px solid #007bff;
    border-radius: 50%;
    padding: 8px !important;
    color: #007bff !important;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 8px;
    width: 44px;
    height: 44px;
    position: relative;
}

.profile-nav-item .nav-link:hover,
.profile-nav-item .nav-link.show {
    background: #007bff !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.profile-nav-item .nav-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.profile-nav-item .nav-link i {
    font-size: 18px;
    margin: 0;
}

.profile-nav-item .dropdown-toggle::after {
    display: none;
    /* Hide the default Bootstrap dropdown arrow */
}

.profile-menu {
    min-width: 280px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0;
    margin-top: 8px;
    background: white;
    overflow: hidden;
    z-index: 1050;
}

.profile-menu .dropdown-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    border: none;
    margin: 0;
}

.profile-menu .dropdown-header i {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 50%;
    margin-right: 15px;
}

.profile-menu .dropdown-header strong {
    font-size: 16px;
    font-weight: 600;
}

.profile-menu .dropdown-header small {
    opacity: 0.9;
    font-size: 13px;
}

.profile-menu .dropdown-item {
    padding: 12px 20px;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
}

.profile-menu .dropdown-item:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    color: #007bff;
    padding-left: 25px;
}

.profile-menu .dropdown-item i {
    width: 20px;
    text-align: center;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.profile-menu .dropdown-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.profile-menu .dropdown-item.text-danger:hover {
    background: linear-gradient(135deg, #fff5f5 0%, #fee);
    color: #dc3545;
}

.profile-menu .dropdown-divider {
    margin: 8px 0;
    border-color: #e9ecef;
}

/* Mobile Profile Styles */
@media (max-width: 992px) {
    .profile-nav-item .nav-link {
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 12px 0 !important;
        margin: 0;
        color: #495057 !important;
        font-weight: 500;
        width: auto;
        height: auto;
        justify-content: flex-start;
    }

    .profile-nav-item .nav-link:hover {
        background: transparent !important;
        color: #007bff !important;
        transform: none;
        box-shadow: none;
    }

    .profile-nav-item .nav-link i {
        font-size: 18px;
        margin-right: 12px;
    }

    .profile-nav-item .dropdown-toggle::after {
        display: inline-block;
        margin-left: auto;
    }

    .profile-menu {
        min-width: 250px;
        margin-top: 4px;
        position: static !important;
        transform: none !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .profile-menu .dropdown-header {
        padding: 16px;
    }

    .profile-menu .dropdown-header i {
        font-size: 20px;
        padding: 10px;
        margin-right: 12px;
    }
}

/* Profile Dropdown Animation */
.profile-menu.show {
    animation: profileDropIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes profileDropIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes profileDropIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}