:root {
    --primary: #1e3799;
    --secondary: #4a69bd;
    --bg-color: #f5f6fa;
    --text-color: #2f3542;
    --card-bg: #ffffff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: var(--primary);
    color: white;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.controls {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 500px;
}

#searchBar {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    outline: none;
}

#langToggle {
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#langToggle:hover {
    background-color: #6a89cc;
}

main {
    padding: 2rem 5%;
    max-width: 900px;
    margin: 0 auto;
}

.module-card {
    background-color: var(--card-bg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.module-card h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.module-card p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    .controls {
        width: 100%;
        max-width: 100%;
    }
}
/* --- NEW ADDITIONS FOR GRID LAYOUT & BETTER ARRANGEMENT --- */
#contentArea {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.module-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%; /* Ensures cards stretch equally */
    border-top: 4px solid var(--secondary); /* Adds a nice color accent */
}

.module-card h2 {
    font-size: 1.3rem;
    line-height: 1.4;
}

.module-card p {
    flex-grow: 1; /* Pushes any footer/bottom content down if added later */
    color: #57606f; /* Slightly softer text color for readability */
}
/* --- NEW ADDITIONS FOR TOP MENU --- */
.top-menu {
    background-color: var(--card-bg);
    padding: 0.5rem 5%;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 70px; /* Keeps it right below the main header */
    z-index: 999;
}

/* Hide scrollbar for cleaner look on mobile */
.top-menu::-webkit-scrollbar {
    display: none;
}

.menu-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: bold;
    color: #57606f;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.menu-btn:hover, .menu-btn.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}