/* ==========================================================================
   CSS RESET & VARIABLES
   ========================================================================== */
   
   :root {
    /* Colors */
    --bg-base: #080A0F;
    --bg-surface: #121621;
    --bg-card: rgba(22, 27, 40, 0.6);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --brand-primary: #4F46E5;
    --brand-primary-hover: #4338CA;
    --accent-blue: #3B82F6;
    --accent-purple: #8B5CF6;
    --accent-orange: #F59E0B;
    --accent-green: #10B981;
    --accent-red: #EF4444;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

/* Hard reset for body to fix any cached flex column layouts */
body {
    display: block !important; /* Forces block layout, overriding old flex center */
    min-height: 100vh;
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.app-wrapper {
    display: block;
    width: 100%;
    position: relative;
    z-index: 1;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

.mt-4 { margin-top: 1rem; }

/* ==========================================================================
   GLOW BACKGROUNDS
   ========================================================================== */
   
.glow-bg {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

.top-glow {
    top: -200px;
    left: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.25) 0%, transparent 70%);
}

.bottom-glow {
    bottom: -300px;
    right: -200px;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */
   
.gradient-text {
    background: linear-gradient(135deg, #FFFFFF 0%, #A5B4FC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-primary-sm, .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary);
    color: #FFFFFF;
    font-family: var(--font-heading);
    border-radius: 9999px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-primary {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

.btn-primary-sm:hover, .btn-primary:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.badges-wrap {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.badge.ai-badge {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
    color: #C4B5FD;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(8, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    z-index: 100;
    display: flex; /* Ensures its children align right */
    align-items: center;
}

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

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

.logo-img {
    height: 32px;
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.nav-link {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

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

.dashboard-section, .tutorial-section {
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
    border-top: 1px solid var(--border-light);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
    padding: 11rem 0 6rem;
    text-align: center;
}

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

.hero-title {
    font-size: 3.5rem;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0 auto 3rem;
    max-width: 700px;
}

.hero-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    width: fit-content;
    margin: 0 auto 3rem;
    backdrop-filter: blur(12px);
}

.client-logo {
    height: 80px;
    object-fit: contain;
}

.nathan-logo {
    /* background: rgba(255, 255, 255, 0.1); */
    padding: 6px;
    border-radius: 8px;
}

.connector {
    color: var(--text-muted);
    display: flex;
}

/* ==========================================================================
   SECTIONS & GRID SYSTEM (ROBUST)
   ========================================================================== */

.section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   TUTORIAL / COMO USAR SECTION
   ========================================================================== */

.docs-grid {
    display: grid;
    /* This ensures columns work and don't stack linearly on desktop! */
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.doc-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
}

.warning-card {
    border-color: rgba(239, 68, 68, 0.3);
}

.warning-card:hover { border-color: rgba(239, 68, 68, 0.5); }

.doc-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.doc-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.doc-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.doc-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.doc-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.doc-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1; /* Pushes content down naturally */
}

.doc-list li {
    font-size: 0.9rem;
    color: #CBD5E1;
    padding-left: 1rem;
    position: relative;
}

.doc-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-blue);
}

.doc-list strong {
    color: #FFFFFF;
}

.ai-flow {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.flow-step {
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--accent-purple);
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.875rem;
    color: #E2E8F0;
}

.flow-step strong { color: #FFFFFF; display: block; margin-bottom: 0.25rem; }

.warning-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #FECACA;
}

.warning-box strong {
    color: #FCA5A5;
    font-size: 1rem;
}

/* ==========================================================================
   DASHBOARD SECTION
   ========================================================================== */

.dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.dashboard-head h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.dashboard-head p { color: var(--text-secondary); max-width: 600px; }

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--accent-green);
    font-weight: 500;
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.stats-grid {
    display: grid;
    /* Forces structure, avoiding column breakage. Changed from 4 to 5 for the new manual stats */
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: transform 0.2s;
}

.stat-box:hover { transform: translateY(-3px); }

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }

.stat-box h3 {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.last-sync {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.last-sync strong {
    color: var(--text-primary);
}

/* ==========================================================================
   AUTOMATION DASHBOARD SECTION
   ========================================================================== */

.automation-controls {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    margin-top: 2rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.input-password {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    font-family: var(--font-body);
    width: 280px;
    transition: border-color 0.2s;
}

.input-password:focus {
    border-color: var(--brand-primary);
}

.progress-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    height: 16px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    background: linear-gradient(90deg, var(--brand-primary) 0%, var(--accent-purple) 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 999px;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.automation-errors {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.error-item {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: #FECACA;
    font-size: 0.875rem;
}

.control-feedback {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--accent-green);
    display: none;
}
.control-feedback.error {
    color: var(--accent-red);
}


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

footer {
    border-top: 1px solid var(--border-light);
    background: var(--bg-base);
    padding: 4rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-desc {
    color: var(--text-secondary);
    margin-top: 1rem;
    font-size: 0.95rem;
    max-width: 400px;
}

.footer-right {
    text-align: right;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 1.5rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN (FIXES COLUMNS FOR MOBILE)
   ========================================================================== */

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

@media (max-width: 768px) {
    .nav-links { display: none; } /* Hide links on mobile for cleaner look */
    .hero-title { font-size: 2.5rem; }
    .hero { padding: 8rem 0 4rem; }
    .hero-logos { flex-direction: column; gap: 1rem; }
    
    .docs-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    
    .dashboard-head { flex-direction: column; align-items: flex-start; }
    .footer-content { flex-direction: column; align-items: flex-start; }
    .footer-right { text-align: left; }
    .footer-desc { max-width: 100%; }
}