/* CSS Variables for Theme */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #000000;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --pill-bg: #f1f3f4;
    --pill-active: #000000;
    --pill-active-text: #ffffff;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #333333;
    --pill-bg: #1a1a1a;
    --pill-active: #ffffff;
    --pill-active-text: #000000;
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-medium: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

/* Navbar Base */
.navbar {
    padding: 1rem 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

[data-theme="dark"] .navbar {
    background: rgba(0, 0, 0, 0.8);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 2px 20px var(--shadow-light);
}

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

.brand-name {
    color: var(--text-primary);
}

.brand-dot {
    color: #e7818f;
    font-size: 1.8rem;
}

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

/* Navigation Pills Container */
.nav-pills-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-pills {
    background: var(--pill-bg);
    border-radius: 50px;
    padding: 4px;
    display: flex;
    gap: 4px;
    box-shadow: 0 4px 20px var(--shadow-light);
    border: 1px solid var(--border-color);
    position: relative;
}

/* Ensure mobile menu is hidden on desktop */
@media (min-width: 992px) {
    #navbarNav {
        display: none !important;
    }
}

.nav-pill {
    padding: 8px 20px;
    border-radius: 46px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    white-space: nowrap;
}

.nav-pill:hover {
    color: #e7818f;
    transform: translateY(-1px);
}

.nav-pill.active {
    background: var(--pill-active);
    color: #e7818f;
    box-shadow: 0 2px 10px var(--shadow-medium);
}

/* Theme Toggle */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--pill-bg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--pill-active);
    color: var(--pill-active-text);
    transform: scale(1.1);
    box-shadow: 0 4px 15px var(--shadow-medium);
}

/* Mobile Toggle */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    background: var(--pill-bg);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.navbar-toggler:hover {
    background: var(--pill-active);
    color: var(--pill-active-text);
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Mobile Navigation */
.mobile-nav-container {
    background: var(--pill-bg);
    border-radius: 20px;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-light);
}

.mobile-nav-pills {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-pill {
    padding: 12px 20px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.mobile-nav-pill:hover {
    color: var(--text-primary);
    background: rgba(128, 128, 128, 0.1);
}

.mobile-nav-pill.active {
    background: var(--pill-active);
    color: var(--pill-active-text);
    box-shadow: 0 2px 10px var(--shadow-medium);
}

/* Demo Section Styling */
.demo-section {
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.demo-section:nth-child(even) {
    background: var(--bg-secondary);
}

/* Theme Transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .nav-pills-container {
        display: none !important;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
}

@media (max-width: 767.98px) {
    .navbar {
        padding: 0.8rem 0;
    }
    
    .mobile-nav-container {
        margin-top: 0.5rem;
        padding: 0.8rem;
    }
    
    .mobile-nav-pill {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Active Link Animation */
.nav-pill.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--pill-active);
    border-radius: 50px;
    z-index: -1;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar {
    animation: fadeInUp 0.6s ease-out;
}

/* Hover Effects */
.nav-pill:hover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: var(--pill-active);
    border-radius: 22px;
    opacity: 0.1;
    z-index: -1;
    transition: all 0.3s ease;
}
/* === NAVBAR BRAND WITH LOGO === */
.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: var(--font-weight-bold);
    font-size: 1.5rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    gap: var(--spacing-sm);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 2px solid var(--accent-color);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
}

.navbar-brand:hover .brand-logo {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--accent-dark);
    box-shadow: 0 4px 15px rgba(231, 129, 143, 0.3);
}

.brand-name {
    color: var(--text-primary);
    font-weight: var(--font-weight-bold);
    transition: color 0.3s ease;
}

.brand-dot {
    color: var(--accent-color);
    font-weight: var(--font-weight-bold);
    transition: all 0.3s ease;
}

.navbar-brand:hover .brand-name {
    color: var(--accent-color);
}

.navbar-brand:hover .brand-dot {
    color: var(--accent-dark);
    transform: scale(1.2);
}

.navbar-brand:hover {
    text-decoration: none;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 767.98px) {
    .brand-logo {
        width: 35px;
        height: 35px;
    }

    .navbar-brand {
        font-size: 1.25rem;
        gap: 8px;
    }
}

@media (max-width: 575.98px) {
    .brand-logo {
        width: 30px;
        height: 30px;
    }

    .navbar-brand {
        font-size: 1.125rem;
        gap: 6px;
    }
}

/* === ACCESSIBILITY & FOCUS STATES === */
.navbar-brand:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

.navbar-brand:focus .brand-logo {
    transform: scale(1.05);
}

/* === DARK THEME SUPPORT === */
[data-theme="dark"] .brand-logo {
    border-color: var(--accent-color);
}

[data-theme="dark"] .navbar-brand:hover .brand-logo {
    border-color: var(--accent-light);
}

/* === LOADING STATE === */
.brand-logo.loading {
    opacity: 0.7;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* === ANIMATION ENHANCEMENT === */
.brand-logo {
    position: relative;
    overflow: hidden;
}

.brand-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.navbar-brand:hover .brand-logo::before {
    transform: translateX(100%);
}