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

header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.author {
    font-family: 'Glacial Indifference', sans-serif;
    font-size: 1.1rem;
    color: #666;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4a9eff;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    transition: gap 0.3s;
}

.back-link:hover {
    gap: 12px;
}

.controls {
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-container {
    flex: 1;
    min-width: 250px;
}

#searchBar {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#searchBar:focus {
    outline: none;
    border-color: #4a9eff;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    transform: translateY(-4px);
}

.filter-btn.active {
    color: white;
}

.filter-btn.all.active {
    background: #4a9eff;
    border-color: #4a9eff;
}

.filter-btn.beginner.active {
    background: #00b87a;
    border-color: #00b87a;
}

.filter-btn.novice.active {
    background: #ffc01e;
    border-color: #ffc01e;
}

.filter-btn.advanced.active {
    background: #ef476f;
    border-color: #ef476f;
}

.filter-btn.expert.active {
    background: #9b59b6;
    border-color: #9b59b6;
}

.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.challenge-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    display: block;
}

.challenge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.challenge-card.beginner {
    border: 3px solid #00b87a;
}

.challenge-card.novice {
    border: 3px solid #ffc01e;
}

.challenge-card.advanced {
    border: 3px solid #ef476f;
}

.challenge-card.expert {
    border: 3px solid #9b59b6;
}

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

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.challenge-name {
    font-family: 'Glacial Indifference', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.difficulty {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.difficulty.beginner {
    background: rgba(0, 184, 122, 0.25);
    color: #00b87a;
}

.difficulty.novice {
    background: rgba(255, 192, 30, 0.25);
    color: #d9a000;
}

.difficulty.advanced {
    background: rgba(239, 71, 111, 0.25);
    color: #ef476f;
}

.difficulty.expert {
    background: rgba(155, 89, 182, 0.25);
    color: #9b59b6;
}

.challenge-description {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
    grid-column: 1 / -1;
    display: none;
}

.no-results.show {
    display: block;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
}

.challenge-detail {
    display: none;
}

.challenge-detail.active {
    display: block;
}

.detail-header {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.detail-header.beginner {
    border: 4px solid #00b87a;
}

.detail-header.novice {
    border: 4px solid #ffc01e;
}

.detail-header.advanced {
    border: 4px solid #ef476f;
}

.detail-header.expert {
    border: 4px solid #9b59b6;
}

.detail-title {
    font-family: 'Glacial Indifference', sans-serif;
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.detail-difficulty {
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

.detail-difficulty.beginner {
    background: rgba(0, 184, 122, 0.25);
    color: #00b87a;
}

.detail-difficulty.novice {
    background: rgba(255, 192, 30, 0.25);
    color: #d9a000;
}

.detail-difficulty.advanced {
    background: rgba(239, 71, 111, 0.25);
    color: #ef476f;
}

.detail-difficulty.expert {
    background: rgba(155, 89, 182, 0.25);
    color: #9b59b6;
}

.detail-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section {
    margin-bottom: 40px;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-family: 'Glacial Indifference', sans-serif;
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 15px;
    font-weight: 600;
}

.section-content {
    color: #666;
    line-height: 1.8;
    font-size: 1.05rem;
}

.code-block {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    overflow-x: auto;
    margin: 15px 0;
    white-space: pre-wrap;
}

.hint-box {
    background: #fff9e6;
    border-left: 4px solid #ffc01e;
    padding: 20px;
    border-radius: 4px;
    margin: 15px 0;
}

.hint-title {
    font-weight: 600;
    color: #d9a000;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.requirements-list {
    list-style: none;
    padding: 0;
}

.requirements-list li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    font-size: 1.05rem;
    color: #666;
}

.requirements-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #00b87a;
    font-weight: bold;
    font-size: 1.2rem;
}

.resource-link {
    color: #4a9eff;
    text-decoration: none;
    display: block;
    margin: 10px 0;
    font-size: 1.05rem;
}

.resource-link:hover {
    text-decoration: underline;
}

.detail-complete-btn {
    background: #abe7b9;
    color: #198933;
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-bottom: 10px;
}

.detail-complete-btn:hover {
    background: #9de4ae;
}