/* Main Styles for GitHub Pages */

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
}

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

.subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Intro Section */
.intro {
    margin: 4rem 0;
    text-align: center;
}

.intro h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.intro p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 1rem auto;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    min-height: 44px; /* Minimum touch target size */
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

/* Filter Section */
.filter-section {
    margin: 3rem 0;
}

.filter-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-secondary);
    min-height: 44px; /* Minimum touch target size */
    display: inline-flex;
    align-items: center;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* Challenge Section */
.challenge-section {
    margin: 4rem 0;
}

.challenge-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Challenges Grid */
.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Challenge Card */
.challenge-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.challenge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.challenge-card.hidden {
    display: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.challenge-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-completed {
    background: #d1fae5;
    color: #065f46;
}

.badge-in-progress {
    background: #fef3c7;
    color: #92400e;
}

.badge-web {
    background: #dbeafe;
    color: #1e40af;
    margin-left: 0.5rem;
}

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

.card-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    min-height: 44px; /* Minimum touch target size */
}

.card-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

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

.card-btn-primary:hover {
    background: var(--primary-dark);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 3rem 0;
    margin-top: 6rem;
    text-align: center;
    color: var(--text-secondary);
}

.footer p {
    margin-bottom: 0.75rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-block;
    min-height: 44px; /* Touch target */
    line-height: 44px;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .challenges-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        padding: 3rem 0 2rem;
    }

    .header h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .stats {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: space-around;
    }

    .stat {
        min-width: 100px;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .intro h2 {
        font-size: 1.5rem;
    }

    .intro p {
        font-size: 1rem;
    }

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

    .challenge-card {
        padding: 1.25rem;
    }

    .card-title {
        font-size: 1.125rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .container {
        padding: 0 1rem;
    }

    .filter-section h2 {
        font-size: 1.25rem;
    }

    .filters {
        gap: 0.5rem;
    }

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

    .challenge-section h2 {
        font-size: 1.5rem;
    }

    .card-footer {
        gap: 0.5rem;
    }

    .card-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat {
        width: 100%;
        padding: 0.75rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 0.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .intro {
        margin: 2rem 0;
    }

    .challenge-card {
        padding: 1rem;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }

    .challenge-section {
        margin: 2rem 0;
    }

    .footer {
        padding: 2rem 0;
        margin-top: 4rem;
        font-size: 0.875rem;
    }

    .footer a {
        padding: 0.25rem 0.5rem;
    }
}

/* Prevent horizontal scroll on small screens */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    * {
        max-width: 100%;
    }

    pre {
        overflow-x: auto;
    }
}

/* Improve tap highlighting */
@media (hover: none) {
    .btn:active,
    .filter-btn:active,
    .card-btn:active {
        transform: scale(0.98);
    }

    .challenge-card:active {
        transform: translateY(-2px);
    }
}
