/**
 * MVR Request Styles
 * Styles for request submission and details pages
 */

/* Request Form Styles */
.mvr-request-form {
    background-color: #f8f9fa;
    min-height: calc(100vh - 200px);
}

.mvr-request-form .container {
    max-width: 900px;
}

.mvr-request-form fieldset {
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #ffffff;
    margin-bottom: 1.5rem;
}

.mvr-request-form legend {
    width: auto;
    padding: 0 0.5rem;
    margin-bottom: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    border: none;
}

/* Form elements */
.form-label.required::after {
    content: "";
    display: inline;
}

.form-control:focus,
.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Card styles */
.card {
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 0, 0, 0.125);
}

/* Status badges */
.badge.submitted {
    background-color: #007bff;
    color: white;
}

.badge.processing {
    background-color: #ffc107;
    color: #000;
}

.badge.needs-documentation {
    background-color: #17a2b8;
    color: white;
}

.badge.approved {
    background-color: #28a745;
    color: white;
}

.badge.not-approved {
    background-color: #dc3545;
    color: white;
}

/* Request Details Styles */
.mvr-request-details {
    background-color: #f8f9fa;
    min-height: calc(100vh - 200px);
}

.mvr-request-details dl {
    margin-bottom: 0;
}

.mvr-request-details dt {
    font-weight: 600;
    color: #495057;
}

.mvr-request-details dd {
    color: #212529;
    margin-bottom: 0.75rem;
}

/* Timeline styles */
.timeline {
    position: relative;
    padding-left: 1.6rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

/* Deleted timeline items */
.timeline-item.timeline-deleted {
    opacity: 0.6;
}

.timeline-item.timeline-deleted .timeline-content {
    position: relative;
}

.timeline-item.timeline-deleted .timeline-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.03) 10px,
        rgba(0, 0, 0, 0.03) 20px
    );
    pointer-events: none;
}

.timeline-marker {
    position: absolute;
    left: -1.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #dee2e6;
}

.timeline-content {
    padding-left: 0.5rem;
}

/* Validation styles */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Checkbox validation */
.was-validated .form-check-input:invalid ~ .form-check-label,
.form-check-input.is-invalid ~ .form-check-label {
    color: #dc3545;
}

/* Alert styles */
.alert {
    border-radius: 0.375rem;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #28a745;
}

.alert-danger {
    border-left-color: #dc3545;
}

.alert-warning {
    border-left-color: #ffc107;
}

.alert-info {
    border-left-color: #17a2b8;
}

/* Button styles */
.btn {
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mvr-request-form .container,
    .mvr-request-details .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .mvr-request-form fieldset {
        padding: 1rem;
    }

    .timeline {
        padding-left: 1.6rem;
    }

    .timeline-marker {
        left: -1.25rem;
    }

    .d-flex.gap-2 {
        flex-direction: column;
    }

    .d-flex.gap-2 > * {
        width: 100% !important;
    }
}

/* Print styles */
@media print {
    .btn,
    .alert,
    nav,
    footer,
    .skip-link {
        display: none !important;
    }

    .card {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .badge {
        border: 1px solid #000;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control,
    .form-select {
        border-width: 2px;
    }

    .btn {
        border-width: 2px;
    }

    .card {
        border-width: 2px;
    }
}

/* Filter active badge indicator */
.filter-active-badge {
    margin-left: -12px;
    margin-top: -8px;
    position: relative;
    z-index: 1;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
