/* Lesson 6 CSS - Layout Basics 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, #06b6d4 0%, #0891b2 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: #06b6d4;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

/* Display Explorer */
.display-explorer {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.display-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.display-controls label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.display-controls select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
}

.display-demo-area {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    min-height: 200px;
}

.demo-element {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 2px solid #3b82f6;
    font-weight: 600;
    margin: 0.5rem;
    display: inline-block;
    transition: all 0.3s ease;
}

.demo-element:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.display-info {
    grid-column: 1 / -1;
    margin-top: 2rem;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #06b6d4;
}

.info-card h4 {
    color: #06b6d4;
    margin: 0 0 0.5rem 0;
    font-family: monospace;
    font-size: 1.1rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.info-card li {
    padding: 0.25rem 0;
    color: #374151;
}

/* Position Playground */
.position-playground {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.position-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 select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
}

.control-group input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.control-group span {
    display: inline-block;
    min-width: 50px;
    font-weight: 500;
    color: #06b6d4;
}

.position-demo-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.position-container {
    background: #f1f5f9;
    padding: 2rem;
    border-radius: 8px;
    min-height: 300px;
    position: relative;
    border: 2px dashed #cbd5e1;
}

.background-element {
    background: #e2e8f0;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    color: #64748b;
    text-align: center;
}

.positioned-element {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: 2px solid #d97706;
    position: relative;
    z-index: 1;
    text-align: center;
    display: inline-block;
}

.position-info {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #06b6d4;
}

.position-info h4 {
    color: #06b6d4;
    margin: 0 0 0.5rem 0;
    font-family: monospace;
}

/* Float Demo */
.float-demo {
    max-width: 800px;
    margin: 0 auto;
}

.float-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.float-demo-area {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.float-container {
    border: 2px dashed #cbd5e1;
    padding: 1.5rem;
    border-radius: 8px;
}

.floated-element {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    width: 150px;
    border: 2px solid #7c3aed;
}

.text-content {
    margin: 1rem 0;
    text-align: justify;
    line-height: 1.6;
}

/* Layout Box Model */
.layout-box-model {
    max-width: 1000px;
    margin: 0 auto;
}

.box-model-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 input[type="range"] {
    width: 100%;
}

.control-item select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
}

.control-item span {
    font-weight: 500;
    color: #06b6d4;
}

.layout-demo-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.layout-boxes {
    background: #f1f5f9;
    padding: 2rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.layout-box {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 20px;
    border: 5px solid #d97706;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    width: 150px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.layout-measurements {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.measurement {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #06b6d4;
}

/* Overflow Demo */
.overflow-demo {
    max-width: 800px;
    margin: 0 auto;
}

.overflow-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.overflow-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.overflow-container {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    width: 300px;
    height: 200px;
    overflow: visible;
}

.overflow-content {
    padding: 1rem;
}

.overflow-content p {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
    border-left: 3px solid #06b6d4;
}

.overflow-explanation {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #06b6d4;
}

.overflow-explanation code {
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
}

/* Stacking Demo */
.stacking-demo {
    max-width: 800px;
    margin: 0 auto;
}

.stacking-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.layer-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.layer-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layer-control label {
    font-weight: 600;
    color: #374151;
}

.layer-control input[type="range"] {
    width: 100%;
}

.layer-control span {
    font-weight: 500;
    color: #06b6d4;
}

.stacking-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.stacking-container {
    background: #f1f5f9;
    padding: 3rem;
    border-radius: 8px;
    position: relative;
    height: 300px;
}

.stacking-box {
    position: absolute;
    padding: 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    width: 120px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 3px solid;
}

.red-box {
    background: #fee2e2;
    color: #dc2626;
    border-color: #ef4444;
    top: 20px;
    left: 20px;
}

.blue-box {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #3b82f6;
    top: 60px;
    left: 80px;
}

.green-box {
    background: #dcfce7;
    color: #16a34a;
    border-color: #22c55e;
    top: 100px;
    left: 140px;
}

.z-display {
    font-size: 0.9rem;
    opacity: 0.8;
}

.stacking-explanation {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #06b6d4;
}

.stacking-explanation ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
}

.stacking-explanation li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

/* Practice Section */
.practice-section {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}

.layout-challenge {
    max-width: 1000px;
    margin: 0 auto;
}

.challenge-instructions {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.challenge-instructions ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.challenge-instructions li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.challenge-instructions li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #059669;
    font-weight: bold;
}

.layout-workspace {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.layout-elements {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.draggable-element {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #3730a3;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #6366f1;
    font-weight: 600;
    cursor: grab;
    text-align: center;
    transition: all 0.3s ease;
}

.draggable-element:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.draggable-element:active {
    cursor: grabbing;
}

.layout-canvas {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.drop-zone {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone.drag-over {
    border-color: #06b6d4;
    background: #f0f9ff;
    color: #0891b2;
}

.drop-zone.filled {
    border-color: #059669;
    background: #ecfdf5;
}

.top-zone {
    flex: 0 0 auto;
}

.nav-zone {
    flex: 0 0 auto;
}

.content-row {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.main-zone {
    flex: 2;
}

.sidebar-zone {
    flex: 1;
}

.footer-zone {
    flex: 0 0 auto;
}

.challenge-feedback {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.feedback-message {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #374151;
}

.progress-bar {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    background: linear-gradient(90deg, #06b6d4, #0891b2);
    height: 100%;
    transition: width 0.5s ease;
    width: 0%;
}

/* 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: #06b6d4;
    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: '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;
    }
    
    .display-explorer,
    .position-playground {
        grid-template-columns: 1fr;
    }
    
    .overflow-examples,
    .stacking-area {
        grid-template-columns: 1fr;
    }
    
    .layout-workspace {
        grid-template-columns: 1fr;
    }
    
    .content-row {
        flex-direction: column;
    }
    
    .float-controls,
    .overflow-controls,
    .layer-controls {
        grid-template-columns: 1fr;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
}
