@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --primary: #ce1126; /* Deep Indonesian Red */
    --primary-hover: #b00f1e;
    --primary-glow: rgba(206, 17, 38, 0.12);
    --indonesia-red: #ce1126;
    --bg-dark: #ffffff; /* Default is clean white */
    --surface: #fdfdfd;
    --surface-hover: #fff8f8;
    --text-main: #1a202c; /* Dark text */
    --text-muted: #4a5568; /* Muted grey */
    --border: rgba(0, 0, 0, 0.08);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --grad: linear-gradient(180deg, #ce1126 0%, #990e1c 100%); /* Premium Red Gradient */
    --chat-bg: #f7fafc;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 30px rgba(206, 17, 38, 0.06);
    --shadow-lg: 0 20px 40px rgba(206, 17, 38, 0.1);
}





* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* Custom Scrollbar Branding */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
    border: 2px solid var(--bg-dark);
    transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, .display {
    font-family: var(--font-display);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utility Backgrounds */
.bg-glow {
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    background: var(--primary-glow);
    filter: blur(120px);
    z-index: -1;
    opacity: 0.6;
}

.glow-1 {
    top: -10%;
    left: -10%;
}

.glow-2 {
    bottom: 10%;
    right: -10%;
    background: rgba(255, 255, 255, 0.05);
}

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 8%;
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background 0.4s ease;
}

/* Premium Indonesian flag top accent strip */
nav::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--indonesia-red) 50%, #e2e8f0 50%);
    z-index: 1001;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--primary);
}

.logo img {
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: rotate(-5deg) scale(1.05);
}

.logo span {
    color: var(--text-main);
    font-weight: 500;
}

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

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    opacity: 0.85;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a i {
    font-size: 0.85rem;
    color: var(--primary);
    opacity: 0.9;
    transition: transform 0.3s ease;
}

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

.nav-links a:hover i {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary);
    color: white !important;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px 0 rgba(206, 17, 38, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(206, 17, 38, 0.45);
}

/* Hero - Total Overhaul for Red-White with Wave Gradient */
.hero {
    padding: 6% 8% 12% 8%; /* Extra bottom padding for wave overlap */
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 75vh;
    position: relative;
    background: var(--grad);
    color: #ffffff; /* Make all text white inside Red Banner */
    overflow: hidden;
}

/* Wave divider style */
.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    line-height: 0;
    fill: var(--bg-dark);
    z-index: 2;
    transform: translateY(1px);
}

.hero-content .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
    backdrop-filter: blur(4px);
}

.hero-content h1 {
    font-size: 4.2rem;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: #ffffff;
    font-weight: 800;
}

.hero-content h1 .gradient-text {
    background: linear-gradient(to bottom, #ffffff, #ffdada);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero-content p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    max-width: 90%;
    font-weight: 400;
    line-height: 1.7;
}

.hero-btns {
    display: flex;
    gap: 1.25rem;
}

/* Inverted secondary button on Hero */
.hero .btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.hero .btn-outline:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--primary);
    border-color: #ffffff;
}

/* White stats wrapper to overlap hero */
.stats-section {
    position: relative;
    z-index: 10;
    margin-top: -6rem; /* Pulled up to overlap the wave curve */
    padding: 0 8%;
    margin-bottom: 4rem;
}

.stats-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-card {
    background: var(--surface);
    padding: 2rem 1.5rem;
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid var(--border);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(206, 17, 38, 0.15);
}

.stat-card-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
    background: rgba(206, 17, 38, 0.06);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.stat-card-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-display);
    line-height: 1.1;
}

.stat-card-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
}

.hero-visual {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    /* Smooth masking */
    -webkit-mask-image: radial-gradient(circle, black 50%, rgba(0, 0, 0, 0) 78%);
    mask-image: radial-gradient(circle, black 50%, rgba(0, 0, 0, 0) 78%);
    /* Hero drop shadow adapted to reddish light */
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.05);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-visual:hover img {
    transform: scale(1.12) rotate(1deg);
}

/* Features */
.features {
    padding: 8% 8%;
    background: var(--bg-dark);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

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

.section-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

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

.feature-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    background: var(--surface-hover);
}

.feat-icon {
    width: 52px;
    height: 52px;
    background: rgba(206, 17, 38, 0.08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Code Mockup Section */
.demo-section {
    padding: 8% 8%;
}

.code-window {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 60px -12px rgba(0,0,0,0.2);
    max-width: 1000px;
    margin: 0 auto;
}

.window-header {
    background: var(--surface-hover);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.window-body {
    display: flex;
}

.line-numbers {
    padding: 1.5rem 1rem;
    background: var(--bg-dark);
    color: var(--text-muted);
    font-family: monospace;
    text-align: right;
    font-size: 0.9rem;
    user-select: none;
}

.code-content {
    padding: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

.keyword { color: #ff7b72; }
.func { color: #d2a8ff; }
.string { color: #a5d6ff; }
.comment { color: #8b949e; font-style: italic; }
.highlight-line {
    background: var(--primary-glow);
    border-left: 3px solid var(--primary);
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
    display: block;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 4rem 8% 2rem;
    text-align: center;
    background: var(--bg-dark);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-bottom {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
        padding-top: 12%;
    }
    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-btns {
        justify-content: center;
    }
    .hero-visual {
        max-width: 500px;
        margin: 0 auto;
    }
    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 1rem 5%;
    }
    .nav-links {
        display: none;
    }
    .nav-actions .btn-primary {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    .footer-content {
        flex-direction: column;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content .badge {
        font-size: 0.75rem;
        white-space: normal;
        text-align: center;
        line-height: 1.4;
    }
    .hero-btns {
        flex-direction: column;
    }
    .stats-row {
        justify-content: center;
    }
    .nav-actions .btn-primary span,
    .nav-actions .btn-primary i {
        /* Optional: hide the icon if it's tight, but let's just adjust spacing */
    }
    /* Ensure zero horizontal shifting */
    * {
        max-width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate {
    animation: fadeIn 0.8s ease forwards;
    animation-play-state: paused;
}
.delay-1 { animation-delay: 0.2s; opacity: 0; }
.delay-2 { animation-delay: 0.4s; opacity: 0; }
.delay-3 { animation-delay: 0.6s; opacity: 0; }

/* CHAT OVERLAY WIDGET */
.chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-overlay.active {
    opacity: 1;
    visibility: visible;
}

.chat-window {
    width: 90%;
    max-width: 600px;
    height: 80vh;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7), 0 0 30px rgba(206, 17, 38, 0.15);
    overflow: hidden;
}

.chat-overlay.active .chat-window {
    transform: scale(1) translateY(0);
}

.chat-header {
    padding: 1.2rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.1rem;
}

.close-chat {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.close-chat:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    padding: 0.8rem 1.2rem;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    animation: slideInBubble 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInBubble {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.bot {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top-left-radius: 2px;
    color: var(--text-main);
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-top-right-radius: 2px;
    box-shadow: 0 4px 12px rgba(206, 17, 38, 0.25);
}

.chat-footer {
    padding: 1.2rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    gap: 0.8rem;
}

.chat-input {
    flex: 1;
    background: var(--chat-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

.send-btn {
    background: var(--primary);
    border: none;
    color: white;
    width: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.send-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}

/* Typing dots */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}
.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1s infinite alternate;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    from { transform: translateY(0); opacity: 0.4; }
    to { transform: translateY(-4px); opacity: 1; }
}

/* ==========================================================================
   THEME OVERRIDES & HELPER CLASSES
   (Moved to bottom to ensure correct CSS cascading)
   ========================================================================== */

/* Dark Mode Class Override - Premium Black & Yellow */
body.dark-theme {
    --bg-dark: #050506;
    --surface: #0e0f12;
    --text-main: #f7f7f9;
    --text-muted: #a0a0a8;
    --border: rgba(255, 215, 0, 0.12);
    --chat-bg: #070709;
    
    /* Golden/Yellow Overrides */
    --primary: #ffd700; 
    --primary-hover: #ffaa00;
    --primary-glow: rgba(255, 215, 0, 0.25);
    --grad: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.75);
    --surface-hover: #151611; /* Warm, extremely subtle gold-grey tint */
}

/* Specific Element Overrides for Black & Yellow Dark Mode */
body.dark-theme .hero {
    background: linear-gradient(180deg, #050506 0%, #121316 100%);
    color: var(--text-main);
}

body.dark-theme .hero-content h1 {
    color: #ffffff;
}

body.dark-theme .hero-content h1 .gradient-text {
    background: linear-gradient(to bottom, #ffffff 30%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-theme .hero-content p {
    color: rgba(255, 255, 255, 0.8);
}

/* Contrast fix for primary buttons on solid yellow background */
body.dark-theme .btn-primary {
    color: #000000 !important;
    box-shadow: 0 4px 14px 0 rgba(255, 215, 0, 0.3);
}

body.dark-theme .btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px 0 rgba(255, 215, 0, 0.5);
}

body.dark-theme .hero .btn-primary {
    background: var(--primary) !important;
    color: #000000 !important;
}

body.dark-theme .hero .btn-primary i {
    color: #000000;
}

body.dark-theme .hero .btn-outline {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .hero .btn-outline:hover {
    background: var(--primary);
    color: #000000 !important;
    border-color: var(--primary);
}

/* Chat interface elements in dark mode */
body.dark-theme .message.user {
    background: var(--primary);
    color: #000000;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

body.dark-theme .message.bot {
    background: var(--surface);
    border-color: var(--border);
}

body.dark-theme .send-btn {
    background: var(--primary);
    color: #000000;
}

body.dark-theme .bg-glow {
    background: var(--primary-glow);
}

/* CTA Section Class (Replaces inline red styles) */
.cta-section {
    padding: 8% 8%;
    text-align: center;
    background: linear-gradient(to bottom, transparent, rgba(206, 17, 38, 0.05));
}

body.dark-theme .cta-section {
    background: linear-gradient(to bottom, transparent, rgba(255, 215, 0, 0.03));
}

/* Helper classes for Interactive Demo bubbles inside Welcome blade */
.demo-bubble-user {
    background: var(--primary) !important;
    color: #ffffff !important;
}

body.dark-theme .demo-bubble-user {
    color: #000000 !important;
}

.demo-avatar-bot {
    background: rgba(206, 17, 38, 0.08) !important;
    border: 1px solid var(--primary) !important;
}

body.dark-theme .demo-avatar-bot {
    background: rgba(255, 215, 0, 0.1) !important;
}

/* Special Hero CTA button for Welcome page to handle multi-mode contrast cleanly */
.hero-chat-btn {
    background: #ffffff !important;
    color: var(--primary) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}

.hero-chat-btn i {
    color: var(--primary) !important;
}

body.dark-theme .hero-chat-btn {
    background: var(--primary) !important;
    color: #000000 !important;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.25) !important;
}

body.dark-theme .hero-chat-btn i {
    color: #000000 !important;
}

