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

body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 340px;
    background-color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #eee;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: #4285F4;
    margin-bottom: 20px;
}

.create-btn {
    background-color: #4285F4;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}

.create-btn:hover {
    background-color: #3b78e7;
}

.plus {
    font-size: 18px;
    margin-right: 8px;
}

/* Mini Calendar Styles */
.mini-calendar {
    margin-bottom: 25px;
}

.month-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.month-year {
    font-size: 15px;
    font-weight: 500;
}

.nav-arrows {
    display: flex;
    gap: 10px;
}

.arrow {
    cursor: pointer;
    color: #666;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
}

.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: 4px;
}

.days div {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.days div:hover:not(:empty) {
    background-color: #eef3ff;
}

.days div.today {
    background-color: #4285F4;
    color: white;
    font-weight: bold;
}

/* Calendar List Styles */
.calendar-list {
    flex-grow: 1;
    overflow-y: auto;
    margin-top: 20px;
}

.calendar-list h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 500;
    text-align: center;
}

/* Card style to match instructor page */
.class-item {
    background: #f8f9fc;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #4285f4;

    display: flex;
    flex-direction: column;
    gap: 2px;

    white-space: normal;
    word-break: break-word;
    line-height: 1.3;

    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.class-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

/* Text lines inside the card */
.class-code {
    font-weight: 700;
    font-size: 14px;
}

.class-title {
    font-size: 13px;
}

.class-sched {
    font-size: 12px;
    color: #555;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
}

.header {
    margin-bottom: 20px;
}

.nav-tools {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* Share / Student / Teacher buttons */
#share-schedule,
#student-link.header-link,
.teachers-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #4285F4;
    color: #ffffff !important;
    border: none;
    border-radius: 24px;
    padding: 8px 15px;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    margin-left: 20px;
}

#share-schedule:hover,
#student-link.header-link:hover,
.teachers-link:hover {
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.2),
        0 6px 20px rgba(0, 0, 0, 0.19);
}

.navigation {
    display: flex;
    margin-right: 15px;
}

.navigation button {
    background: none;
    border: 1px solid #ddd;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navigation button:first-child {
    border-radius: 4px 0 0 4px;
}

.navigation button:last-child {
    border-radius: 0 4px 4px 0;
}

#today-btn {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 16px;
    margin-right: 15px;
    cursor: pointer;
    font-size: 14px;
}

#current-month-year {
    font-size: 18px;
    font-weight: 500;
}

/* Tabs Styles */
.tabs-container {
    border-bottom: 1px solid #ddd;
}

.tabs {
    display: flex;
    list-style: none;
}

.tab {
    padding: 8px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab.active {
    border-bottom-color: #4285F4;
    color: #4285F4;
}

.add-tab {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #777;
    font-size: 16px;
}

.close-tab {
    font-size: 16px;
    margin-left: 8px;
    color: #999;
    cursor: pointer;
}

.close-tab:hover {
    color: #d32f2f;
}

/* Calendar Tab Styles */
.calendar-tab {
    display: none;
    height: 100%;
}

.calendar-tab.active {
    display: block;
}

/* Calendar Styles */
.calendar {
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

/* Weekday header aligned with time column */
.weekdays-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    background-color: white;
    border-bottom: 1px solid #eee;
    border-radius: 8px 8px 0 0;
    overflow: hidden;

    /* 75px for time column + a bit (~15px) for scrollbar */
    margin-left: 75px;
    width: calc(100% - 90px) !important;
}

.weekday {
    padding: 15px;
    border-right: 1px solid #eee;
}

.weekday:last-child {
    border-right: none;
}

.day-name {
    font-size: 14px;
    color: #666;
}

.day-number {
    font-size: 16px;
    font-weight: 500;
    margin-top: 5px;
}

.day-number.today {
    background-color: #4285F4;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px auto 0;
}

.week-view-wrapper {
    display: flex;
    flex: 1;
    background-color: white;
    border-radius: 0 0 8px 8px;
    overflow: auto;
}

.time-indicators {
    width: 75px;
    flex: 0 0 75px; /* fixed time column */
    padding-top: 0;
    border-right: 1px solid #eee;
}

.time-indicator {
    color: #999;
    font-size: 12px;
    text-align: center;
    height: 60px; /* 60px per hour */
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* MAIN GRID – student & teacher pages both use these */
.week-view {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    position: relative;
}

.day-column {
    position: relative;
    border-right: 1px solid #e5e5e5; /* vertical lines between days */
    height: 960px; /* 6 AM – 10 PM (16 hours × 60px) */
    background: transparent;
}

.day-column:last-child {
    border-right: none;
}

.hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e5e5e5; /* horizontal hour lines */
}

/* Event blocks */
.event {
    position: absolute;
    left: 5%;
    width: 90%;
    background-color: #4285F4;
    color: white;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    z-index: 2;
    overflow: hidden;
    font-size: 13px;
    min-height: 28px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.event-title {
    font-weight: bold;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.event-details {
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.edit-course-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.event:hover .edit-course-btn {
    opacity: 1;
}

.edit-icon {
    font-size: 12px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    margin: 0 auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalFadeIn 0.3s;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

#modal-title {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="time"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-size: 13px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 5px;
}

.error {
    color: #d32f2f;
    margin-top: 10px;
    font-size: 14px;
    display: none;
}

.error.show {
    display: block;
}

.button-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

#cancel-btn {
    background-color: transparent;
    border: 1px solid #ddd;
    color: #555;
}

#submit-btn {
    background-color: #4285F4;
    color: white;
}

#delete-btn {
    background-color: #d32f2f;
    color: white;
}

.button-group button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
}

/* Search Container Styles */
.search-container {
    margin-bottom: 15px;
    position: relative;
}

#class-search {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

#class-search:focus {
    border-color: #4285F4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.search-results {
    position: absolute;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 5px;
}

.search-result-item {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f5f9ff;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-course {
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 14px;
    color: #333;
}

.result-details {
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    color: #666;
}

.result-details span {
    margin-right: 12px;
    margin-bottom: 3px;
}

.loading, .no-results {
    padding: 15px;
    text-align: center;
    color: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px;
    }

    .main-content {
        padding: 15px;
    }

    .weekdays-header {
        overflow-x: auto;
    }
}

