/* Lesson 5 CSS - Typography Examples */

/* Base styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    margin: 0;
    background: #f8fafc;
    color: #1e293b;
}

/* Example container */
.example-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

/* Header styling */
.example-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.example-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.lesson-subtitle {
    margin: 0 0 2rem 0;
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Navigation */
.example-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Content area */
.example-content {
    padding: 2rem;
}

/* Demo sections */
.demo-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.demo-section h3 {
    color: #f59e0b;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

/* Font Explorer */
.font-explorer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.font-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.font-category-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f1f5f9;
    flex-wrap: wrap;
}

.font-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    border-radius: 6px 6px 0 0;
}

.font-tab.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
    background: #fef3c7;
}

.font-selections {
    position: relative;
}

.font-category {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.font-category.active {
    display: grid;
}

.font-option {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
}

.font-option:hover {
    border-color: #f59e0b;
    background: #fef3c7;
}

.font-option.active {
    border-color: #f59e0b;
    background: #fbbf24;
    color: white;
}

.font-preview-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sample-text {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sample-text h1 {
    color: #1e293b;
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
}

.sample-text h2 {
    color: #374151;
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
}

.sample-text p {
    margin-bottom: 1rem;
}

.sample-text blockquote {
    background: #f8fafc;
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    font-style: italic;
}

.font-info {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.font-info h4 {
    margin: 0 0 0.5rem 0;
    color: #374151;
}

.current-font {
    font-family: monospace;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0 0 1rem 0;
}

.font-characteristics {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.characteristic {
    background: #fef3c7;
    color: #92400e;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Typography Playground */
.typography-playground {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.typography-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.control-group input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.control-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
}

.control-group span {
    display: inline-block;
    min-width: 60px;
    font-weight: 500;
    color: #f59e0b;
}

.typography-preview {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.preview-text {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    min-height: 300px;
}

.preview-text h2 {
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.preview-text p {
    margin-bottom: 1rem;
}

.css-output {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.css-output h4 {
    margin: 0 0 1rem 0;
    color: #374151;
}

.css-output code {
    display: block;
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

#copy-typography-css {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

#copy-typography-css:hover {
    background: #d97706;
}

/* Text Effects */
.text-effects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.effect-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
}

.effect-card h4 {
    margin: 0 0 1rem 0;
    color: #374151;
}

.effect-example {
    font-size: 2rem;
    font-weight: bold;
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 8px;
}

.shadow-effect {
    color: #1e293b;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.gradient-text {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.outlined-text {
    color: transparent;
    -webkit-text-stroke: 2px #333;
}

.threed-text {
    color: #666;
    text-shadow: 1px 1px 0px #ccc, 2px 2px 0px #c9c9c9, 3px 3px 0px #bbb, 4px 4px 0px #b9b9b9, 5px 5px 0px #aaa;
}

.neon-text {
    color: #ff6b6b;
    text-shadow: 0 0 5px #ff6b6b, 0 0 10px #ff6b6b, 0 0 15px #ff6b6b, 0 0 20px #ff6b6b;
    background: #1a1a1a;
    border-radius: 8px;
}

.embossed-text {
    color: #999;
    background: #ddd;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.effect-card code {
    display: block;
    background: #f1f5f9;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: left;
    line-height: 1.4;
}

/* Web Fonts Demo */
.web-fonts-demo {
    max-width: 800px;
    margin: 0 auto;
}

.fonts-source-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f1f5f9;
}

.source-tab {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.source-tab.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
    background: #fef3c7;
}

.font-source-content {
    position: relative;
}

.source-panel {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.source-panel.active {
    display: block;
}

.code-example {
    margin: 1.5rem 0;
}

.code-example h5 {
    color: #374151;
    margin: 1rem 0 0.5rem 0;
}

.code-example code {
    display: block;
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    overflow-x: auto;
}

.popular-fonts,
.font-formats,
.fallback-examples {
    margin-top: 2rem;
}

.font-samples {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.font-sample {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    font-size: 1.1rem;
}

.font-sample.inter { font-family: 'Inter', sans-serif; }
.font-sample.roboto { font-family: 'Roboto', sans-serif; }
.font-sample.playfair { font-family: 'Playfair Display', serif; }
.font-sample.source-code { font-family: 'Source Code Pro', monospace; }

.stack-example {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.stack-example code {
    margin-top: 0.5rem;
}

/* Best Practices */
.best-practices {
    max-width: 1000px;
    margin: 0 auto;
}

.practice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.practice-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.practice-card h4 {
    color: #f59e0b;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guidelines {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.guideline {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.example-text {
    margin: 0.75rem 0;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.optimal-length {
    max-width: 45ch; /* Optimal reading length */
}

.line-height-comparison p {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: white;
    border-radius: 4px;
}

.line-height-comparison .tight { line-height: 1.0; }
.line-height-comparison .optimal { line-height: 1.6; }
.line-height-comparison .loose { line-height: 2.0; }

.hierarchy-demo {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
}

.hierarchy-demo h1 { 
    font-size: 2.5rem; 
    font-weight: 700; 
    margin-bottom: 0.5rem; 
    color: #1e293b;
}

.hierarchy-demo h2 { 
    font-size: 2rem; 
    font-weight: 600; 
    margin-bottom: 0.5rem; 
    color: #374151;
}

.hierarchy-demo h3 { 
    font-size: 1.5rem; 
    font-weight: 600; 
    margin-bottom: 0.5rem; 
    color: #4b5563;
}

.hierarchy-demo p {
    margin-bottom: 0.75rem;
}

.hierarchy-demo .main-text { 
    font-size: 1rem; 
    line-height: 1.6; 
    color: #374151;
}

.hierarchy-demo .secondary-text { 
    font-size: 0.9rem; 
    color: #6b7280; 
}

.accessibility-list {
    list-style: none;
    padding: 0;
}

.accessibility-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.accessibility-list li:last-child {
    border-bottom: none;
}

.contrast-examples {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.contrast-good {
    background: #1f2937;
    color: white;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.contrast-poor {
    background: #d1d5db;
    color: #9ca3af;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.responsive-tips code {
    display: block;
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Practice Section */
.practice-section {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}

.typography-challenge {
    max-width: 1000px;
    margin: 0 auto;
}

.challenge-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-item label {
    font-weight: 600;
    color: #374151;
}

.control-item select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
}

.control-item input[type="range"] {
    width: 100%;
}

.control-item span {
    font-weight: 500;
    color: #f59e0b;
}

.article-preview {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.article-preview h1 {
    color: #1e293b;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.article-meta {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0 0 2rem 0;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1rem;
}

.article-lead {
    font-size: 1.2rem;
    color: #374151;
    font-weight: 500;
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

.article-preview h2 {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
}

.article-preview h3 {
    color: #374151;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
}

.article-preview p {
    margin-bottom: 1.5rem;
    color: #374151;
}

.article-preview blockquote {
    background: #f8fafc;
    border-left: 4px solid #f59e0b;
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.1rem;
}

.article-preview cite {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    font-weight: 500;
    color: #6b7280;
}

.article-preview ul {
    margin: 1rem 0 1.5rem 2rem;
}

.article-preview li {
    margin-bottom: 0.5rem;
}

.challenge-feedback {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.score-display {
    font-size: 3rem;
    font-weight: 700;
    color: #10b981;
    margin: 1rem 0;
}

.feedback-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.feedback-item {
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 500;
}

.feedback-item.good {
    background: #dcfce7;
    color: #166534;
}

.feedback-item.warning {
    background: #fef3c7;
    color: #92400e;
}

/* Reference Section */
.reference-section {
    background: linear-gradient(135deg, #f0f9ff, #dbeafe);
    border-color: #3b82f6;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.reference-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.reference-card h4 {
    color: #f59e0b;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.reference-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reference-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.reference-card li:last-child {
    border-bottom: none;
}

/* Code elements */
code {
    background: #f1f5f9;
    color: #1e293b;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Source Code Pro', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* Footer */
.example-footer {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    padding: 2rem;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .example-header {
        padding: 1.5rem 1rem;
    }
    
    .example-content {
        padding: 1rem;
    }
    
    .font-explorer,
    .typography-playground {
        grid-template-columns: 1fr;
    }
    
    .font-category-tabs,
    .fonts-source-tabs {
        flex-direction: column;
    }
    
    .font-category {
        grid-template-columns: 1fr;
    }
    
    .text-effects-grid {
        grid-template-columns: 1fr;
    }
    
    .practice-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .article-preview {
        padding: 2rem 1.5rem;
    }
    
    .contrast-examples {
        flex-direction: column;
    }
}
