* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Basic Page Setup */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f6;
    margin: 0;
    padding: 0;
    color: #333;
}

.container,
.chapter-list,
.chapter-card,
.chapter-link,
.group-header,
.group-marks,
h1,
h2,
p,
a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Container */
.container {
    width: 90%;
    max-width: 1000px;
    min-width: 0;
    margin: 50px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
}

img,
video,
iframe,
table {
    max-width: 100%;
}

@media (max-width: 768px) {
    .container {
        width: calc(100% - 16px);
        margin: 20px auto;
    }

    .chapter-card,
    .group-header {
        width: 100%;
    }

    .chapter-card a.chapter-link,
    .back-button a {
        width: 100%;
    }

    .chapter-card:hover,
    .back-button a:hover {
        transform: none;
        box-shadow: none;
    }
}

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

    .group-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .chapter-card a.chapter-link {
        padding: 16px;
        font-size: 17px;
    }
}

/* Header */
.header-container h1 {
    font-size: 36px;
    color: #1a237e;
    margin-bottom: 10px;
    text-align: center;
}

.header-container p {
    font-size: 18px;
    color: #555;
    margin-bottom: 40px;
    text-align: center;
}

/* Chapter Cards */
.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Adds spacing between cards */
    width: 100%;
    align-items: center;
}

.chapter-card {
    width: 85%;
    max-width: 600px;
    background: #fff;
    border-left: 6px solid #1a237e;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.chapter-card a.chapter-link {
    display: block;
    padding: 20px 30px;
    color: #1a237e;
    text-decoration: none;
    font-weight: 600;
    font-size: 20px;
}

.chapter-card:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    background: #e3eaff;
}

/* Biology grouped sections */
.chapter-group {
    width: 100%;
    max-width: 900px;
    margin-bottom: 28px;
    padding: 18px 0 6px;
    border-radius: 14px;
}

.group-header {
    width: 85%;
    max-width: 600px;
    margin: 0 auto 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-header h2 {
    margin: 0;
    font-size: 26px;
}

.group-marks {
    font-size: 14px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
}

.botany-group {
    background: #e8f5e9;
}

.botany-group .group-header h2 {
    color: #1b5e20;
}

.botany-group .group-marks {
    background: #2e7d32;
    color: #fff;
}

.botany-card {
    border-left-color: #2e7d32;
}

.botany-card a.chapter-link {
    color: #1b5e20;
}

.botany-card:hover {
    background: #dff0e2;
}

.zoology-group {
    background: #fff3e0;
}

.zoology-group .group-header h2 {
    color: #e65100;
}

.zoology-group .group-marks {
    background: #ef6c00;
    color: #fff;
}

.zoology-card {
    border-left-color: #ef6c00;
}

.zoology-card a.chapter-link {
    color: #bf360c;
}

.zoology-card:hover {
    background: #ffe8d4;
}

/* Back Button */
.back-button {
    margin: 30px 0;
}

.back-button a {
    display: inline-block;
    background-color: #344a84;
    color: #fff;
    padding: 14px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.3s, transform 0.3s;
}

.back-button a:hover {
    background-color: #46c467;
    transform: translateY(-3px);
}

/* Footer */
.footer {
    margin-top: 50px;
    padding: 30px 20px;
    background: #1a237e;
    color: #fff;
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
}

.footer a {
    color: #fdd835;
    text-decoration: none;
    font-weight: 600;
    margin: 0 8px;
    transition: color 0.2s;
}

.footer a:hover {
    color: #fff;
}


