/* Responsive Grid Layout: 1-3 columns (see @media)
• Course Card Design: Simple and clean
• Color-Coded Enrollment: red/orange/green
• Interactive Elements: some hover and active effects
• Modal Design: Good enough
• Accessibility: passing grade
• Typography: readable
• Mobile Optimization: good enough */

.body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f9f9f9;
}
.header {
    display: flex;
    padding: 10px;
    border-bottom: 2px solid #ccc;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* search field and buttons */
.controls {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 2px solid #999;
    border-radius: 5px;
}
.controls label {
    display: block;
    font-weight: bold;
}
.controls input {    
    width: 85%;
    padding: 5px;    
    border: 1px solid #ccc;
    border-radius: 5px;
}
.search-section {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}
.filter-section {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}
.action-section {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

/* stats field */
.statistics {
    display: grid;
    gap: 10px;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid #999;
    border-radius: 5px;
    width: 50%;
}
.stat-item {
    display: flex;
    justify-content: space-between;
}
.stat-item label {
    font-weight: bold;
}
.stat-number {
    font-size: 1.2em;
    color: #333;
}
.stat-label {
    font-size: 0.9em;
    color: #666;
}

/* course cards */
.courses-grid {
    display: grid;
    gap: 10px;
    padding: 10px;
}
.course-card {
    border: 2px solid #ccc;
    border-radius: 20px;
    padding: 10px;
}
.course-card h3 {
    margin: 0 0 10px 0;
}
.course-card p {
    margin: 5px 0;
}
.course-card .actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.course-code {
    font-size: 0.9em;
    color: #555;
}
.credits {
    font-size: 0.9em;
    color: #555;
}
.course-title {
    margin: 5px 0;
    font-size: 1.2em;
    font-weight: bold;
}
.course-description {
    font-size: 0.9em;
    color: #666;
}
.instructor-info {
    font-size: 0.9em;
    color: #333;
}
.schedule-info {
    font-size: 0.9em;
    color: #333;
}
.enrollment-info {
    font-size: 0.9em;
    color: #333;
}
.full {
    color: red;
    font-weight: bold;
}
.filling {
    color: orange;
    font-weight: bold;
}
.open {
    color: green;
    font-weight: bold;
}
.topics {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.topic-tag {
    background-color: #eee;
    padding: 5px 10px;
    margin-top: 5px;
    border-radius: 15px;
    font-size: 0.8em;
    color: #333;
}
.details-btn {
    padding: 5px 10px;
    margin-top: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}


.form {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 2px solid #999;
    border-radius: 5px;
}

.required {
    color: red;
} 

.hidden {
    display: none;
}

.modal {
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; /*hidden initally, toggle to 'flex'*/
    justify-content: center;

    /*don't chop off content*/
    align-items: flex-start; 
    overflow: auto; 
}
.modal-content {
    background-color: #fff;

    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 1.5em;
    font-weight: bold;
}
.modal-close {    
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
}
.modal-body {
    display: grid;
    gap: 10px;
}
.modal-body p {
    margin: 5px 0;
}
.close-btn {
  color: #111;
  float: right; /*keep top right corner*/
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}
.close-btn:hover {
  color: #555;
}
.close-btn:active {
  transform: scale(0.9);
}
.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.modal-btn:hover {
    background-color: #eee;
}
.modal-btn:active {
    transform: scale(0.95);
}

/* for mobile, or half window */
@media (min-width: 600px) {
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
} 
@media (min-width: 900px) {
    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
