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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.header-link:hover {
    color: #374151;
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-outline {
    background-color: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background-color: #f3f4f6;
}

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

/* Main Layout */
.main-content {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: white;
    border-right: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    overflow-y: auto;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
}

.nav-section {
    margin-bottom: 2rem;
    padding: 0 1.5rem;
}

.nav-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-list {
    list-style: none;
}

.nav-list li {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #6b7280;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.nav-link.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.nav-link.completed {
    color: #059669;
}

.nav-link.completed::after {
    content: " ✓";
    color: #059669;
}

.sub-link {
    margin-left: 1rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem;
    max-width: calc(100% - 320px);
}

#content-area {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    min-height: 600px;
}

/* Content Navigation */
.content-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Typography */
.content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 2rem 0 1rem 0;
}

.content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 1.5rem 0 0.75rem 0;
}

.content p {
    margin-bottom: 1rem;
    color: #4b5563;
}

.content ul, .content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.content a {
    color: #2563eb;
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}

/* Code Blocks */
.content pre {
    background-color: #1f2937;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.content code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.content p code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #1f2937;
}

/* Exercise Components */
.exercise-container {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    overflow: hidden;
}

.exercise-header {
    background-color: #f9fafb;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.exercise-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.exercise-description {
    color: #6b7280;
    font-size: 0.875rem;
}

.exercise-content {
    padding: 1.5rem;
}

.prompt-input {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.prompt-input:focus {
    outline: none;
    border-color: #2563eb;
    ring: 2px solid #eff6ff;
}

.exercise-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.response-area {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    min-height: 100px;
    white-space: pre-wrap;
    font-family: inherit;
}

.response-area.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.response-area.success {
    border-color: #10b981;
    background-color: #ecfdf5;
}

.response-area.error {
    border-color: #ef4444;
    background-color: #fef2f2;
    color: #dc2626;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.input-group input:focus {
    outline: none;
    border-color: #2563eb;
    ring: 2px solid #eff6ff;
}

.modal-note {
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-top: 1rem;
}

.modal-note p {
    font-size: 0.875rem;
    color: #92400e;
    margin: 0;
}

/* Alert Components */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert-success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

/* Progress Indicator */
.progress-indicator {
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    height: 0.5rem;
    margin: 1rem 0;
    overflow: hidden;
}

.progress-bar {
    background-color: #10b981;
    height: 100%;
    border-radius: 0.5rem;
    transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .content {
        max-width: 100%;
        padding: 1rem;
    }
    
    #content-area {
        padding: 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .header-links {
        order: -1;
    }
    
    .header-link {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .content-navigation {
        flex-direction: column;
    }
}

/* Loading Spinner */
.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.p-4 { padding: 1rem; }

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Blockquote */
blockquote {
    border-left: 4px solid #e5e7eb;
    margin: 1rem 0;
    padding-left: 1rem;
    color: #6b7280;
    font-style: italic;
}

/* Component boxes for lessons */
.component-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.component-box h3 {
    margin-top: 0;
    color: #1e293b;
}

.component-box .example {
    background: #e0f2fe;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Code blocks */
.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Comparison styles */
.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.poor-example, .good-example {
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid;
}

.poor-example {
    background: #fef2f2;
    border-color: #fecaca;
}

.good-example {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.poor-example h4, .good-example h4 {
    margin-top: 0;
}

/* Lesson grid for intro */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.lesson-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lesson-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lesson-card h3 {
    margin-top: 0;
    color: #1f2937;
}

.lesson-card p {
    color: #6b7280;
    margin-bottom: 0;
}

/* Course Contents List */
.course-contents {
    margin: 2rem 0;
}

.lesson-list {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    list-style: none;
    counter-reset: lesson-counter;
}

.lesson-list li {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    line-height: 1.5;
}

.lesson-list li:hover {
    background-color: #f9fafb;
}

.lesson-list li:last-child {
    margin-bottom: 0;
}

.lesson-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.lesson-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Hint and solution boxes */
.hint-box, .solution-box {
    margin: 1rem 0;
}

.hint-box details, .solution-box details {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 1rem;
}

.hint-box summary, .solution-box summary {
    font-weight: 600;
    cursor: pointer;
    color: #475569;
}

/* Comparison exercise styles */
.comparison-exercise {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.prompt-option {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.comparison-results {
    margin-top: 2rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.poor-prompt {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

.poor-prompt h4 {
    margin-top: 0;
    color: #dc2626;
}

/* Additional responsive adjustments for new components */
@media (max-width: 768px) {
    .comparison, .comparison-exercise {
        grid-template-columns: 1fr;
    }
    
    .lesson-grid {
        grid-template-columns: 1fr;
    }
} 
