/**
 * Components CSS - Version 1.0.0
 * Styles for reusable header and footer components
 * Fully responsive for mobile and desktop
 */

:root {
    --primary: #7C3AED;
    --primary-dark: #6D28D9;
    --primary-light: #8B5CF6;
    --secondary: #10B981;
    --dark: #1F2937;
    --gray-dark: #374151;
    --gray: #6B7280;
    --gray-light: #D1D5DB;
    --gray-lighter: #F3F4F6;
    --white: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --shadow: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ============================================
   HEADER STYLES
   ============================================ */

.site-header {
    background: var(--white);
    box-shadow: 0 1px 3px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.navbar {
    width: 100%;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo */
.logo {
    flex-shrink: 0;
}

.logo a,
.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-image {
    height: 40px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.025em;
    white-space: nowrap;
}

.logo-ai {
    color: var(--primary);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--dark);
    border-radius: 3px;
    transition: var(--transition);
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary);
}

/* Navigation Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-auth-login,
.btn-auth-signup,
.btn-auth-dashboard,
.btn-auth-logout {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-auth-login {
    color: var(--text-primary);
    background: transparent;
}

.btn-auth-login:hover {
    color: var(--primary);
    background: var(--gray-lighter);
}

.btn-auth-signup {
    color: var(--white);
    background: var(--primary);
}

.btn-auth-signup:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.btn-auth-dashboard {
    color: var(--text-primary);
    background: var(--gray-lighter);
}

.btn-auth-dashboard:hover {
    background: var(--gray-light);
}

.btn-auth-logout {
    color: var(--white);
    background: var(--gray-dark);
}

.btn-auth-logout:hover {
    background: var(--dark);
}

.btn-try-tool {
    padding: 0.625rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

.btn-try-tool:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
}

.btn-try-tool svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   FOOTER STYLES
   ============================================ */

.site-footer {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-brand {
    padding-right: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo-image {
    height: 35px;
    width: auto;
    display: block;
}

.footer-logo .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
}

.footer-logo .logo-ai {
    color: var(--primary-light);
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 1rem 0 1.5rem;
    font-size: 0.95rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.footer-col h4 {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-block;
}

.footer-col ul li a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-bottom {
    padding-top: 1.5rem;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-bottom-links a:hover {
    color: var(--white);
}

.footer-bottom-links .separator {
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   RESPONSIVE DESIGN - TABLET
   ============================================ */

@media (max-width: 1024px) {
    .footer-top {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    .footer-col:last-child {
        grid-column: 2 / 3;
    }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Header Mobile Styles */
    .nav-container {
        height: 60px;
        padding: 0 1rem;
    }

    .logo-image {
        height: 32px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 2rem 1.5rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
        margin-bottom: 2rem;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--border);
    }

    .nav-link {
        display: block;
        width: 100%;
        padding: 1rem 0;
        font-size: 1.05rem;
    }

    .nav-link::after {
        display: none;
    }

    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
    }

    .auth-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
    }

    .btn-auth-login,
    .btn-auth-signup,
    .btn-auth-dashboard,
    .btn-auth-logout,
    .btn-try-tool {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    /* Footer Mobile Styles */
    .site-footer {
        padding: 2rem 0 1rem;
        margin-top: 3rem;
    }

    .footer-container {
        padding: 0 1rem;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-bottom: 2rem;
    }

    .footer-brand {
        padding-right: 0;
    }

    .footer-logo-image {
        height: 28px;
    }

    .footer-description {
        font-size: 0.9rem;
    }

    .footer-col h4 {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .footer-col ul li {
        margin-bottom: 0.6rem;
    }

    .footer-col ul li a {
        font-size: 0.9rem;
    }

    .footer-bottom-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .copyright {
        font-size: 0.85rem;
    }

    .footer-bottom-links {
        font-size: 0.85rem;
    }
}

/* ============================================
   SMALL MOBILE
   ============================================ */

@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.75rem;
    }

    .logo-image {
        height: 28px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .nav-menu {
        padding: 1.5rem 1rem;
    }

    .footer-social {
        justify-content: flex-start;
    }

    .social-link {
        width: 36px;
        height: 36px;
    }

    .social-link svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus styles for keyboard navigation */
.nav-link:focus,
.btn-auth-login:focus,
.btn-auth-signup:focus,
.btn-auth-dashboard:focus,
.btn-auth-logout:focus,
.btn-try-tool:focus,
.social-link:focus,
.footer-col a:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-link::after {
        height: 3px;
    }

    .social-link {
        border: 2px solid currentColor;
    }
}
