﻿/* On-Call List Page Styles */

/* Container */
.oncall-container {
    margin: 0 auto;
    padding-top: 0;
    padding-left: .33rem;
    padding-right: .35rem;
}
/* Page Header */
.oncall-header {
    padding: 1.5rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.page-title {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.75rem;
}

    .page-title i {
        color: #28a745;
    }

/* Create Button */
.btn-create {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

    .btn-create:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

/* Zone Filter Card */
.zone-filter-card {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #e9ecef;
}

.zone-label {
    display: flex;
    align-items: center;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .zone-label {
        margin-bottom: 0;
    }
}

.zone-filter-section {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.zone-label i {
    color: #4a90e2;
}

.zone-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

    .zone-buttons .btn {
        font-size: 0.875rem;
        font-weight: 500;
        padding: 0.375rem 1rem;
        transition: all 0.2s ease;
    }

        .zone-buttons .btn.active {
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

.current-zone-info {
    flex: 1;
}

/* View Toggle */
.view-toggle .btn-group {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-toggle .btn {
    font-weight: 500;
}

    .view-toggle .btn.active {
        background-color: #007bff;
        color: white;
        border-color: #007bff;
    }

/* Main Container */
.oncall-list-container {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 0.25rem;
    min-height: 400px;
}

/* Schedule Grid View */
.schedule-grid {
    display: grid;
    gap: 1.5rem;
}

/* Week Card */
.week-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 3px 3px rgba(0,0,0,0.1);
    overflow: visible; /* Changed from hidden to allow smooth transitions */
    transition: all 0.3s ease;
}

    .week-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .week-card.current-week {
        border: 2px solid #28a745;
        box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
    }

    .week-card.date-based-card {
        border: 2px solid lightblue;
        box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
    }

        .week-card.date-based-card .week-header {
            background: #e3f2fd;
        }

/* Collapse Functionality */
.week-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

    .week-header:hover {
        background-color: #f0f0f0;
    }

.week-card.date-based-card .week-header:hover {
    background-color: #d1e7fd;
}

.btn-collapse {
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
    color: #6c757d;
}

    .btn-collapse:hover {
        background: #f8f9fa;
        border-color: #adb5bd;
        color: #495057;
    }

    .btn-collapse:focus {
        outline: none;
        box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    }

    .btn-collapse:active {
        background: #e9ecef;
    }

.collapse-icon {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.collapsible {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
    max-height: 2000px;
    opacity: 1;
}

    .collapsible.collapsed {
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

/* Visual feedback for collapsed state */
.week-card:has(.collapsible.collapsed) {
    opacity: 0.9;
}

    .week-card:has(.collapsible.collapsed) .week-header {
        border-bottom: 2px dashed #dee2e6;
    }

.week-header {
    background: #f8f9fa;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.week-number {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.week-dates {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

    .week-dates strong {
        color: #495057;
    }

.week-stats {
    display: flex;
    gap: 0.75rem;
}

.stat-badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.week-body {
    padding: 0.75rem;
    overflow: hidden; /* Ensure content is clipped when collapsed */
}

/* Schedule Entry */
.schedule-entry {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .schedule-entry:last-child {
        margin-bottom: 0;
    }

    .schedule-entry:hover {
        background: white;
        border-color: #dee2e6;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .schedule-entry.disabled {
        opacity: 0.6;
        background: #fafafa;
    }

    .schedule-entry.past-entry {
        opacity: 0.7;
        background: #f5f5f5;
        border-style: dashed;
    }

.entry-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.entry-tech {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tech-avatar {
    width: 40px;
    height: 40px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

    .tech-avatar i {
        font-size: 1.25rem;
    }

.tech-name {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95rem;
}

.entry-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.entry-type .badge {
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Date Range Styling */
.date-range {
    color: #6c757d;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

    .date-range strong {
        color: #2c3e50;
        font-weight: 600;
    }

    .date-range.text-muted strong {
        color: #6c757d;
    }

.contact-info {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

    .contact-item i {
        font-size: 0.875rem;
    }

.entry-actions {
    display: flex;
    gap: 0.25rem;
}

    .entry-actions .btn {
        padding: 0.25rem 0.5rem;
    }

/* Table View Styles */
.table-view {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.oncall-table {
    margin-bottom: 0;
}

    .oncall-table thead {
        background: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
    }

        .oncall-table thead th {
            font-weight: 600;
            color: #495057;
            text-transform: uppercase;
            font-size: 0.75rem;
            letter-spacing: 0.5px;
            padding: 1rem 0.75rem;
            white-space: nowrap;
            border: none;
        }

    .oncall-table tbody tr {
        transition: all 0.2s ease;
        border-bottom: 1px solid #f1f3f5;
    }

        .oncall-table tbody tr:hover {
            background-color: #f8f9fa;
        }

        .oncall-table tbody tr.disabled-row {
            opacity: 0.6;
            background-color: #fafafa;
        }

        .oncall-table tbody tr.past-row {
            opacity: 0.7;
            background-color: #f5f5f5;
        }

    .oncall-table tbody td {
        padding: 0.875rem 0.75rem;
        vertical-align: middle;
        border: none;
    }

.week-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 2.5rem;
}

    .week-badge.current {
        background: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }

.date-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #bbdefb;
}

.week-display {
    font-size: 0.875rem;
}

.tech-cell strong {
    color: #2c3e50;
}

.contact-cell {
    font-size: 0.8rem;
    line-height: 1.4;
}

    .contact-cell i {
        color: #6c757d;
        width: 1rem;
    }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.empty-icon {
    font-size: 4rem;
    color: #dee2e6;
    display: block;
    margin-bottom: 1.5rem;
}

.empty-state h5 {
    color: #495057;
    margin-bottom: 0.75rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Badge Enhancements */
.badge i {
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .oncall-header .row {
        text-align: center;
    }

    .oncall-header .col-md-6:last-child {
        text-align: center !important;
    }

    .zone-filter-card {
        text-align: center;
    }

    .zone-filter-section {
        border-bottom: none;
        padding-bottom: 0;
    }

    .zone-label {
        justify-content: center;
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .zone-buttons {
        justify-content: center;
        margin-bottom: 0.75rem;
    }

        .zone-buttons .btn {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
        }

    .current-zone-info {
        text-align: center;
        margin-bottom: 0.75rem;
    }

    .view-toggle {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .schedule-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .entry-main {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.75rem;
    }

    .entry-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .entry-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .contact-info {
        flex-direction: column;
        gap: 0.25rem;
    }

    .week-header {
        padding: 0.75rem;
    }

    .week-info {
        width: 100%;
    }

    .week-header .d-flex {
        width: 100%;
        justify-content: space-between;
    }

    .btn-collapse {
        padding: 0.5rem;
        min-width: 40px;
    }
}

/* Loading Spinner Enhancement */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Hover Effects */
.btn-outline-primary:hover i,
.btn-outline-secondary:hover i,
.btn-outline-danger:hover i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Focus States */
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Print Styles */
@media print {
    .oncall-header,
    .zone-filter-card,
    .entry-actions,
    .action-buttons {
        display: none !important;
    }

    .schedule-entry {
        page-break-inside: avoid;
    }

    .week-card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}
