/* 
Nextbuild Studios - Main Stylesheet
Premium Glassmorphism Theme
*/

:root {
    /* Primary Palette */
    --primary-blue: #2563EB;
    --primary-purple: #7C3AED;
    --primary-cyan: #06B6D4;
    
    /* Light Theme Defaults */
    --bg-color: #f0f2f5;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --nav-bg: rgba(255, 255, 255, 0.7);
    
    /* Typography */
    --font-main: 'Poppins', sans-serif;

    /* Spacing & layout */
    --section-spacing: 100px;
    --container-width: 1200px;
    --border-radius: 16px;
}

[data-theme="dark"] {
    /* Dark Theme Overrides */
    --bg-color: #0f172a;
    --text-color: #f3f4f6;
    --text-light: #9ca3af;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(15, 23, 42, 0.8);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* Animated Background Gradient Blobs */
body::before, body::after {
    content: '';
    position: fixed;
    width: 70vw;
    height: 70vw;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    animation: blobMove 20s infinite alternate;
}

body::before {
    background: radial-gradient(circle, var(--primary-blue), transparent 70%);
    top: -20%;
    left: -20%;
}

body::after {
    background: radial-gradient(circle, var(--primary-purple), transparent 70%);
    bottom: -20%;
    right: -20%;
    animation-delay: -10s;
}

@keyframes blobMove {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20%, 10%) scale(1.1); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); }
h3 { font-size: 1.5rem; }
p { margin-bottom: 1rem; color: var(--text-light); }
a { text-decoration: none; color: inherit; transition: color 0.3s ease; }
ul { list-style: none; }

/* Utility Classes */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

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

.text-center { text-align: center; }
.text-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Glassmorphism Mixin Utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
}

[data-theme="dark"] .btn-secondary {
    color: white;
    border-color: var(--glass-border);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: white;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all 0.4s ease;
}

.navbar.scrolled {
    padding: 1rem 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-link {
    font-weight: 500;
    position: relative;
}

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

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

.nav-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Theme Toggle */
.theme-toggle {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

/* Hero Section */
.hero {
    padding-top: 180px;
    min-height: 90vh;
    display: flex;
    align-items: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Card Grids (Services, Apps) */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.card {
    padding: 2.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
    text-align: left;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-purple);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--primary-blue);
    display: inline-block;
}

/* Featured Apps Specifics */
.app-card {
    text-align: center;
    padding: 2rem;
}

.app-icon img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Why Choose Us (Features) */
.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary-cyan);
    padding: 1rem;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 12px;
}

/* Statistics */
.stats-section {
    padding: 4rem 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    display: block;
}

/* Testimonials */
.testimonial-card {
    text-align: center;
}

.testimonial-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    border: 3px solid var(--primary-blue);
}

.rating { color: #FFD700; margin-bottom: 1rem;}

/* FAQ Accordion */
.faq-container {
    max-width: 800px;
    margin: 4rem auto 0;
}

.faq-item {
    margin-bottom: 1rem;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-color);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-answer {
    padding-bottom: 1.5rem;
    max-height: 500px;
    opacity: 1;
}

.faq-toggle { transition: transform 0.3s ease; }
.faq-item.active .faq-toggle { transform: rotate(180deg); }

/* Contact Section & Form */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    margin-top: 4rem;
}

.contact-info-item {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    border-radius: 8px;
    color: var(--text-color);
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: var(--primary-blue);
}
textarea.form-input { resize: vertical; height: 120px; }

/* Footer */
.footer {
    padding: 4rem 0 2rem;
    margin-top: var(--section-spacing);
    border-top: 1px solid var(--glass-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-links li { margin-bottom: 0.8rem; }
.footer-links a:hover { color: var(--primary-blue); }

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

/* 404 Page */
.page-404 {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    line-height: 1;
}

/* Animations - Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 968px) {
    .hero { padding-top: 140px; }
    .hero-btns { flex-direction: column; }
    .nav-toggle { display: block; z-index: 1001;}
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        transition: right 0.4s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }
    
    [data-theme="dark"] .nav-menu { background: #1e293b; }
    
    .nav-menu.active { right: 0; }
    .contact-grid { grid-template-columns: 1fr; gap: 2rem;}
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 576px) {
    .footer-grid { grid-template-columns: 1fr; }
    .stats-section .grid-3 { grid-template-columns: 1fr 1fr; }
}


/* 1. Turn off the underline for the active filled capsule */
.nav-menu .nav-link.active::after {
    display: none !important;
}

/* 2. Style the active link as a blue capsule */
.nav-menu .nav-link.active {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white !important;
    padding: 10px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

/* Optional: slight hover effect on the active capsule */
.nav-menu .nav-link.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

/* 3. Ensure the original "Download" button still looks right next to it */
/* We need to add a little margin so the capsules don't touch */
.nav-menu li {
    margin-left: 5px;
    margin-right: 5px;
}