/**
 * Approval Requests Styles
 * Timeline, modals, and status badges for the approval requests system
 */

/* ==================== Timeline Styles ==================== */

.timeline {
    position: relative;
    padding: 20px 0;
    margin: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    padding-bottom: 20px;
    margin-bottom: 10px;
}

.timeline-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: 10px;
    top: 0;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: var(--font-size-sm);
    z-index: 1;
}

.timeline-content {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
}

.timeline-header {
    margin-bottom: 5px;
    font-size: var(--font-size-base);
}

.timeline-header strong {
    color: #495057;
}

.timeline-body {
    font-size: var(--font-size-base);
    color: #6c757d;
    margin-top: 5px;
}

/* ==================== Status Badges ==================== */

.badge {
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 0.35em 0.65em;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-success {
    background-color: #28a745;
    color: #fff;
}

.badge-danger {
    background-color: #dc3545;
    color: #fff;
}

.badge-secondary {
    background-color: #6c757d;
    color: #fff;
}

.badge-primary {
    background-color: #007bff;
    color: #fff;
}

/* ==================== Request Details Modal ==================== */

#requestDetailsModal .modal-body pre {
    max-height: 300px;
    overflow-y: auto;
    font-size: var(--font-size-sm);
    background-color: #f8f9fa !important;
}

#requestDetailsModal .modal-footer {
    justify-content: space-between;
}

/* ==================== Alert Container ==================== */

#alert-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
}

#alert-container .alert {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

#alert-container .alert i {
    margin-right: 8px;
}

/* ==================== Action Buttons ==================== */

.approve-request,
.reject-request,
.execute-request,
.cancel-request {
    margin-right: 5px;
}

.approve-request:last-child,
.reject-request:last-child,
.execute-request:last-child,
.cancel-request:last-child {
    margin-right: 0;
}

/* ==================== Request List Table ==================== */

.approval-requests-table {
    width: 100%;
}

.approval-requests-table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.approval-requests-table td,
.approval-requests-table th {
    padding: 12px;
    vertical-align: middle;
}

.approval-requests-table tbody tr:hover {
    background-color: #f8f9fa;
}

.approval-requests-table .actions {
    white-space: nowrap;
}

/* ==================== Loading Spinner ==================== */

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading-spinner i {
    font-size: var(--font-size-3xl);
}

/* ==================== Empty State ==================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #adb5bd;
}

.empty-state p {
    font-size: var(--font-size-md);
    margin-bottom: 10px;
}

/* ==================== Responsive Styles ==================== */

@media (max-width: 768px) {
    #alert-container {
        right: 10px;
        left: 10px;
        min-width: auto;
    }

    .timeline-content {
        padding: 10px;
    }

    .timeline-header {
        font-size: var(--font-size-base);
    }

    .timeline-body {
        font-size: var(--font-size-sm);
    }

    .approval-requests-table {
        font-size: var(--font-size-base);
    }

    .approval-requests-table td,
    .approval-requests-table th {
        padding: 8px;
    }
}

/* ==================== Modal Enhancements ==================== */

.modal-header.bg-success,
.modal-header.bg-danger,
.modal-header.bg-primary,
.modal-header.bg-secondary {
    color: #fff;
}

.modal-header.bg-success .close,
.modal-header.bg-danger .close,
.modal-header.bg-primary .close,
.modal-header.bg-secondary .close {
    color: #fff;
    opacity: 0.8;
}

.modal-header.bg-success .close:hover,
.modal-header.bg-danger .close:hover,
.modal-header.bg-primary .close:hover,
.modal-header.bg-secondary .close:hover {
    opacity: 1;
}

/* ==================== Request Type Labels ==================== */

.request-type-label {
    display: inline-block;
    padding: 4px 8px;
    background-color: #e9ecef;
    border-radius: 3px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: #495057;
}

/* ==================== Animation ==================== */

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

.alert {
    animation: fadeInDown 0.3s ease-out;
}
