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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --code-bg: #1e1e1e;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background: var(--bg-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

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

.btn-run:hover {
    background: #059669;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Features */
.features {
    margin: 3rem 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.feature-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

/* Code Examples */
.code-example,
.quickstart {
    margin: 3rem 0;
}

.code-example h2,
.quickstart h2 {
    margin-bottom: 1rem;
}

pre {
    background: var(--code-bg);
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

/* Playground Styles */
.playground-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.editor-panel,
.output-panel {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.editor-wrapper {
    flex: 1;
    overflow: hidden;
}

#editor,
#output {
    width: 100%;
    height: 100%;
}

#output {
    padding: 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    overflow: auto;
    white-space: pre-wrap;
    background: var(--code-bg);
    color: #d4d4d4;
}

.output-success {
    color: var(--success-color);
}

.output-error {
    color: var(--error-color);
}

/* Loading Indicator */
.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
}

.loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tutorial Styles */
.tutorial-content {
    max-width: 800px;
    margin: 0 auto;
}

.tutorial-content h1 {
    margin-bottom: 1rem;
}

.tutorial-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.tutorial-content p {
    margin-bottom: 1rem;
}

.tutorial-content ul,
.tutorial-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.note {
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

/* Reference Styles */
.syntax-section {
    margin: 2rem 0;
}

.syntax-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.syntax-table th,
.syntax-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.syntax-table th {
    background: var(--bg-color);
    font-weight: 600;
}

.syntax-table code {
    background: var(--code-bg);
    color: #d4d4d4;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    color: var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .playground-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .editor-panel,
    .output-panel {
        height: 400px;
    }

    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 2rem;
    }
}
