/* Root Variables */
:root {
    --primary-color: #0a3d62;
    /* Navy Blue */
    --primary-hover: #072b46;
    --secondary-color: #f8fafc;
    /* Light Gray Background */
    --text-color: #0f172a;
    /* Dark Slate */
    --text-muted: #64748b;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --font-main: 'Inter', sans-serif;

    /* Level Colors */
    --bg-beginner: #dbeafe;
    --text-beginner: #1e40af;
    --bg-intermediate: #fef3c7;
    --text-intermediate: #92400e;
    --bg-advanced: #fee2e2;
    --text-advanced: #991b1b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style-type: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: var(--white);
    padding: 16px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 50px;
    width: auto;
}

/* Hero Section */
.hero-section {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero-section p {
    font-size: 1.25rem;
    color: #e2e8f0;
    max-width: 700px;
    margin: 0 auto;
}

/* Filters */
.filters-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: var(--white);
    border: 1px solid #e2e8f0;
    padding: 10px 24px;
    border-radius: 50px;
    font-family: var(--font-main);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

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

/* Task Grid */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 80px;
}

/* Task Card */
.task-card {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #e2e8f0;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.week-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.level-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.level-badge.beginner {
    background-color: var(--bg-beginner);
    color: var(--text-beginner);
}

.level-badge.intermediate {
    background-color: var(--bg-intermediate);
    color: var(--text-intermediate);
}

.level-badge.advanced {
    background-color: var(--bg-advanced);
    color: var(--text-advanced);
}

.task-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.task-objective {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.card-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Align top for long content scroll */
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 40px 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--white);
    width: 100%;
    max-width: 800px;
    border-radius: 12px;
    position: relative;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin: auto 0;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-header {
    background-color: #f8fafc;
    padding: 40px 40px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header .badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    /* Increased to separate level from title */
}

/* Reference Image in Modal */
.modal-image-container {
    margin-top: 24px;
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.modal-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}

.modal-header h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.modal-header .week-label {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.modal-body {
    padding: 40px;
}

.detail-section {
    margin-bottom: 32px;
}

.detail-section h3 {
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    font-weight: 700;
}

.detail-section p,
.detail-section li {
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.7;
}

.detail-section ul {
    list-style-type: disc;
    padding-left: 20px;
}

.detail-section ul li {
    margin-bottom: 8px;
}

.submission-box {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    padding: 24px;
}

.submission-box h3 {
    color: #0369a1;
}

.submission-box p {
    color: #0c4a6e;
    margin-bottom: 0;
}

/* Layout Helpers */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col-half {
    width: 50%;
    padding: 0 12px;
}

/* Footer */
.main-footer {
    background-color: #0f172a;
    /* Dark Footer */
    color: #94a3b8;
    text-align: center;
    padding: 40px 0;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .col-half {
        width: 100%;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .modal-content {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        overflow-y: auto;
    }
}