/* Apple-style Navigation CSS */
@import url('https://fonts.googleapis.com/css2?family=-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif');

/* Root Variables */
:root {
    --nav-height: 64px;
    --nav-background: rgba(255, 255, 255, 0.85);
    --nav-border: rgba(0, 0, 0, 0.1);
    --nav-text: #1d1d1f;
    --nav-text-hover: #008080;
    --nav-logout: #ff3b30;
    --mobile-overlay: rgba(255, 255, 255, 0.95);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --shadow-subtle: 0 2px 16px rgba(0, 0, 0, 0.1);
    --blur-effect: blur(20px);
}

/* Global Font Family */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Header */
.main-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--nav-height);
    background: var(--nav-background);
    backdrop-filter: var(--blur-effect);
    -webkit-backdrop-filter: var(--blur-effect);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--shadow-subtle);
    z-index: 9999 !important;
    transition: var(--transition-smooth);
}

/* Body padding to account for fixed header */
body {
    padding-top: var(--nav-height);
}

/* Navigation Container */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

/* Brand Section */
.nav-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 600;
    font-size: 18px;
    transition: var(--transition-smooth);
}

.nav-brand a:hover {
    color: var(--nav-text-hover);
    transform: translateY(-1px);
}

.brand-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    transition: var(--transition-smooth);
}

.brand-text {
    font-weight: 600;
    letter-spacing: -0.015em;
}

/* Brand logo color styling - ke and en in dark grey, DOC in dark teal */
.brand-prefix,
.brand-suffix {
    color: #666666 !important;
}

.brand-main {
    color: #008080 !important;
    font-weight: 700 !important;
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 20px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--nav-text);
    font-size: 15px;
    font-weight: 400;
    border-radius: 20px;
    transition: var(--transition-smooth);
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--nav-text-hover);
    background: rgba(0, 128, 128, 0.08);
    transform: translateY(-1px);
}

.nav-link:active {
    transform: translateY(0);
    background: rgba(0, 128, 128, 0.15);
}

/* Special styling for logout */
.nav-logout:hover {
    color: var(--nav-logout) !important;
    background: rgba(255, 59, 48, 0.08) !important;
}

/* CTA Button */
.nav-cta {
    background: var(--nav-text-hover);
    color: #ffffff !important;
    font-weight: 500;
    padding: 10px 20px !important;
    border-radius: 22px;
    transition: var(--transition-bounce);
}

.nav-cta:hover {
    background: #006666 !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 128, 128, 0.3);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition-smooth);
    position: relative;
    z-index: 1001;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: #000000;
    margin: 3px 0;
    transition: var(--transition-smooth);
    border-radius: 1px;
}

/* Veggie Burger Animation - Two Lines to Perfect X */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(1px, 4px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    transform: rotate(-45deg) translate(1px, -4px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgb(255, 255, 255) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 40px;
    text-align: center;
    pointer-events: all;
}

.mobile-nav-link {
    display: block;
    padding: 16px 32px;
    text-decoration: none;
    color: #000000;
    font-size: 20px;
    font-weight: 400;
    border-radius: 24px;
    transition: var(--transition-bounce);
    min-width: 200px;
    text-align: center;
    pointer-events: all;
    cursor: pointer;
}

.mobile-nav-link:hover {
    color: var(--nav-text-hover);
    background: rgba(0, 128, 128, 0.08);
    transform: scale(1.05);
}

.mobile-logout:hover {
    color: var(--nav-logout) !important;
    background: rgba(255, 59, 48, 0.08) !important;
}

.mobile-cta {
    background: var(--nav-text-hover);
    color: #ffffff !important;
    font-weight: 500;
    margin-top: 16px;
}

.mobile-cta:hover {
    background: #006666 !important;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 128, 128, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .brand-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .mobile-nav-link {
        font-size: 18px;
        min-width: 160px;
        padding: 14px 24px;
    }
    
    .mobile-menu-content {
        gap: 20px;
        padding: 32px 20px;
    }
}

/* Enhanced Hover Effects */
@media (hover: hover) {
    .nav-link::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: radial-gradient(circle, rgba(0, 128, 128, 0.1) 0%, transparent 70%);
        border-radius: 50%;
        transition: var(--transition-smooth);
        transform: translate(-50%, -50%);
        z-index: -1;
    }
    
    .nav-link:hover::before {
        width: 120%;
        height: 120%;
        background: radial-gradient(circle, rgba(0, 128, 128, 0.1) 0%, transparent 70%);
    }
}

/* Notification System */
.notification-container {
    position: relative;
    display: inline-block;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.notification-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #008080;
    border-radius: 50%;
    border: 2px solid white;
    opacity: 0;
    transform: scale(0);
    transition: var(--transition-smooth);
}

.notification-dot.show {
    opacity: 1;
    transform: scale(1);
}

.notification-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1003;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    padding: 20px;
    box-sizing: border-box;
}

.notification-content-wrapper {
    width: 320px;
    max-width: calc(100vw - 40px);
    max-height: 70vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transform: scale(0.95);
    transition: var(--transition-smooth);
}

.notification-panel.show {
    opacity: 1;
    visibility: visible;
}

.notification-panel.show .notification-content-wrapper {
    transform: scale(1);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px 16px 0 0;
}

.notification-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--nav-text);
}

.mark-read-btn {
    background: none;
    border: none;
    color: var(--nav-text-hover);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.mark-read-btn:hover {
    background: rgba(0, 128, 128, 0.1);
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.notification-item.unread {
    background: rgba(0, 128, 128, 0.02);
    border-left: 3px solid var(--nav-text-hover);
}

.notification-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: var(--nav-text);
    margin: 0;
}

.notification-time {
    font-size: 12px;
    color: #8e8e93;
    white-space: nowrap;
}

.notification-empty {
    padding: 32px 20px;
    text-align: center;
    color: #8e8e93;
    font-size: 14px;
}

/* Notification Overlay for all screens */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.notification-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .notification-content-wrapper {
        width: calc(100vw - 32px);
        max-width: 340px;
        max-height: 80vh;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .notification-content-wrapper {
        width: calc(100vw - 24px);
        max-width: none;
        margin: 12px;
    }
    
    .notification-header {
        padding: 14px 16px;
    }
    
    .notification-item {
        padding: 10px 16px;
    }
    
    .notification-message {
        font-size: 13px;
    }
    
    .notification-time {
        font-size: 11px;
    }
}

/* Focus States for Accessibility */
.nav-link:focus,
.mobile-nav-link:focus,
.mobile-menu-toggle:focus,
.notification-btn:focus {
    outline: 2px solid var(--nav-text-hover);
    outline-offset: 2px;
}

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

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

.nav-link,
.mobile-nav-link {
    animation: fadeInUp 0.6s ease-out forwards;
}

.nav-link:nth-child(1) { animation-delay: 0.1s; }
.nav-link:nth-child(2) { animation-delay: 0.2s; }
.nav-link:nth-child(3) { animation-delay: 0.3s; }
.nav-link:nth-child(4) { animation-delay: 0.4s; }
.nav-link:nth-child(5) { animation-delay: 0.5s; }
.nav-link:nth-child(6) { animation-delay: 0.6s; }

/* Navigation Actions (Shopping Bag Icon) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
}

.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.04);
    color: #1d1d1f;
    text-decoration: none;
    transition: var(--transition-smooth);
    border: none;
    cursor: pointer;
}

.nav-icon-btn:hover {
    background: rgba(0, 128, 128, 0.1);
    color: var(--nav-text-hover);
    transform: translateY(-1px);
    text-decoration: none;
}

.nav-icon-btn:active {
    transform: translateY(0);
    background: rgba(0, 128, 128, 0.15);
}

.nav-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    stroke: #1d1d1f !important;
}

.nav-icon path,
.nav-icon line {
    stroke: #1d1d1f !important;
}

/* Mobile Actions */
.mobile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.04);
    color: #1d1d1f;
    text-decoration: none;
    transition: var(--transition-smooth);
    border: none;
    cursor: pointer;
}

.mobile-icon-btn:hover {
    background: rgba(0, 128, 128, 0.1);
    color: var(--nav-text-hover);
    text-decoration: none;
}

.mobile-icon-btn:active {
    transform: scale(0.95);
    background: rgba(0, 128, 128, 0.15);
}

.mobile-nav-icon {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    stroke: #1d1d1f !important;
}

.mobile-nav-icon path,
.mobile-nav-icon line {
    stroke: #1d1d1f !important;
}

/* Subscription Button Specific Styling */
.subscription-btn {
    position: relative;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .nav-actions {
        display: none;
    }
    
    .mobile-actions {
        display: flex;
    }
    
    .nav-container {
        padding: 0 16px;
    }
}

@media (min-width: 769px) {
    .mobile-actions {
        display: none;
    }
    
    .nav-actions {
        display: flex;
    }
}