/* Light Theme Variables */
:root {
    /* Primary Colors */
    --primary-color: #84c4bb; /* Booty Bay - Main brand color */
    --primary-light: #a5e4da; /* Spinnaker - Light accents */
    --primary-dark: #04262b; /* Daintree - Dark text and emphasis */
    
    /* Accent Colors */
    --accent-color: #6caaa9; /* Aqua Sea - Secondary actions */
    --accent-light: #7cbcb9; /* Polished Aqua - Hover states */
    --accent-dark: #304c54; /* Iron Head - Dark accents */
    
    /* Functional Colors */
    --text-primary: #04262b; /* Daintree - Main text */
    --text-secondary: #304c54; /* Iron Head - Secondary text */
    --bg-primary: #ffffff; /* White background */
    --bg-secondary: #f8f9fa; /* Light gray background */
    --navbar-bg: rgba(255, 255, 255, 0.95); /* Slightly transparent white */
    --border-color: #84c4bb; /* Booty Bay - Borders */
    --hover-color: #a5e4da; /* Spinnaker - Hover effect */
    --shadow-color: rgba(4, 38, 43, 0.1); /* Daintree shadow */
}

/* Dark Theme Variables */
[data-theme="dark"] {
    /* Primary Colors */
    --primary-color: #84c4bb; /* Booty Bay - Maintain brand color */
    --primary-light: #a5e4da; /* Spinnaker - Bright accents */
    --primary-dark: #04262b; /* Daintree - Deep background */
    
    /* Accent Colors */
    --accent-color: #6caaa9; /* Aqua Sea - Secondary actions */
    --accent-light: #7cbcb9; /* Polished Aqua - Hover states */
    --accent-dark: #304c54; /* Iron Head - Light backgrounds */
    
    /* Functional Colors */
    --text-primary: #a5e4da; /* Spinnaker - Main text */
    --text-secondary: #7cbcb9; /* Polished Aqua - Secondary text */
    --bg-primary: #04262b; /* Daintree - Main background */
    --bg-secondary: #304c54; /* Iron Head - Secondary background */
    --navbar-bg: rgba(4, 38, 43, 0.95); /* Slightly transparent Daintree */
    --border-color: #6caaa9; /* Aqua Sea - Borders */
    --hover-color: #304c54; /* Iron Head - Hover effect */
    --shadow-color: rgba(4, 38, 43, 0.3); /* Darker shadow for dark mode */
}

/*General Styling*/
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding-top: 70px; /* Offset for fixed navbar */
    color: #333;
}

/* Navbar Styling */
.navbar {
    background-color: var(--navbar-bg);
    transition: all 0.3s ease;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow-color);
    display: flex;
    align-items: center;
    justify-content: space-between; /* Ensures brand, links, and profile are properly placed */
}

.navbar-scrolled {
    background-color: var(--navbar-bg);
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Navbar Brand (Left) */
.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 700;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: var(--accent-color) !important;
    transform: translateY(-1px);
}

/* Center Navbar Links */
.navbar-collapse {
    display: flex;
    justify-content: center; /* Center links */
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Navbar Links */
.navbar-nav .nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--hover-color);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--hover-color);
}

/* Profile Dropdown (Right) */
.navbar-nav .dropdown {
    margin-left: auto; /* Push profile dropdown to the right */
}

.navbar-nav .dropdown .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Profile Image */
.profile-image {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.profile-image:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

/* Ensure dropdown menu is styled properly */
.dropdown-menu {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* Dropdown Items */
.dropdown-item {
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
}

.dropdown-item:hover {
    background-color: var(--hover-color);
    color: var(--primary-color) !important;
    transform: translateX(5px);
}

/* Ensure the email text inside the dropdown is visible */
.dropdown-item-text {
    color: #cccccc !important; /* Light gray for email */
}

/* Ensure dropdown toggles properly */
.navbar .dropdown-menu {
    display: none;
}

.navbar .dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0; /* Remove gap */
}

/* Force dropdown to appear correctly */
.show > .dropdown-menu {
    display: block !important;
}

/* Divider */
.dropdown-divider {
    border-color: var(--border-color);
    opacity: 0.2;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .navbar {
        flex-direction: column;
        align-items: center;
    }

    .navbar-collapse {
        width: 100%;
        justify-content: center; /* Ensure links stay centered */
    }

    .navbar-nav {
        flex-direction: column;
        gap: 10px;
    }

    .navbar-nav .dropdown {
        margin-left: 0; /* Reset margin for mobile */
    }
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--hover-color);
    transform: rotate(15deg);
}

.theme-toggle i {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

/* Dark Mode Specific Styles */
[data-theme="dark"] .navbar:not(.navbar-scrolled) {
    background-color: rgba(4, 38, 43, 0.9) !important;
}

[data-theme="dark"] .navbar-scrolled {
    background-color: var(--navbar-bg) !important;
}

[data-theme="dark"] .navbar-brand {
    text-shadow: 0 0 10px rgba(165, 228, 218, 0.3);
}

[data-theme="dark"] .nav-link {
    color: var(--primary-light) !important;
}

[data-theme="dark"] .nav-link:hover {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .theme-toggle {
    color: var(--primary-light);
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: var(--accent-dark);
}
