/**
 * AI Automation Solutions - Layout Styles
 * Contains: Navigation, Footer, Page Layout, Grid Systems
 */

/* ==========================================================================
   Navigation
   ========================================================================== */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--nav-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 44px;
    height: 44px;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.logo-text span {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-cta {
    background: var(--gradient);
    color: #fff !important;
    padding: 10px 24px;
    border-radius: 8px;
}

.nav-cta:hover {
    opacity: 0.9;
}

/* Navigation Right Section */
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

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

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 24px 40px;
}

/* For pages without fixed nav */
main.no-fixed-nav {
    padding-top: 40px;
}

/* ==========================================================================
   Section Layouts
   ========================================================================== */

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--dark);
}

.section-header p {
    color: var(--gray);
    font-size: 1.1rem;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-title p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Grid Systems
   ========================================================================== */

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    padding: 60px 0 30px;
    background: #0d47a1;
    color: #90a4ae;
}

[data-theme="dark"] footer {
    background: #0a0e14;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.footer-links a {
    color: #90a4ae;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    font-size: 0.875rem;
}

/* ==========================================================================
   Back Link
   ========================================================================== */

.back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 100;
}

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

/* ==========================================================================
   Welcome Header
   ========================================================================== */

.welcome-header {
    margin-bottom: 32px;
}

.welcome-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-header p {
    color: var(--text-secondary);
}

/* ==========================================================================
   Responsive Navigation & Layout
   ========================================================================== */

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

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 12px 16px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--nav-bg);
        padding: 20px;
        gap: 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu {
        display: flex;
    }

    main {
        padding: 80px 16px 24px;
    }

    .user-name {
        display: none;
    }

    .services-grid,
    .benefits-grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .section-header h2,
    .section-title h2 {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .welcome-header h1 {
        font-size: 1.4rem;
    }
}

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

    .nav-container {
        padding: 12px;
    }

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

    .logo-text span {
        font-size: 0.8rem;
    }
}
