/* --- Schedule Tab --- */
#tab-schedule {
    padding: 0;
}

.schedule-layout-container {
    display: flex;
    height: 100%;
    gap: 1.5rem;
}

.schedule-date-display {
    flex-basis: 150px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-right: 1px solid var(--border-color);
    text-align: center;
}

#schedule-date-year {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

#schedule-date-day {
    font-size: 4.5rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
    margin: 0.5rem 0;
}

#schedule-date-month-weekday {
    font-size: 1.2rem;
    font-weight: bold;
}

.schedule-content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem 0;
}

.schedule-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: listFadeIn 0.5s;
}

@keyframes listFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.schedule-group-header {
    padding: 0.2rem 0.8rem;
    margin-bottom: 0.8rem;
    border-left: 8px solid var(--primary-color);
    font-weight: bold;
    color: var(--secondary-color);
}

.schedule-group .schedule-item {
    margin-bottom: 0.5rem;
}

.schedule-item {
    background-color: var(--secondary-bg);
    padding: 1rem;
    border-radius: 8px;
    border-left: 5px solid var(--info-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.schedule-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.schedule-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.schedule-item-title {
    font-weight: bold;
    font-size: 1.1rem;
    word-break: break-all;
}

.schedule-item-time {
    font-size: 0.9rem;
    color: var(--secondary-color);
    flex-shrink: 0;
    margin-left: 1rem;
}

.schedule-item-desc {
    font-size: 0.95rem;
}

.no-schedules {
    text-align: center;
    color: var(--secondary-color);
    padding: 2rem;
    font-style: italic;
    margin: auto;
}

.schedule-link {
    text-decoration: none;
    font-size: 1rem;
    margin-left: 8px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.schedule-link:hover {
    transform: scale(1.2) rotate(10deg);
}

/* --- Add/Edit Schedule Floating Panel --- */
.add-schedule-form {
    display: none;
    position: fixed;
    top: 2vh;
    left: 10%;
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    flex-direction: column;
}

.add-schedule-form.show {
    display: flex;
    animation: slideInFromLeft 0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940);
}

.main-layout.schedule-form-is-active > .calendar-column {
    filter: blur(5px);
    pointer-events: none;
    transition: filter 0.3s ease-in-out;
}

.add-schedule-form .form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.add-schedule-form h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.add-schedule-form .close-btn {
    background: transparent;
    border: none;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.add-schedule-form .close-btn:hover {
    color: var(--text-color);
    background: transparent;
}

.add-schedule-form .form-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.5rem;
}

.add-schedule-form .form-actions {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background-color: var(--secondary-bg);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.add-schedule-form .form-actions button {
    width: 100%;
    flex: 1;
}

@keyframes slideInFromLeft {
    from {
        transform: translateY(5px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Schedule View Panel Styles --- */
#schedule-view-body .form-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}
#schedule-view-body .form-group:last-child {
    border-bottom: none;
}
#schedule-view-body .form-group label {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--secondary-color);
}
#schedule-view-body .form-group p,
#schedule-view-body .form-group div {
    margin: 0;
    word-break: break-all;
    white-space: pre-wrap;
    line-height: 1.6;
}
#schedule-view-body .form-group a {
    color: var(--primary-color);
    text-decoration: none;
}
#schedule-view-body .form-group a:hover {
    text-decoration: underline;
}
#delete-schedule-btn-view {
    background-color: var(--danger-color);
}
#cancel-edit-btn {
    background-color: var(--secondary-color);
}





#timetableStructureModal input,
#timetableStructureModal textarea,
#edit-schedule-form input,
#edit-schedule-form textarea,
.form-group select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    background-color: var(--input-bg);
    color: var(--input-text);
    font-family: inherit;
}

#timetableStructureModal textarea,
#edit-schedule-form textarea {
    resize: vertical;
    min-height: 80px;
}

#timetableStructureModal .time-inputs,
#edit-schedule-form .time-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#timetableStructureModal .time-inputs input,
#edit-schedule-form .time-inputs input {
    flex: 1;
}