/* --- CSS Variables for Easy Theming --- */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f3f4f6;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

/* --- Base Reset & Smooth Scrolling --- */
html {
    scroll-behavior: smooth; /* Added for polished anchor links */
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Typography & Enhanced Buttons --- */
h1, h2, h3 { line-height: 1.2; }
a { text-decoration: none; color: inherit; }

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smoother hover animation */
    cursor: pointer;
}

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

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* Button Hover Effects */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary:hover { background-color: #e5e7eb; }

/* --- Navbar & Enhanced Link Hovers --- */
.navbar {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

/* Sliding Underline Hover Effect for Nav Links */
.nav-links a:not(.btn) {
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a:not(.btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:not(.btn):hover::after {
    width: 100%;
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger {
    display: none;
    cursor: pointer;
}
.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-dark);
    transition: var(--transition);
}

/* --- Hero Section --- */
.hero {
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

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

/* --- Features Section & Enhanced Card Hovers --- */
.features { padding: 5rem 0; }
.bg-light { background-color: var(--bg-light); }

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Card Hover Animation */
.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.4s ease;
    border: 1px solid transparent;
}

.card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 12px 20px rgba(0,0,0,0.1);
    border-color: rgba(37, 99, 235, 0.2);
}

.card h3 { margin-bottom: 1rem; color: var(--primary-color); }

/* --- Footer --- */
footer {
    background-color: var(--text-dark);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}

/* --- Media Queries for Mobile Responsiveness --- */
@media (max-width: 768px) {
    /* Navbar Mobile Adjustments */
    .hamburger { display: block; }
    
    .nav-links {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

    .nav-links.active { left: 0; }
    
    /* Hamburger Animation */
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Advanced Mobile Adjustments (Bonus Task) */
    .hero { padding: 4rem 1rem; }
    .features { padding: 3rem 1rem; }

    .hero-buttons { 
        flex-direction: column; 
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

}
/* --- Query Generator Interface --- */
.generator-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--white);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group label {
    font-weight: 600;
    color: var(--text-dark);
}

#user-prompt {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 2px solid var(--bg-light);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
}

#user-prompt:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Dark Mode Code Block */
.output-group {
    display: flex;
    flex-direction: column;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #1e1e1e;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d2d2d;
    padding: 0.5rem 1rem;
    color: #a3a3a3;
    font-size: 0.875rem;
    font-weight: 600;
}

pre {
    padding: 1.5rem;
    margin: 0;
    overflow-x: auto;
    height: 100%;
}

code {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #4ade80; /* Terminal Green for SQL syntax */
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Mobile Adjustments for the Generator */
@media (max-width: 768px) {
    .generator-box {
        grid-template-columns: 1fr; /* Stacks the input and output on small screens */
    }
}