/* ==========================================================================
   PairCoder Layout Styles
   Grid, Containers, Navigation, Footer
   ========================================================================== */

/* --------------------------------------------------------------------------
   Background Effects
   -------------------------------------------------------------------------- */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    top: -200px;
    right: -100px;
    background: var(--accent-primary);
}

.bg-glow-2 {
    bottom: 20%;
    left: -200px;
    background: #8b5cf6;
}

/* --------------------------------------------------------------------------
   Layout Containers
   -------------------------------------------------------------------------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

section {
    padding: var(--section-padding) 0;
}

.section-dark {
    background: var(--bg-secondary);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: padding 0.3s ease;
}

/* Compact header when scrolled */
.site-nav.scrolled {
    padding: 12px 0;
}

.site-nav.scrolled .logo-icon {
    width: 64px;
    height: 64px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono), serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 108px;
    height: 108px;
    border-radius: 12px;
    object-fit: contain;
    transition: width 0.3s ease, height 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

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

/* Nav CTA button - bright white text for visibility */
.nav-links .nav-cta {
    color: #FFFFFF;
}

.nav-links .nav-cta:hover {
    color: #FFFFFF;
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 80px 32px 32px;
        gap: 24px;
        transition: right 0.3s ease;
        border-left: 1px solid var(--border);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        font-size: 1.125rem;
    }

    .nav-links .btn {
        width: 100%;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
    padding: 60px 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.footer-social {
    display: flex;
    gap: 16px;
    align-items: center;
}

.footer-social a {
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
}

.footer-social a:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-divider {
    opacity: 0.4;
}

/* BPS AI Link with Glow Effect */
.bps-link {
    position: relative;
    text-decoration: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    background: transparent;
    transition: all 0.3s ease;
    overflow: hidden;
}

.bps-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
    padding: 1px;
    background: linear-gradient(135deg, transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: all 0.3s ease;
}

.bps-link::after {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--accent-primary) 60deg,
        #8b5cf6 120deg,
        #06b6d4 180deg,
        var(--accent-primary) 240deg,
        transparent 360deg
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: bps-rotate 3s linear infinite paused;
    z-index: -1;
}

.bps-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.3),
        0 0 40px rgba(139, 92, 246, 0.2),
        inset 0 0 20px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.bps-link:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6, #06b6d4);
}

.bps-link:hover::after {
    opacity: 0.6;
    animation-play-state: running;
}

.bps-link-text {
    position: relative;
    z-index: 1;
    background: linear-gradient(90deg, var(--text-muted), var(--text-muted));
    background-clip: text;
    -webkit-background-clip: text;
    transition: all 0.3s ease;
}

.bps-link:hover .bps-link-text {
    background: linear-gradient(90deg, var(--accent-primary), #8b5cf6, #06b6d4);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes bps-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
