/**
 * Modern Navigation & Mobile Enhancements
 */

/* Modern Header Navigation */
.header-modern {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-modern.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

.logo-image {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link-modern {
    padding: 0.75rem 1.25rem;
    color: #6B7280;
    font-weight: 500;
    font-size: 0.938rem;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link-modern:hover {
    color: #4F46E5;
    background: #F9FAFB;
}

.nav-link-modern.active {
    color: #4F46E5;
    font-weight: 600;
}

.nav-link-modern.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 1.25rem;
    right: 1.25rem;
    height: 3px;
    background: linear-gradient(90deg, #4F46E5 0%, #7C3AED 100%);
    border-radius: 3px 3px 0 0;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.dropdown-toggle i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-menu-modern {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 220px;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.nav-dropdown:hover .dropdown-menu-modern {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.dropdown-item-modern:hover {
    background: #F9FAFB;
    color: #4F46E5;
}

.dropdown-item-modern i {
    color: #9CA3AF;
    font-size: 1rem;
}

.dropdown-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 0.5rem 0;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-header-action {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-login {
    background: transparent;
    color: #6B7280;
}

.btn-login:hover {
    color: #4F46E5;
}

.btn-signup {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-trigger:hover {
    background: #F9FAFB;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    object-fit: cover;
    border: 2px solid #E5E7EB;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name-small {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}

.user-role-small {
    font-size: 0.75rem;
    color: #9CA3AF;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
}

.hamburger {
    position: relative;
    width: 24px;
    height: 2px;
    background: #374151;
    transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #374151;
    transition: all 0.3s ease;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

.mobile-menu-toggle.active .hamburger {
    background: transparent;
}

.mobile-menu-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    overflow-y: auto;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-nav.open {
    display: block;
    transform: translateX(0);
}

.mobile-nav-content {
    padding: 2rem 1.5rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.mobile-nav-link:hover {
    background: #F9FAFB;
    color: #4F46E5;
}

.mobile-nav-link.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    color: #4F46E5;
    font-weight: 600;
}

.mobile-nav-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #E5E7EB;
}

.mobile-nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

/* Search Bar in Header */
.header-search {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: none;
}

.header-search.show {
    display: block;
}

.header-search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 2px solid #E5E7EB;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.header-search-input:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.header-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    pointer-events: none;
}

.search-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: #F9FAFB;
    border-radius: 0.5rem;
    cursor: pointer;
    color: #6B7280;
}

.search-toggle:hover {
    background: #E5E7EB;
    color: #4F46E5;
}

/* Notification Badge */
.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #EF4444;
    border: 2px solid white;
    border-radius: 50%;
}

/* Breadcrumbs */
.breadcrumbs-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: #6B7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: #4F46E5;
}

.breadcrumb-item.active {
    color: #111827;
    font-weight: 600;
}

.breadcrumb-separator {
    color: #D1D5DB;
}

/* Footer Modern */
.footer-modern {
    background: linear-gradient(to bottom, white 0%, #F9FAFB 100%);
    border-top: 1px solid #E5E7EB;
    padding: 4rem 0 2rem;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    margin-bottom: 1.5rem;
}

.footer-description {
    font-size: 0.875rem;
    line-height: 1.7;
    color: #6B7280;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    background: #F9FAFB;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: #4F46E5;
    color: white;
    transform: translateY(-2px);
}

.footer-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: #6B7280;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: #4F46E5;
    padding-left: 0.5rem;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    font-size: 0.875rem;
    color: #9CA3AF;
}

.footer-bottom-links {
    display: flex;
    gap: 2rem;
}

.footer-bottom-link {
    font-size: 0.875rem;
    color: #6B7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-bottom-link:hover {
    color: #4F46E5;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-search {
        display: none;
    }
    
    .search-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-content {
        height: 64px;
    }
    
    .logo-image {
        height: 32px;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .user-info {
        display: none;
    }
    
    .btn-header-action span {
        display: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Loading Bar */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4F46E5 0%, #7C3AED 50%, #EC4899 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 9999;
}

.loading-bar.active {
    animation: loading-progress 2s ease-in-out infinite;
}

@keyframes loading-progress {
    0% {
        transform: scaleX(0);
    }
    50% {
        transform: scaleX(0.7);
    }
    100% {
        transform: scaleX(1);
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    max-width: 400px;
    animation: toast-in 0.3s ease;
}

.toast.success {
    border-left: 4px solid #10B981;
}

.toast.error {
    border-left: 4px solid #EF4444;
}

.toast.warning {
    border-left: 4px solid #F59E0B;
}

.toast.info {
    border-left: 4px solid #3B82F6;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #10B981;
}

.toast.error .toast-icon {
    color: #EF4444;
}

.toast.warning .toast-icon {
    color: #F59E0B;
}

.toast.info .toast-icon {
    color: #3B82F6;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.toast-message {
    font-size: 0.875rem;
    color: #6B7280;
}

.toast-close {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: #6B7280;
}
