/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --background: #ffffff;
    --surface: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ==================== HEADER ==================== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 1.125rem;
    opacity: 0.95;
    font-weight: 400;
}

/* ==================== MAIN CONTENT ==================== */
.main {
    flex: 1;
    padding: 3rem 0;
}

/* ==================== FILTERS ==================== */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.625rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* ==================== LOADING STATE ==================== */
.loading {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== GALLERY GRID ==================== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    animation: fadeIn 0.5s ease;
}

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

/* ==================== SIMULATION CARDS ==================== */
.sim-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sim-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.sim-card:hover .sim-thumbnail {
    transform: scale(1.05);
}

.sim-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 aspect ratio */
    overflow: hidden;
    background: var(--surface);
}

.sim-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sim-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sim-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.sim-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    flex: 1;
}

.sim-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.sim-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sim-tag.physics {
    background: #dbeafe;
    color: #1e40af;
}

.sim-tag.biology {
    background: #d1fae5;
    color: #065f46;
}

.sim-tag.mathematics {
    background: #fce7f3;
    color: #9f1239;
}

.sim-tag.chemistry {
    background: #fef3c7;
    color: #92400e;
}

.sim-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.sim-date {
    font-size: 0.8125rem;
}

.sim-cta {
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sim-cta::after {
    content: '→';
    transition: transform 0.3s ease;
    display: inline-block;
}

.sim-card:hover .sim-cta::after {
    transform: translateX(4px);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
