:root {
    --primary: #212529;
    --secondary: #717171;
    --accent: #87eaff;
    --light: #f5f9ff;
    --dark: #333;
    --border: #ddd;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

header {
    background-color: var(--primary);
    color: white;
    padding: 2rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-container {
    max-width: 600px;
    margin: 1rem auto;
}

#searchInput {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
}

.filters {
    background-color: white;
    padding: 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.filter-btn {
    background-color: white;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--secondary);
    color: white;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.semester-section {
    margin-bottom: 2rem;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.semester-header {
    background-color: var(--primary);
    color: white;
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.semester-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
}

.course-card {
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.course-header {
    color: white;
    padding: 1rem;
    cursor: pointer;
}

.course-header h3 {
    margin: 0;
    display: flex;
    justify-content: space-between;
}

.course-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
}

.course-content.active {
    padding: 1.5rem;
    max-height: 2000px;
}

.review-section {
    margin-bottom: 1.5rem;
}

.review-section h4 {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.english-text,
.chinese-text {
    margin-bottom: 0.75rem;
    white-space: pre-line;
}

.chinese-text {
    font-size: 0.95rem;
}

.no-results {
    text-align: center;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    margin-top: 2rem;
    display: none;
}

.grade {
    background-color: var(--accent);
    color: black;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    font-weight: bold;
    height: 2rem;
}

@media (max-width: 768px) {
    .semester-content {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Add these styles to your existing styles.css */

.content-container {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
}

#courseContainer {
    flex: 1;
}

.review-container {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    position: sticky;
    top: 100px; /* Adjust based on your header height */
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    height: 70vh;
}

.initial-message {
    text-align: center;
    color: #999;
    padding: 2rem;
}

/* Make the course cards show that they're clickable */
.course-header {
    cursor: pointer;
}

/* Add responsive styles for mobile */
@media (max-width: 768px) {
    .content-container {
        flex-direction: column;
    }

    .review-container {
        position: static;
        max-height: none;
    }
}

/* Make the entire course card clickable */
.course-card {
    cursor: pointer;
}

/* Add a loading indicator */
.htmx-request .review-container {
    opacity: 0.7;
    position: relative;
}

.htmx-request .review-container::after {
    content: "Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    border-radius: 4px;
}

.review-section > div {
    padding-bottom: 1rem;
}

.major-course {
    background-color: var(--primary);
}

.cc-course {
    background-color: var(--secondary);
}
