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

:root {
    --primary-color: #f05032;
    --primary-hover: #d63d1f;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #475569;
    --code-bg: #1e1e1e;
    
    --commit-color: #3b82f6;
    --branch-color: #10b981;
    --head-color: #f59e0b;
    --remote-color: #8b5cf6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #f05032 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Command Input Section */
.command-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.command-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.command-header h2 {
    color: var(--text-primary);
}

.difficulty-filter {
    display: flex;
    gap: 15px;
}

.difficulty-filter label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.command-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--code-bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 5px 15px;
    transition: border-color 0.3s ease;
}

.command-input-container:focus-within {
    border-color: var(--primary-color);
}

.terminal-prompt {
    color: var(--success-color);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.2rem;
    font-weight: bold;
}

.command-input {
    flex: 1;
    padding: 15px 10px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1rem;
    outline: none;
}

.command-input::placeholder {
    color: #6a6a6a;
}

.command-suggestions {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    padding: 6px 12px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: 'Consolas', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-chip:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 80, 50, 0.4);
}

/* Result Section */
.result-section {
    animation: fadeIn 0.3s ease;
}

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

.overview-card,
.visual-card,
.explanation-card,
.flags-card,
.mistakes-card,
.related-card,
.practice-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.card-header h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
}

.difficulty-badge {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.difficulty-badge.basic {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.difficulty-badge.intermediate {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.difficulty-badge.advanced {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.command-display {
    background: var(--code-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 15px;
}

.command-display code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.quick-summary {
    padding: 15px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--info-color);
    color: var(--text-primary);
    line-height: 1.8;
}

/* Visual Graph */
.view-toggle {
    display: flex;
    gap: 5px;
    background: var(--surface-light);
    padding: 4px;
    border-radius: 8px;
}

.view-btn {
    padding: 6px 15px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.visual-container {
    display: grid;
    gap: 20px;
    min-height: 300px;
}

.visual-container.both {
    grid-template-columns: 1fr 1fr;
}

.graph-panel {
    background: var(--surface-light);
    border-radius: 8px;
    padding: 20px;
    min-height: 250px;
    position: relative;
}

.graph-title {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.commit-graph {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.commit-node {
    display: flex;
    align-items: center;
    gap: 15px;
}

.commit-dot {
    width: 20px;
    height: 20px;
    background: var(--commit-color);
    border-radius: 50%;
    border: 3px solid var(--surface);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.commit-dot.head {
    background: var(--head-color);
    box-shadow: 0 0 10px var(--head-color);
}

.commit-dot.branch {
    background: var(--branch-color);
}

.commit-line {
    position: absolute;
    width: 3px;
    height: 100%;
    background: var(--commit-color);
    left: 8px;
    top: 20px;
    z-index: 1;
}

.commit-info {
    flex: 1;
    background: var(--code-bg);
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 3px solid var(--commit-color);
}

.commit-hash {
    font-family: 'Consolas', monospace;
    color: var(--warning-color);
    font-size: 0.85rem;
}

.commit-message {
    color: var(--text-primary);
    margin-top: 5px;
}

.commit-labels {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.label {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.label.head {
    background: var(--head-color);
    color: white;
}

.label.branch {
    background: var(--branch-color);
    color: white;
}

.label.remote {
    background: var(--remote-color);
    color: white;
}

/* Steps */
.steps-container {
    display: grid;
    gap: 15px;
}

.step-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--surface-light);
    border-radius: 8px;
}

.step-number {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.step-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-code {
    margin-top: 10px;
    padding: 10px;
    background: var(--code-bg);
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--success-color);
}

/* Flags */
.flags-container {
    display: grid;
    gap: 12px;
}

.flag-item {
    padding: 15px;
    background: var(--surface-light);
    border-radius: 8px;
    border-left: 3px solid var(--info-color);
}

.flag-name {
    font-family: 'Consolas', monospace;
    color: var(--info-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.flag-description {
    color: var(--text-secondary);
}

/* Mistakes */
.mistakes-container {
    display: grid;
    gap: 12px;
}

.mistake-item {
    padding: 15px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--error-color);
}

.mistake-title {
    color: var(--error-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.mistake-description {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.mistake-solution {
    padding: 10px;
    background: var(--code-bg);
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--success-color);
}

/* Related Commands */
.related-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.related-command {
    padding: 15px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.related-command:hover {
    background: var(--border);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.related-command-name {
    font-family: 'Consolas', monospace;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.related-command-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Practice Terminal */
.practice-terminal {
    background: var(--code-bg);
    border-radius: 8px;
    overflow: hidden;
}

.terminal-header {
    background: #2d2d2d;
    padding: 10px 15px;
    border-bottom: 1px solid #1a1a1a;
}

.terminal-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.terminal-output {
    padding: 15px;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.terminal-input-line {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid #2d2d2d;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    outline: none;
}

/* Quick Reference */
.quick-reference,
.cheatsheet-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.quick-reference h2,
.cheatsheet-section h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

.reference-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    border-bottom: 2px solid var(--border);
}

.ref-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ref-tab:hover {
    color: var(--text-primary);
}

.ref-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.reference-content {
    display: grid;
    gap: 12px;
}

.ref-command {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--surface-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ref-command:hover {
    background: var(--border);
}

.ref-command-text {
    flex: 1;
}

.ref-command-code {
    font-family: 'Consolas', monospace;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.ref-command-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ref-command-arrow {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Scenarios */
.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.scenario-card {
    padding: 20px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scenario-card:hover {
    background: var(--border);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(240, 80, 50, 0.3);
}

.scenario-card h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.scenario-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.scenario-card code {
    display: block;
    background: var(--code-bg);
    padding: 10px;
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--success-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-note {
    margin-top: 10px;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .visual-container.both {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .command-input-container {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .related-container,
    .scenarios-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}