/* Custom styles for Employee Shift Board */

/* External Events (Employee List) */
#external-events {
    padding: 0;
}

.fc-event {
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: move;
    font-weight: 500;
    text-align: center;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

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

/* Employee colors */
.employee-john {
    background-color: #3788d8;
    color: white;
}

.employee-jane {
    background-color: #fc6c85;
    color: white;
}

.employee-mike {
    background-color: #28a745;
    color: white;
}

.employee-sarah {
    background-color: #ffc107;
    color: black;
}

.employee-david {
    background-color: #6f42c1;
    color: white;
}

.employee-lisa {
    background-color: #fd7e14;
    color: white;
}

.employee-tom {
    background-color: #20c997;
    color: white;
}

.employee-anna {
    background-color: #e83e8c;
    color: white;
}

/* Calendar customization */
.fc {
    font-family: inherit;
    width: 100% !important;
    overflow: visible !important;
}

.fc-toolbar-title {
    font-size: 1.5rem !important;
    font-weight: 600;
}

.fc-button {
    border-radius: 6px !important;
}

.fc-button-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.fc-button-primary:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
}

/* Fix calendar container overflow */
#calendar {
    width: 100% !important;
    overflow: visible !important;
}

.fc-view-harness {
    overflow: visible !important;
}

.fc-scroller {
    overflow: visible !important;
}

/* Calendar events styling */
.fc-event {
    border-radius: 4px;
    border: none;
    font-weight: 500;
    cursor: grab !important;
    transition: all 0.2s ease;
}

.fc-event:active {
    cursor: grabbing !important;
}

.fc-event-title {
    font-weight: 600;
}

/* Improve event interaction */
.fc-event:hover {
    cursor: grab !important;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Time grid styling */
.fc-timegrid-slot {
    height: 40px;
}

.fc-timegrid-slot-minor {
    border-top: 1px dotted #ddd;
}

/* Improve time grid for better dragging */
.fc-timegrid-col {
    min-width: 120px !important;
}

.fc-timegrid-slot-label {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Better event dragging visual feedback */
.fc-event-dragging {
    opacity: 0.7 !important;
    transform: rotate(2deg) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.fc-event-resizing {
    opacity: 0.8 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Drag feedback - consolidated above */

/* Card styling */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Calendar card specific styling */
.card-body {
    padding: 0 !important;
    overflow: visible !important;
}

/* Ensure calendar card doesn't constrain width */
.col-md-9 .card {
    overflow: visible !important;
}

.col-md-9 .card-body {
    overflow: visible !important;
    padding: 1rem !important;
}

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

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }

    .fc-button-group {
        display: flex;
    }

    /* Adjust calendar height for mobile */
    #calendar {
        height: 500px !important;
    }

    /* Ensure calendar is fully visible on mobile */
    .col-md-9 .card-body {
        padding: 0.5rem !important;
    }

    .fc-timegrid-col {
        min-width: 100px !important;
    }
}

@media (max-width: 576px) {

    /* Further height adjustment for very small screens */
    #calendar {
        height: 400px !important;
    }

    .fc-toolbar-title {
        font-size: 1.2rem !important;
    }

    .fc-timegrid-col {
        min-width: 80px !important;
    }

    .fc-timegrid-slot-label {
        font-size: 0.7rem;
    }
}

/* Large screens - ensure calendar uses full width */
@media (min-width: 1200px) {
    .fc-timegrid-col {
        min-width: 150px !important;
    }
}

/* Ensure calendar container has proper height */
.fc {
    height: 100% !important;
}

/* Shift summary styling */
#shift-summary {
    font-size: 0.9rem;
}

#shift-summary .employee-count {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 2px 0;
}

#shift-summary .employee-name {
    font-weight: 500;
}

#shift-summary .shift-count {
    color: #6c757d;
    font-size: 0.8rem;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation for new events */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fc-event.new-event {
    animation: slideIn 0.3s ease-out;
}

/* Hover effects for better UX */
.fc-daygrid-event:hover,
.fc-timegrid-event:hover {
    opacity: 0.9;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Custom scrollbar for sidebar */
.card-body {
    max-height: 400px;
    overflow-y: auto;
}

.card-body::-webkit-scrollbar {
    width: 6px;
}

.card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.card-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.card-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}