/* =========================
   Light/Dark Mode Variables
========================= */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --primary-color: #007BFF;
    --secondary-color: #f0f2f5;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --link-hover: #0056b3;
    --highlight-color: #ffcc00;
    --accent-color: #FF0000;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e4e4e4;
    --primary-color: #3399ff;
    --secondary-color: #1e1e1e;
    --card-bg: #1f1f1f;
    --border-color: #444;
    --link-hover: #66b2ff;
    --highlight-color: #ffd633;
    --accent-color: #FF0000;
}

/* =========================
   Global Styles
========================= */
* {
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 15 0 0px;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0 15px;
    text-align: center;
    animation: fadeIn 0.8s ease-in;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background-color: var(--primary-color);
    color: var(--bg-color);
    padding: 8px 14px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
}

.theme-toggle-btn:hover {
    background-color: var(--link-hover);
    transform: scale(1.05);
}


header {
    background-color: var(--primary-color);
    color: var(--bg-color);
    padding: 1rem 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    animation: slideDown 0.6s ease-in-out;
    border-radius: 35px;
}

header h1 {
    margin: 0;
    font-weight: 700;
    font-size: 1.8rem;
}

nav a {
    color: var(--bg-color);
    text-decoration: none;
    margin: 0 8px;
    font-weight: 600;
    position: relative;
}

nav a::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    background: var(--highlight-color);
    transition: width 0.3s;
    position: absolute;
    bottom: -4px;
    left: 0;
}

nav a:hover::after {
    width: 100%;
}

main {
    max-width: 900px;
    margin: 2rem auto;
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    animation: popUp 0.6s ease-in-out;
}

h2 {
    color: var(--primary-color);
    margin-top: 0;
    animation: fadeInUp 0.6s ease-in-out;
}

ul {
    list-style: none;
    padding-left: 0;
    display: inline-block;
    text-align: left;
}

ul li {
    margin: 0.7rem 0;
}

ul li a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
}

ul li a:hover {
    text-decoration: underline;
    color: var(--accent-color);
    transform: translateX(4px);
}

article {
    margin-bottom: 2rem;
    text-align: left;
}

article h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-color);
    font-size: 0.9rem;
    margin-top: 3rem;
    position: relative;
    bottom: 0;
    width: 100%;
    background: var(--secondary-color);
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

/* =========================
   Animations
========================= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes popUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fadeInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================
   Responsive
========================= */
@media (max-width: 600px) {
    main {
        padding: 1rem 1rem;
        margin: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    ul li a {
        font-size: 1rem;
    }
}
/* Subject list container (matching chapters grid) */
/* Subject list container — exact same grid as chapters */
.subject-list {
    display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 1rem;
            max-width: 800px;
            margin: 2rem auto;
}

.subject-card{
    background-color: #f5f5f5;
            padding: 1rem;
            border-radius: 8px;
            text-align: center;
            font-weight: bold;
            box-shadow: 0px 2px 6px rgba(0,0,0,0.1);
            transition: transform 0.2s ease
}

.subject-card:hover {
    transform: translateY(-3px);
    background-color: #eaeaea;
}

/* Subject link — same as chapter link */
.subject-card a {
    text-decoration: none;
            color: #004aad;
}

.subject-list li a:hover {
    color: var(--link-hover);
}
