/* Schedule Planner Styles */

/* Color Options for Events */
.color-option {
    width: 40px;
    height: 40px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
}

.color-option:hover {
    border-color: #0d6efd;
}

.btn-check:checked + .color-option {
    border-color: #0d6efd;
    border-width: 3px;
}

/* Schedule Grid Container */
.schedule-grid-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 800px;
}

/* Schedule Grid Table */
.schedule-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 900px;
    background: white;
}

.schedule-grid th,
.schedule-grid td {
    border: 1px solid #dee2e6;
    padding: 0;
    text-align: center;
    vertical-align: top;
    position: relative;
}

/* Time Column */
.schedule-grid .time-col {
    width: 80px;
    min-width: 80px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6c757d;
    background: #f8f9fa;
    position: sticky;
    left: 0;
    z-index: 10;
}

/* Day Headers */
.schedule-grid thead th {
    background: #0d6efd;
    color: white;
    font-weight: 600;
    padding: 12px 8px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.schedule-grid thead th.time-col {
    background: #0a4fb3;
    z-index: 30;
}

/* Day Columns */
.schedule-grid .day-col {
    width: calc((100% - 80px) / 6);
    min-width: 120px;
}

/* Time Slots */
.schedule-grid .time-slot {
    height: 60px;
    position: relative;
    background: white;
}

.schedule-grid .time-slot:hover {
    background: #f8f9fa;
}

/* Schedule Items (Classes and Events) */
.schedule-item {
    position: absolute;
    left: 2px;
    right: 2px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1.3;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    z-index: 5;
}

.schedule-item:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 15;
}

/* Class Items - Campus Colors */
.schedule-item.class-item {
    color: white;
    font-weight: 500;
}

.schedule-item.class-item.campus-city {
    background: linear-gradient(135deg, #be1e2d 0%, #d63849 100%);
}

.schedule-item.class-item.campus-mesa {
    background: linear-gradient(135deg, #0054a4 0%, #1a6bbf 100%);
}

.schedule-item.class-item.campus-mira {
    background: linear-gradient(135deg, #1e9097 0%, #2ab0b8 100%);
}

.schedule-item.class-item.campus-online {
    background: linear-gradient(135deg, #6c757d 0%, #858d96 100%);
}

/* Event Items */
.schedule-item.event-item {
    background: #6c757d;
    color: white;
    border-left: 4px solid rgba(0,0,0,0.2);
}

/* Conflict Warning */
.schedule-item.has-conflict {
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* Close Button on Schedule Items */
.schedule-item-close {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    padding: 0;
    z-index: 10;
}

.schedule-item:hover .schedule-item-close {
    opacity: 1;
}

.schedule-item-close:hover {
    background: rgba(220, 53, 69, 0.9);
}

.conflict-icon {
    position: absolute;
    top: 2px;
    right: 24px;
    color: #dc3545;
    background: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Item Content */
.schedule-item-title {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-item-time {
    font-size: 0.7rem;
    opacity: 0.9;
}

.schedule-item-campus {
    font-size: 0.65rem;
    opacity: 0.85;
    margin-top: 2px;
}

/* Selected Items Lists */
.selected-items-list {
    max-height: 400px;
    overflow-y: auto;
}

.selected-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: white;
    transition: all 0.2s;
}

.selected-item:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.selected-item.has-conflict {
    border-color: #dc3545;
    background: #fff5f5;
}

.selected-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.selected-item-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.selected-item-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
}

.selected-item-details {
    font-size: 0.875rem;
    color: #495057;
}

.selected-item-actions {
    display: flex;
    gap: 4px;
}

.selected-item-actions .btn {
    padding: 2px 8px;
    font-size: 0.75rem;
}

/* Campus Badges */
.campus-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.campus-badge.campus-city { background: #be1e2d; }
.campus-badge.campus-mesa { background: #0054a4; }
.campus-badge.campus-mira { background: #1e9097; }
.campus-badge.campus-online { background: #6c757d; }

/* Conflict Warning Badge */
.conflict-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #dc3545;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Find Classes Results */
.find-class-item {
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    transition: all 0.2s;
}

.find-class-item:hover {
    border-color: #0d6efd;
    background: #f8f9fa;
}

.find-class-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.find-class-title {
    font-weight: 600;
    color: #212529;
}

.find-class-details {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 4px;
}

/* Enrollment Checklist */
.enrollment-item {
    padding: 16px;
    margin-bottom: 12px;
    border: 2px solid #0d6efd;
    border-radius: 8px;
    background: #f8f9fa;
}

.enrollment-item-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 8px;
}

.enrollment-item-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #212529;
    margin-bottom: 6px;
}

.enrollment-item-details {
    color: #495057;
    margin-bottom: 12px;
}

.enrollment-item-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .schedule-grid {
        min-width: 100%;
        font-size: 0.7rem;
    }

    .schedule-grid .time-col {
        width: 50px;
        min-width: 50px;
        font-size: 0.65rem;
    }

    .schedule-grid .day-col {
        min-width: 80px;
    }

    .schedule-grid thead th {
        padding: 8px 4px;
        font-size: 0.75rem;
    }

    .schedule-item {
        font-size: 0.65rem;
        padding: 2px 4px;
    }

    .schedule-item-time {
        font-size: 0.6rem;
    }

    .schedule-item-campus {
        display: none;
    }

    .conflict-icon {
        width: 14px;
        height: 14px;
        font-size: 10px;
    }
}

/* Print Styles */
@media print {
    .btn, .modal, .navbar, footer,
    .slide-drawer, #floating-help-btn,
    .card-header, .selected-item-actions {
        display: none !important;
    }

    .schedule-grid-container {
        max-height: none;
        overflow: visible;
    }

    .schedule-grid {
        page-break-inside: avoid;
    }

    .schedule-item {
        border: 1px solid #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        background: white;
    }
}

/* Dark Mode Support (if enabled on page) */
body.dark-mode .schedule-grid {
    background: #2d3748;
}

body.dark-mode .schedule-grid th,
body.dark-mode .schedule-grid td {
    border-color: #4a5568;
}

body.dark-mode .schedule-grid .time-col {
    background: #1a202c;
    color: #e2e8f0;
}

body.dark-mode .schedule-grid .time-slot {
    background: #2d3748;
}

body.dark-mode .schedule-grid .time-slot:hover {
    background: #374151;
}

body.dark-mode .selected-item {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .selected-item-title {
    color: #f7fafc;
}

body.dark-mode .selected-item-subtitle,
body.dark-mode .selected-item-details {
    color: #cbd5e0;
}

/* Loading State */
.schedule-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.schedule-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Empty State */
.schedule-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.schedule-empty .material-icons {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 16px;
}

/* Animation for adding items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.schedule-item.new-item {
    animation: slideIn 0.3s ease-out;
}

.selected-item.new-item {
    animation: slideIn 0.3s ease-out;
}

/* Tooltip for schedule items */
.schedule-item-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.schedule-item-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}
