:root {
    --primary: #E32727;
    --primary-dark: #c01f1f;
    --primary-light: #e85555;
    --secondary: #9ca3af;
    --accent: #fbbf24;
    --background: #0a0a0a;
    --surface: #1a1a1a;
    --surface-elevated: #262626;
    --border: #2a2a2a;
    --border-light: #404040;
    --text-primary: #f5f5f5;
    --text-secondary: #c4c4c4;
    --text-muted: #a3a3a3;
    --success: #22c55e;
    --warning: #fbbf24;
    --error: #f87171;
}

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

body {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

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

.logo-image {
    height: 23px;
    width: auto;
}

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

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

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

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

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

/* Landing Page */
.hero {
    text-align: center;
    padding: 4rem 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
}

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

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

.hero-button {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.hero-button-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 3px 10px rgba(227, 39, 39, 0.2);
}

.hero-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(227, 39, 39, 0.4), 0 0 20px rgba(227, 39, 39, 0.15);
}

.hero-button-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.hero-button-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Features Carousel */
.features-carousel-wrapper {
    margin-top: 3rem;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.features-carousel-wrapper::before,
.features-carousel-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 150px;
    z-index: 2;
    pointer-events: none;
}

.features-carousel-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--background) 0%, transparent 100%);
}

.features-carousel-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--background) 0%, transparent 100%);
}

.features-carousel {
    overflow: hidden;
    padding: 2rem 0;
}

.features-track {
    display: flex;
    gap: 2rem;
    animation: scroll-left 40s linear infinite;
    width: fit-content;
}

.features-track:hover {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 320px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(227, 39, 39, 0.2);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Dojo Section */
.dojo-section {
    display: block;
}

.dojo-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.dojo-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.dojo-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 900px;
    margin: 0 auto;
}

.challenge-generator {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Challenge Generator Layout */
.selectors-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.category-row {
    margin-bottom: 0.75rem;
}

.level-row {
    margin-bottom: 1rem;
}

.generate-row {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.selector-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 1000px;
}

.selector-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.selector-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.selector-btn {
    padding: 0.5rem 0.875rem;
    border: 2px solid var(--border);
    background: var(--background);
    color: var(--text-secondary);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.selector-btn:hover,
.selector-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(227, 39, 39, 0.08);
}

.generate-btn {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(227, 39, 39, 0.2);
    transform: translateY(0);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(227, 39, 39, 0.4), 0 0 20px rgba(227, 39, 39, 0.15);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-icon {
    font-size: 1.2rem;
}

.challenge-display {
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    min-height: 180px;
}

.timer-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.timer-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.timer-main-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.timer-action-buttons {
    display: flex;
    gap: 0.6rem;
}

.timer-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
}

.challenge-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.challenge-placeholder {
    text-align: center;
}

.challenge-structure {
    text-align: left;
    max-width: 800px;
    margin: 0;
}

.challenge-field {
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.challenge-field:last-child {
    margin-bottom: 0;
}

.challenge-label {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 90px;
    flex-shrink: 0;
}

.challenge-value {
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.3;
    flex: 1;
}

.placeholder-text {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1.125rem;
}

.controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.button {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

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

.button-primary:hover {
    background: var(--primary-dark);
}

.button-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.button-secondary:hover {
    background: var(--border);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.timer-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.timer-adjust-btn {
    background: var(--surface);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.2s;
    user-select: none;
}

.timer-adjust-btn:hover:not(:disabled) {
    background: var(--border);
    color: var(--primary);
}

.timer-adjust-btn:active:not(:disabled) {
    background: var(--primary);
    color: white;
    transform: scale(0.95);
}

.timer-adjust-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.timer-adjust-btn:first-child {
    border-right: 1px solid var(--border);
}

.timer-adjust-btn:last-child {
    border-left: 1px solid var(--border);
}

.timer-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.5rem;
    border: none;
    width: 120px;
    text-align: center;
    background: var(--background);
    outline: none;
}

.timer-display:disabled {
    background: var(--surface);
    cursor: not-allowed;
}

.timer-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(227, 39, 39, 0.2);
}

/* Docs Section */
.docs-section {
    display: block;
}

.docs-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.docs-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.docs-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0 auto;
}

.docs-nav {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.docs-section-item {
    margin-top: 2rem;
}

.docs-section-item:first-child {
    margin-top: 0;
}

.docs-section-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.docs-links {
    list-style: none;
    margin-bottom: 2rem;
}

.docs-links:last-child {
    margin-bottom: 0;
}

.docs-link {
    display: block;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

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

/* Doc Page */
.doc-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.doc-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.doc-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.doc-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.doc-content {
    line-height: 1.8;
    color: var(--text-primary);
}

.doc-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.doc-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.doc-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.doc-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.doc-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.doc-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.doc-link-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.doc-link-btn:hover {
    background: var(--primary-dark);
}

.doc-link-btn.secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.doc-link-btn.secondary:hover {
    background: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .nav-links {
        gap: 1rem;
    }

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

    .dojo-title, .docs-title {
        font-size: 1.8rem;
    }

    .dojo-header, .docs-header {
        margin-bottom: 1rem;
    }

    .dojo-subtitle, .docs-subtitle {
        font-size: 1rem;
    }

    .selectors-row {
        padding: 0.75rem;
    }

    .category-row {
        margin-bottom: 0.5rem;
    }

    .selector-section {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .selector-label {
        text-align: center;
        min-width: auto;
    }

    .selector-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .selector-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .generate-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .challenge-display {
        padding: 2rem;
    }

    .challenge-field {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .challenge-label {
        min-width: auto;
    }

    .timer-controls-wrapper {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .timer-action-buttons {
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
    }

    .timer-btn {
        flex: 1;
        max-width: 100px;
    }

    .timer-input-group {
        margin: 0;
    }

    .timer-display {
        font-size: 1.5rem;
        width: 100px;
    }

    .timer-adjust-btn {
        width: 28px;
        height: 40px;
        font-size: 1rem;
    }

    .doc-title {
        font-size: 1.5rem;
    }

    .doc-content h2 {
        font-size: 1.25rem;
    }

    .doc-content h3 {
        font-size: 1.1rem;
    }

    .doc-links {
        flex-direction: column;
    }

    .doc-link-btn {
        text-align: center;
    }
}

/* Hidden class for JavaScript */
.hidden {
    display: none !important;
}

/* Footer */
.footer {
    background: var(--background);
    border-top: 2px solid var(--border-light);
    margin-top: 6rem;
    padding: 4rem 2rem 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-about {
    max-width: 400px;
}

.footer-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.footer-logo-image {
    height: 22px;
    width: auto;
}

.footer-description {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.footer-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
}

.footer-link {
    display: block;
    padding: 0.6rem 0;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.footer-link:hover {
    color: var(--primary);
    transform: translateX(4px);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer {
        padding: 3rem 1.5rem 2rem;
        margin-top: 4rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        margin-bottom: 2rem;
    }

    .footer-about {
        max-width: 100%;
    }
}
