/* 
   Enhanced Navigation CSS File for Vasudharini Research Foundation
   Updated with dropdown display fixes
*/

/* Header and Main Navigation */
.header {
    background-color: #041e42; /* Changed from white to dark blue */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.logo {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo img {
    max-height: 60px;
    width: auto;
}

/* Progress Indicator */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 110;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(to right, #0099cc, #ff9900);
    width: 0%;
    transition: width 0.1s ease;
}

/* Main Navigation */
.main-nav {
    flex: 1;
    margin: 0 20px;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    gap: 5px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #fff; /* Changed from #333 to white for better contrast with dark bg */
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 6px;
    text-decoration: none;
}

.nav-link::before {
    content: "";
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #0099cc, #ff9900);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link i {
    margin-left: 5px;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: #33b5e5; /* Adjusted hover color for dark background */
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link:hover::before {
    width: 60%;
}

.nav-link:hover i {
    transform: rotate(180deg);
}

/* CRITICAL FIX - Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px 0;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
    overflow: hidden;
    border-top: 3px solid #0099cc;
    /* Critical fix - initially hidden */
    display: none;
}

/* Remove this rule that was causing conflicts */
/* .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
} */

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
}

.dropdown-menu a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: rgba(0, 153, 204, 0.05);
    transition: all 0.3s ease;
    z-index: -1;
}

.dropdown-menu a:hover {
    color: #0099cc;
    padding-left: 25px;
}

.dropdown-menu a:hover::before {
    width: 100%;
}

/* Centers Navigation - Enhanced as Mega Menu */
.centers-nav-container {
    position: relative;
}

.centers-btn {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0099cc 0%, #008ab8 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 153, 204, 0.25);
}

.centers-btn i {
    margin-left: 8px;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.centers-btn:hover {
    background: linear-gradient(135deg, #008ab8 0%, #0099cc 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 153, 204, 0.3);
}

.centers-btn:hover i {
    transform: rotate(180deg);
}

/* CRITICAL FIX - Centers Dropdown */
.centers-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    width: 300px; /* Adjusted width for better display */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
    border-top: 3px solid #ff9900;
    /* Critical fix - initially hidden */
    display: none;
}

.centers-dropdown::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 20px;
    width: 14px;
    height: 14px;
    background-color: #ffffff;
    transform: rotate(45deg);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

/* Fix: Ensure dropdown items are displayed as a list */
.centers-dropdown a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.centers-dropdown a:last-child {
    border-bottom: none;
}

.centers-dropdown a:hover {
    background-color: rgba(0, 153, 204, 0.1);
    color: #0099cc;
    padding-left: 20px;
}

/* Desktop hover behavior for centers dropdown */
@media (min-width: 992px) {
    .centers-nav-container:hover .centers-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        display: block;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff; /* Updated for dark header */
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    color: #33b5e5; /* Updated for dark header */
    transform: scale(1.1);
}

/* Active Navigation Styles */
.nav-item.active .nav-link {
    color: #33b5e5; /* Updated for dark header */
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.15);
}

.nav-item.active .nav-link::before {
    width: 60%;
}

.dropdown-menu .active a {
    color: #0099cc;
    font-weight: 600;
    background-color: rgba(0, 153, 204, 0.05);
}

/* Enhanced Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0099cc, #ff9900);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 99;
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 153, 204, 0.4);
}

.back-to-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0099cc, #ff9900);
    border-radius: 50%;
    opacity: 0.7;
    animation: pulse 2s infinite;
    z-index: -1;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Floating Action Button */
.floating-action-btn {
    position: fixed;
    bottom: 100px;
    right: 30px; /* Aligned with back-to-top */
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff9900, #ff7700);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 99;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-action-btn i {
    font-size: 20px;
}

.floating-action-btn:hover {
    transform: rotate(45deg);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
}

.floating-action-menu {
    position: fixed;
    bottom: 170px;
    right: 30px; /* Aligned with floating-action-btn */
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.floating-action-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-action-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.floating-action-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.floating-action-item .tooltip {
    position: absolute;
    right: 50px;
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.floating-action-item .tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    border-left: 5px solid #333;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.floating-action-item:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-5px);
}

/* Theme Toggle Button - Proper Alignment */
.theme-toggle {
    position: fixed;
    bottom: 170px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 20px;
    transition: transform 0.5s ease;
}

[data-theme="dark"] .theme-toggle {
    background-color: var(--secondary-color);
}

[data-theme="dark"] .theme-toggle i {
    transform: rotate(180deg);
}

/* Page Transition Effects */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #041e42;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

.page-transition-overlay.active {
    transform: translateY(0);
}

.page-transition-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Navigation */
@media (max-width: 1100px) {
    .main-nav {
        margin: 0 10px;
    }
    
    .nav-link {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 991px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        margin: 15px 0 0;
        display: none;
        background-color: #041e42; /* Updated for dark header */
        border-radius: 8px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
    }
    
    .main-nav.active {
        display: block;
        animation: fadeIn 0.3s ease forwards;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .nav-list {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        padding: 12px 15px;
        width: 100%;
        border-radius: 6px;
    }
    
    .nav-link::before {
        display: none;
    }
    
    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1); /* Updated for dark header */
    }
    
    /* Mobile dropdown styles updated */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        min-width: auto;
        padding: 0 0 0 20px;
        display: none;
        border-radius: 0;
        border-top: none;
        margin-top: 0;
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    .dropdown-menu.active {
        display: block !important;
        animation: slideDown 0.3s ease forwards;
    }
    
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .dropdown-menu a {
        padding: 10px 15px;
        color: rgba(255, 255, 255, 0.7);
    }
    
    .dropdown-menu a:hover {
        padding-left: 20px;
        color: #fff;
    }
    
    .dropdown-menu a::before {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .centers-dropdown {
        width: 100%;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        display: none;
        margin-top: 10px;
        border-top: none;
        background-color: rgba(0, 0, 0, 0.1);
        padding: 15px;
    }
    
    .centers-dropdown::before {
        display: none;
    }
    
    .centers-dropdown.active {
        display: block !important;
        animation: slideDown 0.3s ease forwards;
    }
    
    .centers-btn {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Adjust fixed buttons for mobile */
    .floating-action-btn {
        width: 45px;
        height: 45px;
        right: 20px;
        bottom: 100px;
    }
    
    .floating-action-menu {
        right: 20px;
        bottom: 160px;
    }
    
    .theme-toggle {
        width: 45px;
        height: 45px;
        right: 20px;
        bottom: 160px;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        right: 20px;
    }
    
    .floating-action-item .tooltip {
        display: none;
    }
}

/* Breadcrumbs Navigation */
.breadcrumbs {
    background-color: rgba(0, 153, 204, 0.05);
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.breadcrumbs-list {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumbs-item {
    display: flex;
    align-items: center;
}

.breadcrumbs-item:not(:last-child)::after {
    content: '/';
    margin: 0 10px;
    color: #999;
}

.breadcrumbs-link {
    color: #666;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.breadcrumbs-link:hover {
    color: #0099cc;
}

.breadcrumbs-item:last-child .breadcrumbs-link {
    color: #0099cc;
    font-weight: 500;
}

/* Dark mode adjustments for navigation */
[data-theme="dark"] .header {
    background-color: #0a0a0a;
}

[data-theme="dark"] .centers-dropdown {
    background-color: #1e1e1e;
    border-color: #ff9900;
}

[data-theme="dark"] .centers-dropdown::before {
    background-color: #1e1e1e;
}

[data-theme="dark"] .centers-dropdown a {
    color: #cccccc;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .centers-dropdown a:hover {
    background-color: rgba(51, 181, 229, 0.1);
    color: #33b5e5;
}

[data-theme="dark"] .dropdown-menu {
    background-color: #1e1e1e;
    border-color: #0099cc;
}

[data-theme="dark"] .dropdown-menu a {
    color: #cccccc;
}

[data-theme="dark"] .dropdown-menu a:hover {
    background-color: rgba(51, 181, 229, 0.1);
    color: #33b5e5;
}

[data-theme="dark"] .dropdown-menu a::before {
    background-color: rgba(51, 181, 229, 0.1);
}