.materials-header {
    max-width: 1200px;
    margin: 3rem auto 2rem;
    padding: 0 2rem;
    text-align: center;
}

.materials-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.materials-header p {
    font-size: 1.2rem;
    color: var(--gray);
}

.materials-container {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.material-category {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.category-header {
    margin-bottom: 2rem;
}

.category-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.category-header p {
    color: var(--gray);
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.topic-card {
    background: linear-gradient(135deg, var(--light-pink) 0%, var(--light-yellow) 100%);
    padding: 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--pink);
}

.topic-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.topic-card p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s;
}

.close {
    color: var(--gray);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--pink);
}

#topicContent h2 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 2rem;
}

#topicContent h3 {
    color: var(--pink);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

#topicContent p {
    color: var(--gray);
    line-height: 1.8;
    margin-bottom: 1rem;
}

#topicContent ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

#topicContent li {
    color: var(--gray);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.example-box {
    background: var(--light-pink);
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    border-left: 4px solid var(--pink);
}

.example-box strong {
    color: var(--dark);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .materials-header h1 {
        font-size: 2rem;
    }

    .topics-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }
}
