/* Schedule Detail Page Styles */

/* Custom Badge Colors for Generation Phases */
.badge.bg-orange {
    background-color: #fd7e14 !important;
}

.badge.badge-purple {
    background-color: #6f42c1 !important;
    color: white;
}

/* Schedule Header Actions - Button Layout */
.schedule-header-actions {
    gap: 0.5rem;
    align-items: center;
}

.actions-primary,
.actions-secondary,
.actions-destructive {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Visual hierarchy through color and weight */
.actions-primary .btn {
    font-weight: 500;
}

/* Badge styling for change counts */
.actions-primary .badge {
    font-size: 0.7em;
    padding: 0.25em 0.5em;
    border-radius: 10px;
}

/* Smooth transitions for all buttons */
.schedule-header-actions .btn {
    transition: all 0.2s ease-in-out;
}

.schedule-header-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.schedule-header-actions .btn:active {
    transform: translateY(0);
}

/* Destructive action buttons - special styling */
.actions-destructive .btn-outline-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

/* Responsive Stacking */
@media (max-width: 991px) {
    .schedule-header-actions {
        width: 100%;
    }

    .actions-primary {
        order: 1;
        flex: 1 1 100%;
    }

    .actions-secondary {
        order: 2;
        flex: 1 1 auto;
    }

    .actions-destructive {
        order: 3;
        flex: 1 1 auto;
        justify-content: flex-end;
    }
}

@media (max-width: 767px) {
    .schedule-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-primary,
    .actions-secondary,
    .actions-destructive {
        width: 100%;
        justify-content: space-between;
    }

    /* Larger touch targets on mobile */
    .schedule-header-actions .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Hide text on small destructive buttons, keep icon */
    .actions-destructive .btn .d-inline.d-lg-none {
        display: inline !important;
    }
}

/* Header layout improvements */
.d-flex.justify-content-between.flex-wrap.flex-md-nowrap.align-items-center {
    gap: 1rem;
}

#schedule-days-container {
    padding: 1rem;
}

.day-schedule-item {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.day-schedule-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.day-schedule-item .bg-light {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #e9ecef;
}

/* Today's date special styling */
.day-schedule-item[data-date] {
    position: relative;
}

/* Animation for newly loaded days */
.day-schedule-item.fade-in {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Better spacing for the table content */
.day-schedule-item .table {
    margin-bottom: 0;
}

.day-schedule-item .table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

/* Add subtle separation for empty days */
.day-schedule-item .text-center.text-muted {
    padding: 2rem 1rem;
    background-color: #fafafa;
}

/* Styling for employee dropdown groups */
#assignmentEmployeeId optgroup {
    font-weight: bold;
    font-style: normal;
    padding: 0.5rem 0;
}

#assignmentEmployeeId optgroup[label*="On Leave"] {
    background-color: #fff3cd;
}

/* On-leave warning alert styling */
#assignmentOnLeaveWarning {
    border-left: 4px solid #ffc107;
    background-color: #fff3cd;
    border-color: #ffc107;
}

#assignmentOnLeaveWarning .bi-exclamation-triangle-fill {
    color: #ff9800;
}

/* Clickable assignment row styling */
.clickable-assignment-row {
    transition: background-color 0.2s ease;
}

.clickable-assignment-row:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Collapsible day header styling */
.collapse-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

[aria-expanded="false"] .collapse-icon {
    transform: rotate(-90deg);
}

[aria-expanded="true"] .collapse-icon {
    transform: rotate(0deg);
}

/* Smooth collapse transition */
.day-schedule-item .collapse {
    transition: height 0.35s ease;
}

/* Jump to Top Button */
#jumpToTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

#jumpToTopBtn.show {
    display: flex;
    opacity: 0.9;
}

#jumpToTopBtn:hover {
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#jumpToTopBtn i {
    font-size: 1.5rem;
}

/* Responsive adjustment for mobile */
@media (max-width: 768px) {
    #jumpToTopBtn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    #jumpToTopBtn i {
        font-size: 1.3rem;
    }
}
