/* My Calendar Styles */
.calendar-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.calendar-header {
    text-align: center;
    margin-bottom: 2rem;
}

.calendar-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #202124;
    margin-bottom: 0.5rem;
}

.calendar-header p {
    font-size: 1.1rem;
    color: #5f6368;
}

.calendar-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.calendar-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.calendar-zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #dadce0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #dadce0;
    background: white;
    color: #202124;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.zoom-level {
    font-weight: 600;
    color: #5f6368;
    min-width: 50px;
    text-align: center;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #5f6368;
    border: 1px solid #dadce0;
}

.btn-secondary:hover {
    background: #e8eaed;
}

/* Weekly Calendar Grid */
.weekly-calendar {
    display: grid;
    grid-template-columns: 80px repeat(6, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.time-column {
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.time-header {
    height: 60px;
    background: #1a73e8;
    border-bottom: 1px solid #e0e0e0;
}

.time-slot {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #5f6368;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.time-slot-half {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 400;
    color: #9aa0a6;
    background: white;
    border-bottom: 1px dashed #e8eaed;
}

.day-column {
    display: flex;
    flex-direction: column;
    background: white;
    flex: 1;
    /* Make columns expand to fill available space */
}

.day-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    background: #1a73e8;
    border-bottom: 1px solid #e0e0e0;
}

.day-slots {
    position: relative;
    height: 1260px;
    /* 14 hours * 60px + 14 half-hour slots * 30px (8am-10pm) */
    background: white;
    /* Horizontal grid lines matching time slots */
    background-image:
        repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 59px,
            #d0d0d0 59px,
            #d0d0d0 60px,
            transparent 60px,
            transparent 89px,
            #e8eaed 89px,
            #e8eaed 90px);
}

/* Class Card in Calendar */
.class-card {
    position: absolute;
    left: 2px;
    right: 2px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    /* Height set dynamically by JS based on class duration */
}

.class-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 100;
}

.class-card-content {
    color: white;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.class-card-professor {
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.class-card-course {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.95;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.class-card-room {
    font-size: 0.7rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.class-card-building {
    font-size: 0.7rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-weight: 500;
}

.class-card-time {
    font-size: 0.7rem;
    opacity: 0.85;
    margin-top: 2px;
}

.class-card-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.class-card:hover .class-card-delete {
    display: flex;
}

.class-card-delete:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.1);
}

/* Autocomplete Dropdown Styles */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.autocomplete-item:hover {
    background: #f8f9fa;
}

.autocomplete-name {
    font-weight: 600;
    color: #202124;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.autocomplete-details {
    font-size: 0.85rem;
    color: #5f6368;
}

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

.modal-content.calendar-modal {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #202124;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #5f6368;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #202124;
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #202124;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.time-slot-row {
    position: relative;
    padding: 1rem;
    border: 2px dashed #dadce0;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.time-slot-row .btn-remove-slot {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ea4335;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.time-slot-row .btn-remove-slot:hover {
    background: #d33426;
    transform: scale(1.1);
}

.btn-add-timeslot {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 2px dashed #1a73e8;
    border-radius: 8px;
    color: #1a73e8;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-timeslot:hover {
    background: #e8f0fe;
    border-color: #1557b0;
}

.color-picker {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.color-picker input[type="radio"] {
    display: none;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid transparent;
    display: block;
}

.color-picker input[type="radio"]:checked+.color-option {
    border-color: #202124;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .weekly-calendar {
        grid-template-columns: 60px repeat(7, 1fr);
    }

    .time-slot {
        font-size: 0.75rem;
    }

    .day-header {
        font-size: 0.875rem;
    }

    .class-card {
        padding: 6px;
    }

    .class-card-professor {
        font-size: 0.75rem;
    }

    .class-card-course {
        font-size: 0.7rem;
    }

    .class-card-room {
        font-size: 0.65rem;
    }
}

@media (max-width: 768px) {
    .calendar-main {
        padding: 1rem 0;
    }

    .calendar-header h1 {
        font-size: 1.75rem;
    }

    .calendar-header p {
        font-size: 0.95rem;
    }

    .calendar-container {
        padding: 1rem;
        margin: 0 0.5rem 1rem;
        border-radius: 12px;
    }

    .calendar-toolbar {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .calendar-zoom-controls {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .add-class-btn {
        order: 1;
        width: 100%;
    }

    .weekly-calendar {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        background: transparent;
        border: none;
        border-radius: 0;
    }

    .time-column {
        display: none;
    }

    .day-column {
        border: 2px solid #e0e0e0;
        border-radius: 12px;
        overflow: hidden;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .day-header {
        padding: 12px;
        font-size: 1rem;
        font-weight: 700;
        background: #1a73e8;
        color: white;
        text-align: center;
    }

    .day-slots {
        height: auto;
        min-height: 150px;
        padding: 12px;
        background: #fafafa;
    }

    .class-card {
        position: static !important;
        margin-bottom: 10px;
        height: auto !important;
        min-height: 100px;
        padding: 12px;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .class-card:last-child {
        margin-bottom: 0;
    }

    .class-card-content {
        gap: 6px;
    }

    .class-card-professor {
        font-size: 1rem;
        font-weight: 700;
    }

    .class-card-course {
        font-size: 0.9rem;
        font-weight: 600;
    }

    .class-card-room,
    .class-card-building {
        font-size: 0.85rem;
    }

    .class-card-time {
        font-weight: 700;
        margin-top: 6px;
        opacity: 1;
        font-size: 0.9rem;
        background: rgba(255, 255, 255, 0.3);
        padding: 4px 8px;
        border-radius: 4px;
        display: inline-block;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content.calendar-modal {
        width: 95%;
        max-width: 95%;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }
}

/* Empty state */
.empty-calendar-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #5f6368;
}

.empty-calendar-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #202124;
}

.empty-calendar-state p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}