/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header styles */
header {
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.demo-section {
    background: white;
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.demo-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

/* Status indicators */
.status-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #ddd;
}

.status-label {
    font-weight: 600;
    color: #555;
}

.status-value {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-value.loading {
    background: #fff3cd;
    color: #856404;
    animation: pulse 1.5s infinite;
}

.status-value.loaded {
    background: #d4edda;
    color: #155724;
}

.status-value.error {
    background: #f8d7da;
    color: #721c24;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Font demonstration */
.font-demo {
    display: grid;
    gap: 2rem;
}

.font-example {
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.font-example:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.font-example h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.font-example p {
    margin-bottom: 1rem;
    color: #555;
}

.sample-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    padding: 1rem;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

/* Font face declarations */
@font-face {
    font-family: 'Jigmo';
    src: url('fonts/Jigmo.ttf') format('truetype');
}

/* Apply different fonts to demonstrate loading */
.fallback-font {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.webfont-noto {
    font-family: 'Noto Sans', sans-serif;
}

.webfont-noto .sample-text {
    font-weight: 700;
}

.webfont-serif {
    font-family: 'Noto Serif', serif;
}

.webfont-serif .sample-text {
    font-weight: 600;
    font-style: italic;
}

.webfont-jigmo {
    font-family: 'Jigmo';
}

.webfont-jigmo .sample-text {
    font-weight: normal;
}

/* Performance info cards */
.performance-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-top: 4px solid #3498db;
}

.info-card h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #555;
}

.info-card li::before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Network simulation section */
.network-controls {
    text-align: center;
}

.network-controls p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #555;
}

.speed-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.speed-option {
    background: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.speed-option:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .demo-section {
        padding: 1.5rem;
    }
    
    .status-container {
        grid-template-columns: 1fr;
    }
    
    .performance-info {
        grid-template-columns: 1fr;
    }
    
    .speed-options {
        flex-direction: column;
        align-items: center;
    }
}

/* Font loading animation effects */
.webfont-noto,
.webfont-jigmo {
    opacity: 0;
    animation: fadeInFont 0.5s ease-in-out 0.1s forwards;
}

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