/* Unified Header and Footer Styles */

/* Header Enhancements */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.logo:hover {
    color: var(--primary-color-dark);
    transform: scale(1.02);
}

.logo i {
    font-size: 1.5rem;
}

.main-nav .nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.main-nav .nav-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.main-nav .nav-links a:hover {
    background: var(--primary-color-light);
    color: var(--primary-color);
}

.main-nav .nav-links a.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-form {
    display: flex;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.search-input {
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    width: 250px;
    outline: none;
    font-family: inherit;
    color: var(--text-color);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--primary-color-dark);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.user-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--text-light);
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}

.user-action-btn:hover {
    background: var(--surface-hover);
    color: var(--text-color);
}

.count-badge {
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
    position: absolute;
    top: -8px;
    right: -8px;
    font-weight: 600;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--surface-color);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.mobile-nav.active {
    right: 0;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav.active ~ .mobile-nav-overlay,
.mobile-nav.active .mobile-nav-overlay {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-content {
    padding: 2rem;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-header h3 {
    margin: 0;
    color: var(--text-color);
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-nav-close:hover {
    background: var(--surface-hover);
    color: var(--text-color);
}

.mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-links li {
    margin-bottom: 0.5rem;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: var(--primary-color-light);
    color: var(--primary-color);
}

.mobile-nav-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Footer Enhancements */
.main-footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 3rem 0 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--border-color);
    color: var(--text-light);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-note {
    background: var(--info-color-light);
    color: var(--info-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--info-color);
    margin: 1rem 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-stats {
    margin-top: 0.5rem;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        gap: 1rem;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .search-input {
        width: 200px;
    }
    
    .user-actions span {
        display: none;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .back-to-top {
        bottom: 1rem;
        left: 1rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 0.5rem;
    }
    
    .search-input {
        width: 150px;
    }
    
    .mobile-nav {
        width: 280px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 0 1.5rem;
    }
}

/* Dark Theme Enhancements */
.dark-theme .main-header {
    background: var(--surface-color);
    border-bottom-color: var(--border-color);
}

.dark-theme .search-form {
    background: var(--background-color);
    border-color: var(--border-color);
}

.dark-theme .mobile-nav {
    background: var(--surface-color);
}

.dark-theme .main-footer {
    background: var(--surface-color);
    border-top-color: var(--border-color);
}

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}