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

:root {
    /* Core Palette */
    --bg-main: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-dark: #0f172a;
    --text-main: #1e293b;
    --text-light: #475569;
    --text-dark-bg: #e2e8f0;
    --border-color: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #10b981;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Navigation */
.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    transition: color 0.2s;
}

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

.nav-tab {
    cursor: pointer;
    transition: all 0.2s;
}

.tab-active {
    border-bottom-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    padding: 0.5rem 1rem;
    background-color: var(--primary);
    color: white;
    font-weight: 500;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: background-color 0.2s;
}

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

.btn-secondary {
    padding: 0.5rem 0.75rem;
    background-color: white;
    color: var(--primary);
    border: 1px solid var(--primary);
    font-weight: 500;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.btn-selector {
    padding: 0.5rem 0.75rem;
    background-color: #f3f4f6;
    color: var(--text-light);
    font-weight: 500;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-selector:hover {
    background-color: #e5e7eb;
    color: var(--text-main);
}

.btn-selector:focus {
    background-color: var(--primary);
    color: white;
    outline: none;
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
}

/* Cards & Containers */
.card {
    background-color: var(--bg-secondary);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.page-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Code Blocks */
.code-block, pre {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-dark);
    color: var(--text-dark-bg);
    border-radius: 0.375rem;
    overflow-x: auto;
    font-size: 0.875rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Recursion Specifics */
.stack-item {
    background-color: var(--accent);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transition: all 0.3s;
}

.question-btn {
    width: 100%;
    text-align: left;
    padding: 1rem 1.25rem;
    background-color: white;
    font-weight: 500;
    color: var(--text-main);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-btn:hover {
    background-color: #f9fafb;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.answer-panel {
    padding: 1.25rem;
    background-color: #f9fafb;
    border: 1px solid var(--border-color);
    border-top: 0;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* File Handling Specifics */
.answer-content {
    display: none;
}

.accordion-icon {
    transform: rotate(0deg);
    transition: transform 0.2s ease-in-out;
}

.accordion-open .accordion-icon {
    transform: rotate(180deg);
}

/* Typography & Layout */
section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 768px) {
    section {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

h2 {
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-main);
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    h2 {
        font-size: 2.25rem;
    }
}

.section-intro {
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .section-intro {
        font-size: 1.125rem;
    }
}
