/* css/styles.css - Method 2: Intersection Observer */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: system-ui, -apple-system, sans-serif; line-height: 1.6; color: #333; } header { text-align: center; padding: 2rem; background: #f8f9fa; } header h1 { color: #333; margin-bottom: 0.5rem; } /* Hero section - loads immediately */ .hero { height: 80vh; position: relative; overflow: hidden; background: #000; } .hero-video { width: 100%; height: 100%; object-fit: cover; } .hero-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: white; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); } .hero-content h2 { font-size: 3rem; margin-bottom: 1rem; } .hero-content p { font-size: 1.5rem; } /* Spacer to demonstrate lazy loading */ .spacer { height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(45deg, #667eea 0%, #764ba2 100%); color: white; text-align: center; font-size: 1.5rem; } /* Demo section */ .demo-section { padding: 4rem 2rem; max-width: 800px; margin: 0 auto; } .demo-section h2 { margin-bottom: 2rem; color: #333; text-align: center; } /* Status display - unique to Method 2 */ .status-display { background: #1f2937; color: white; padding: 1.5rem; border-radius: 8px; margin-bottom: 2rem; font-family: "Courier New", monospace; } .status-item { display: flex; justify-content: space-between; margin-bottom: 0.75rem; align-items: center; } .status-item:last-child { margin-bottom: 0; } .status-item .label { color: #9ca3af; font-weight: 600; } .status-item .value { color: #10b981; font-weight: bold; min-width: 120px; text-align: right; } /* Dynamic status colors */ .status-item .value.not-loaded { color: #6b7280; } .status-item .value.loading { color: #f59e0b; } .status-item .value.playing { color: #10b981; } .status-item .value.error { color: #ef4444; } /* Video container with aspect ratio */ .video-container { position: relative; width: 100%; padding-bottom: 56.25%; /* 16:9 aspect ratio */ background-color: #000; border-radius: 8px; overflow: hidden; margin-bottom: 2rem; } .lazy-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; } /* Code example */ .code-example { background: #1e1e1e; color: #f8f8f2; padding: 1.5rem; border-radius: 8px; overflow-x: auto; margin-bottom: 2rem; } .code-example pre { margin: 0; font-family: "Courier New", monospace; line-height: 1.4; } /* Method info box */ .method-info { background: #f8f9fa; padding: 2rem; border-radius: 8px; border-left: 4px solid #8b5cf6; } .method-info h3 { margin-bottom: 1rem; color: #333; } .method-info code { background: #e9ecef; padding: 0.2rem 0.4rem; border-radius: 3px; font-family: "Courier New", monospace; } .pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1rem; } .pros h3 { color: #10b981; margin-bottom: 1rem; } .cons h3 { color: #ef4444; margin-bottom: 1rem; } .pros ul, .cons ul { list-style: none; padding-left: 0; } .pros li, .cons li { margin-bottom: 0.5rem; padding-left: 1.5rem; position: relative; } .pros li:before { content: "✅"; position: absolute; left: 0; } .cons li:before { content: "❌"; position: absolute; left: 0; } /* Testing instructions */ .testing-box { background: #e0f2fe; border: 1px solid #0284c7; border-radius: 8px; padding: 1.5rem; margin: 2rem 0; } .testing-box h3 { color: #0369a1; margin-bottom: 1rem; } .testing-box ol { margin-left: 1.5rem; } .testing-box li { margin-bottom: 0.75rem; line-height: 1.5; } .testing-box code { background: #1e293b; color: #10b981; padding: 0.2rem 0.4rem; border-radius: 3px; font-family: "Courier New", monospace; font-size: 0.9rem; } .testing-box ul { margin-left: 1.5rem; } .testing-box ul li { margin-bottom: 0.25rem; } .testing-box p { margin-top: 1rem; font-weight: bold; color: #0369a1; } /* Mobile responsive */ @media (max-width: 768px) { .hero-content h2 { font-size: 2rem; } .hero-content p { font-size: 1.2rem; } .pros-cons { grid-template-columns: 1fr; gap: 1rem; } .demo-section { padding: 2rem 1rem; } .spacer { font-size: 1.2rem; padding: 1rem; } .status-display { font-size: 0.9rem; } .status-item { flex-direction: column; align-items: flex-start; gap: 0.25rem; } .status-item .value { text-align: left; min-width: auto; } }