/* Layout Components */
.page-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: #fcfaf6;
    font-family: 'Segoe UI', sans-serif;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    transition: all 0.3s ease-in-out;
    margin-right: 0;
    width: 100%;
}

.main-content.shifted {
    margin-right: calc(45% + 120px);
}

h1, h2 {
    margin: 0;
    color: #311a4d;
}

p {
    line-height: 1.5;
}

.nav-link {
    margin: 0 0 4px 12px;
    padding: 5px 15px;
    background-color: #3b1f5c;
    border-radius: 20px;
    color: #ffffff;
    text-decoration: none;
}

.home-link {
    margin: 20px auto;
}

/* About Page Styles */
#about {
    padding: 40px 15%;
    background: #fcfaf6;
    font-family: 'Segoe UI', sans-serif;
}


#about h1 {
    margin: 0 auto;
    text-align: center;
}

#about h2 {
    margin: 0 auto 20px auto;
    text-align: center;
}

#about-intro {
    margin: 40px 0;
}

#about-intro p {
    margin-bottom: 1.5em;
}

#about-intro p:last-child {
    margin-bottom: 0;
}

#about-team {
    margin: 80px auto;
}

#team-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.team-card {
    width: calc(33.33% - 40px);
    min-width: 200px;
    margin: 10px 0;
    border-radius: 10px;
}

.team-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

.team-role {
    margin-top: 10px;
    font-size: 1rem;
    text-align: center;
}

#contributions {
    text-align: center;
    margin: 30px 0;
}

#contributions a {
    color: #ffffff;
    text-decoration: underline;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #3b1f5c;
    border: 1px solid #3b1f5c;
    transition: all 0.2s ease;
}

#contributions a:hover {
    background-color: #3b1f5c;
    color: white;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.team-img {
    display: block;
    margin: 0 auto 20px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 1024px) {
    #team-cards {
        flex-wrap: wrap;
    }

    .team-card {
        flex-basis: 50%;
        box-sizing: border-box;
        margin: 30px 0;
    }

    .team-img {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 640px) {
    #team-cards {
        flex-wrap: wrap;
    }

    .team-card {
        flex-basis: 100%;
        box-sizing: border-box;
    }

    .team-img {
        width: 180px;
        height: 180px;
    }

    #contributions {
        font-size: 14px;
    }
}

/* Course Grid */
.course-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    padding: 20px;
    transition: all 0.3s ease-in-out;
}

.course-container.fade-in {
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
}

.course-container.hidden {
    opacity: 0;
    transition: opacity 0.1s ease-in-out;
}

.course-container.shifted {
    grid-template-columns: 1fr;  /* Force single column */
    opacity: 1;
    width: 100%;
    margin-right: 45%;
}

.course-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease;
    display: block;
    opacity: 1;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.course-card.active {
    background-color: #f5f0fa;
}

.course-card.hidden {
    display: none;
}

/* Course Card Content */
.course-card-columns {
    display: flex;
    gap: 20px;
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.course-card-left {
    display: flex;
    flex: 0 0 15%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto;
    background-color: #d4c9e5;
    border-radius: 15px 0 0 15px;
    border-right: 1px solid #eee;
}

.course-card .course-code {
    margin: 0;
    color: #3e3636;
    font-size: 14px;
    font-weight: 600;
    font-style: italic;
    line-height: 1.5;
    text-align: center;
}

.course-card-right {
    flex: 1;
    padding: 18px 20px 20px 12px;
    min-width: 0;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.course-divisions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
}

.course-header .cart-button {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 24px;
    height: 24px;
    white-space: nowrap;
    align-self: center;
    border-radius: 50%;
}

.cart-button i {
    font-size: 12px;
    line-height: 1;
}

.course-card .course-name {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 10px 0;
    max-width: 45ch;
    font-size: 18px;
}

.course-card p {
    margin: 0;
    font-size: 14px;
    color: #4c4e5a;
}

.course-card .course-description {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 60ch;
}

.division-tag {
    background: #cccccc;
    border-radius: 50px;
    color: #fff;
    margin: 0 2px;
    padding: 2px 10px;
    text-align: center;
}

.division-tag[course-division="Humanities"] {
    background-color: #ebe0d9;
    color: #65544f;
}

.division-tag[course-division="Science & Mathematics"] {
    background-color: #ddedea;
    color: #008080;
}

.division-tag[course-division="Social Sciences"] {
    background-color: #e4d9eb;
    color: #5f4d73;
}

.division-tag[course-division="Arts"] {
    background-color: #f9e1dc;
    color: #7e4a4d;
}

/* Side Panel Styles */
.side-panel {
    position: fixed;
    top: 0;
    right: -45%;
    height: 100vh;
    max-height: 100vh;
    width: 45%;
    padding: 30px 40px 100px 40px;
    background: #fff;
    border-left: 1px solid #ddd;
    overflow-y: auto;
    transition: all 0.3s ease-in-out;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
}

.side-panel.open {
    right: 0;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.side-panel.closing {
    transition: all 0.5s ease-in-out;
    transform: translateX(100%);
    opacity: 0;
}

.panel-links i {
    font-size: 15px;
    margin-right: 2px;
}

.panel-content {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.panel-details h2 {
    font-size: 20px;
    margin-bottom: 20px;
    overflow: visible;
}

.sections-container {
    max-height: none; /* Remove any max-height limitation */
    overflow: visible; /* Ensure content isn't cut off */
    padding-bottom: 20px; /* Add some padding at the bottom */
}

.section-card {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8f5fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: visible; /* Ensure content isn't cut off */
}

.section-card:last-child {
    margin-bottom: 50px; /* Add space after last section card */
}

.meeting-times {
    display: block;
    width: 100%;
    margin-top: 10px;
    overflow: visible; /* Ensure content isn't cut off */
}



/* Cart Panel Specific */
.cart-panel {
    padding: 20px;
    z-index: 1000;
}

.cart-items-container {
    margin: 15px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
}

.cart-item-name {
    flex: 1;
    margin-right: 10px;
}

#cart-total {
    margin-top: 20px;
    font-weight: bold;
    border-top: 2px solid #eee;
    padding-top: 10px;
}

/* Buttons */
.button, .cart-button, .dropbtn, .search-dropdown {
    background-color: #4a0099;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.close-panel {
    position: absolute;
    left: 10px;
    top: 10px;
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
}

.remove-from-cart {
    background-color: #ff4444;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.remove-from-cart:hover {
    background-color: #cc0000;
}

.cart-toggle-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: #4a0099;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: block;
}

.in-cart {
    background-color: #874ec4;
}

/* Search Components */
.search-container {
    display: flex;
    margin-bottom: 20px;
    align-items: center;
    max-width: 800px;
    margin: 0 auto 20px;
}

.search-container form {
    display: flex;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
}

.search-button {
    padding: 10px 20px;
    background-color: #9556b0;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #7b4491;
}

#search-loading {
    margin-left: 10px;
    color: #9556b0;
}

.search-input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 5px rgba(74,144,226,0.3);
}

/* Dropdown Components */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #f9f9f9;
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 12px;
    white-space: nowrap;
    border-bottom: 1px solid #eee;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

/* Utility Classes */
.standard-paragraph {
    font-size: 16px;
    line-height: 1.5;
    margin: 20px;
}

/* Panel Toggle States */
.side-panel.open ~ .cart-toggle-button,
.cart-panel.open ~ .cart-toggle-button {
    display: none;
}

.no-results-message {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #666;
    width: 100%;
    margin-top: 2rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.cart-calendar-container {
    margin-top: 20px;
    width: 100%;
    display: grid;
    grid-template-columns: 45px repeat(5, 1fr);
    gap: 1px;
    background: #eee;
    border: 1px solid #ddd;
}

.cart-calendar-container .corner-cell,
.cart-calendar-container .day-header {
    background: #f8f9fa;
    padding: 5px;
    text-align: center;
    font-size: 0.8em;
    font-weight: bold;
}

.cart-calendar-container .time-column {
    background: #f8f9fa;
    padding: 3px;
    text-align: right;
    font-size: 0.7em;
    color: #666;
}

.cart-calendar-container .time-slot {
    background: white;
    border: 1px solid #eee;
    height: 60px;
    position: relative;
    min-width: 80px;
}

.cart-calendar-container .course-block {
    position: absolute;
    background: #e1d7f1;
    padding: 3px;
    border-radius: 3px;
    font-size: 0.6em;
    z-index: 1;
    box-sizing: border-box;
    overflow: hidden;
}

/* Hover effect to improve readability */
.cart-calendar-container .course-block:hover {
    z-index: 10;
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

/* Different colors for different courses */
.cart-calendar-container .course-block:nth-of-type(1) {
    background-color: #e1d7f1;
}

.cart-calendar-container .course-block:nth-of-type(2) {
    background-color: #d1e7f7;
}

.cart-calendar-container .course-block:nth-of-type(3) {
    background-color: #fde2d4;
}

.cart-calendar-container .course-block:nth-of-type(4) {
    background-color: #f7d1e3;
}

/* Ensure text is readable even when blocks are narrow */
.cart-calendar-container .course-block .course-acronyms {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-calendar-container .course-block .course-time,
.cart-calendar-container .course-block .course-location {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-text {
    display: block;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: 90%;
    font-size: 12px;
    color: #894ead;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Even more cart styling */
.cart-courses-simple-list {
    padding: 0;
}

.cart-course-card {
    margin-bottom: 20px;
    border-radius: 5%;
}

.cart-course-card .course-card-left .course-code {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.cart-course-card .course-card-left .course-code div {
    margin: 2px 0;
    line-height: 1.2;
    font-size: 12px;
    font-weight: bold;
}

.cart-course-card .course-name {
    margin-bottom: 0;
}

.remove-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0 20px;
    font-size: 16px;
    transition: color 0.2s ease;
}

/* Time conflict styling */
.course-card.time-conflict .course-card-left{
    background-color: #ff817a;
}

.course-card.time-warning .course-card-left{
    background-color: rgb(255, 176, 91);
}

/* Selecting sections */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 8% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;

    max-height: 70vh;
    overflow-y: auto;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.section-item {
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.section-item.section-conflict {
    border: 2px solid #ff817a !important;
    background-color: rgba(255,0,0,0.07) !important;
}

.section-item.section-in-cart {
    border: 2px solid #874ec4;
    background-color: rgba(135, 78, 196, 0.1);
}

.section-item:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.cart-badge {
    color: white;
    background-color: #874ec4;
    font-weight:bold;
    padding: 2px 5px;
    font-size: 12px;
    border-radius: 3px;
}

.conflict-badge {
    color: white;
    background-color: #ff0000;
    font-weight:bold;
    padding: 2px 5px;
    font-size: 12px;
    border-radius: 3px;
}

.warning-badge {
    color: white;
    background-color: rgb(255, 243, 73);
    font-weight:bold;
    padding: 2px 5px;
    font-size: 12px;
    border-radius: 3px;
}

.section-header {
    font-weight: bold
}

.conflict-loading {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-btn:hover:not(:disabled) {
    background-color: #f0f0f0;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9rem;
    color: #666;
}