/* Respond to Request Modal — scoped under .respond-request-modal on the root element */

/* ── Overlay ───────────────────────────────────────────────── */
.respond-request-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.respond-request-modal.visible {
    opacity: 1;
    visibility: visible;
}

/* ── Card ──────────────────────────────────────────────────── */
/* Override Bootstrap's bare .modal-content (width:100%) and
   app.css's bare .modal-content (width:90%; max-width:500px). */
.respond-request-modal .modal-content {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.respond-request-modal.visible .modal-content {
    transform: scale(1);
}

/* ── Header ────────────────────────────────────────────────── */
.respond-request-modal .modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.respond-request-modal .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.respond-request-modal .modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.respond-request-modal .modal-close:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* ── Body ──────────────────────────────────────────────────── */
/* Make the body a flex-column so every child stretches to
   its full cross-axis width — no percentage widths needed. */
.respond-request-modal .modal-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
}

.respond-request-modal .modal-body > * {
    width: 100%;
    box-sizing: border-box;
}

.respond-request-modal .request-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.respond-request-modal .info-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.respond-request-modal .info-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.respond-request-modal .info-row:last-child { border-bottom: none; }

.respond-request-modal .info-label {
    font-weight: 600;
    color: #495057;
}

.respond-request-modal .info-value {
    color: #333;
}

.respond-request-modal .message-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.respond-request-modal .request-message {
    margin: 0;
    color: #495057;
    font-style: italic;
    text-align: center;
}

/* ── Footer ────────────────────────────────────────────────── */
.respond-request-modal .modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.respond-request-modal .modal-footer .btn { width: 100%; }

/* ── Desktop ───────────────────────────────────────────────── */
@media (min-width: 769px) {
    .respond-request-modal {
        padding-left: 250px;
    }

    .respond-request-modal .info-row {
        display: grid;
        grid-template-columns: 180px 1fr;
        column-gap: 1.25rem;
        align-items: start;
    }

    .respond-request-modal .modal-footer {
        flex-direction: row;
        justify-content: flex-end;
    }

    .respond-request-modal .modal-footer .btn {
        width: auto;
        flex: 1;
    }
}

/* ── States ────────────────────────────────────────────────── */
.respond-request-modal .loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}

.respond-request-modal .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .respond-request-modal {
        padding: 20px 0 100px 0;
        align-items: flex-start;
    }

    .respond-request-modal .modal-content {
        width: 95%;
        margin: 0 auto;
        max-height: calc(100vh - 120px);
    }

    .respond-request-modal .modal-header,
    .respond-request-modal .modal-body,
    .respond-request-modal .modal-footer { padding: 1rem; }

    .respond-request-modal .modal-body {
        max-height: calc(100vh - 260px);
        overflow-y: auto;
    }

}
