/**
 * DhanGenie Layout & Grid System
 * Containers, structural grids, navbar, footer, and section wrappers
 */

/* Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-5);
    padding-right: var(--space-5);
}

.container-wide {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.container-narrow {
    width: 100%;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-5);
    padding-right: var(--space-5);
}

/* Sections */
.section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
    position: relative;
}

.section-sm {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

.section-lg {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
}

.section-alt {
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-primary-light {
    background-color: var(--primary-light);
    border-top: 1px solid var(--primary-border);
    border-bottom: 1px solid var(--primary-border);
}

.section-dark {
    background-color: var(--footer);
    color: var(--footer-text);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
    color: #FFFFFF;
}

.section-dark p {
    color: var(--footer-text);
}

/* Section Header (Centered or Left-aligned) */
.section-header {
    margin-bottom: var(--space-12);
}

.section-header.text-center {
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.section-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-bright);
    margin-bottom: var(--space-3);
}

.section-title {
    margin-bottom: var(--space-3);
}

.section-description {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-6);
}

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

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

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

.grid-cols-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; }

.items-center { align-items: center; }
.items-start { align-items: start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.gap-sm { gap: var(--space-4); }
.gap-md { gap: var(--space-6); }
.gap-lg { gap: var(--space-10); }

/* Header / Navbar Layout */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 76px;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-card);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary);
    text-decoration: none;
}

.brand-logo-img {
    height: auto;
    max-height: 44px;
    width: auto;
    object-fit: contain;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

.brand-logo .brand-highlight {
    color: var(--primary-bright);
}

.brand-logo .brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-bright) 100%);
    border-radius: var(--radius-md);
    color: #FFFFFF;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: var(--space-2) var(--space-1);
    position: relative;
}

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

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-bright);
    border-radius: var(--radius-pill);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Mobile Hamburger Toggle */
.mobile-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    color: var(--text-heading);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.mobile-nav-toggle:hover {
    background-color: var(--bg-alt);
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background-color: var(--bg-body);
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-drawer);
    display: flex;
    flex-direction: column;
    padding: var(--space-6);
}

.mobile-nav-drawer.open {
    transform: translateX(0);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.5);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.mobile-nav-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.mobile-nav-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-heading);
    padding: var(--space-2) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-nav-link.active {
    color: var(--primary-bright);
    font-weight: 600;
}

.mobile-nav-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Master Footer */
.site-footer {
    background-color: var(--footer);
    color: var(--footer-text);
    margin-top: auto;
}

.footer-top {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
}

.footer-brand {
    max-width: 320px;
}

.footer-brand .brand-logo {
    color: #FFFFFF;
    margin-bottom: var(--space-3);
}

.footer-brand p {
    color: var(--footer-text);
    font-size: 14px;
    line-height: 1.6;
}

.footer-col-title {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-links a {
    color: var(--footer-text);
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #FFFFFF;
    transform: translateX(2px);
}

.footer-bottom {
    background-color: var(--footer-bottom);
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--footer-text);
}

.footer-legal-links {
    display: flex;
    gap: var(--space-4);
}

.footer-legal-links a {
    color: var(--footer-text);
}

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