/* ============================================================
   Incident Report — Floating Button & Modal
   ============================================================ */

/* ── Floating trigger button ─────────────────────────────── */

#incident-trigger-btn {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 1055;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 26px;
    font-size: 0.97rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.45);
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    text-decoration: none;
    line-height: 1;
}

#incident-trigger-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(192, 57, 43, 0.5);
    color: #fff;
}

/* ── Modal shell ─────────────────────────────────────────── */

#incidentReportModal .modal-dialog {
    max-width: 600px;
}

#incidentReportModal .modal-content {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.22);
}

/* Header — white with orange-red accent bottom border */
#incidentReportModal .modal-header {
    background: #ffffff;
    border-bottom: 3px solid #e74c3c;
    padding: 14px 20px;
}

#incidentReportModal .modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: 0.1px;
}

.incident-header-icon {
    font-size: 1.1rem;
    color: #e74c3c;
}

#incidentReportModal .modal-header .btn-close {
    /* Standard dark close on white background — no filter needed */
    opacity: 0.6;
}

#incidentReportModal .modal-header .btn-close:hover {
    opacity: 1;
}

#incidentReportModal .modal-body {
    background: #ffffff;
    padding: 20px 22px 10px;
    max-height: 68vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

#incidentReportModal .modal-body::-webkit-scrollbar {
    width: 4px;
}
#incidentReportModal .modal-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

#incidentReportModal .modal-footer {
    border-top: 1px solid #eee;
    padding: 12px 22px;
    background: #fafafa;
}

/* ── Form fields ─────────────────────────────────────────── */

#incidentReportModal .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.incident-required {
    color: #e74c3c;
    margin-left: 1px;
}

#incidentReportModal .form-control,
#incidentReportModal .form-select {
    font-size: 0.84rem;
    border-radius: 8px;
    border-color: #dde1e7;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fdfdfd;
}

#incidentReportModal .form-control:focus,
#incidentReportModal .form-select:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
    outline: none;
    background-color: #fff;
}

#incidentReportModal .form-control.is-invalid,
#incidentReportModal .form-select.is-invalid {
    border-color: #e74c3c;
    box-shadow: none;
}

#incidentReportModal .invalid-feedback {
    font-size: 0.74rem;
}

#incidentReportModal .form-control[readonly] {
    background: #f5f7fa;
    color: #999;
    cursor: default;
}

/* ── Description & char counter ──────────────────────────── */

#incident-description {
    resize: vertical;
    min-height: 100px;
}

#incident-desc-counter {
    font-size: 0.71rem;
    color: #aaa;
    text-align: right;
    margin-top: 3px;
}

#incident-desc-counter.warn {
    color: #f39c12;
}

#incident-desc-counter.over {
    color: #e74c3c;
    font-weight: 600;
}

/* ── Screenshot upload area ──────────────────────────────── */

#incident-screenshot-area {
    border: 2px dashed #cdd2d8;
    border-radius: 10px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafbfd;
    user-select: none;
}

#incident-screenshot-area:hover,
#incident-screenshot-area.drag-over {
    border-color: #e74c3c;
    background: #fff8f7;
}

#incident-screenshot-area .upload-icon {
    font-size: 1.8rem;
    color: #bcc3cd;
    margin-bottom: 5px;
    display: block;
    line-height: 1;
}

#incident-screenshot-area .upload-text {
    font-size: 0.78rem;
    color: #777;
    margin: 0;
    line-height: 1.6;
}

#incident-screenshot-area .upload-text span {
    color: #e74c3c;
    font-weight: 600;
    text-decoration: underline;
}

#incident-screenshots-input {
    display: none;
}

/* Thumbnails */
#incident-screenshot-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.incident-thumb-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dde1e7;
    background: #f0f2f5;
    flex-shrink: 0;
}

.incident-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.incident-thumb-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(231, 76, 60, 0.88);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}

.incident-thumb-remove:hover {
    background: #c0392b;
}

#incident-screenshots-count {
    font-size: 0.71rem;
    color: #999;
    margin-top: 4px;
}

#incident-screenshots-count.at-limit {
    color: #f39c12;
    font-weight: 600;
}

/* ── Section divider ─────────────────────────────────────── */

.incident-section-sep {
    border: none;
    border-top: 1px solid #eef0f3;
    margin: 14px 0 12px;
}

/* ── Error alert ─────────────────────────────────────────── */

#incident-error-alert {
    font-size: 0.8rem;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    display: none;
    border: 1px solid #f5c6cb;
    background: #fff5f5;
    color: #721c24;
}

/* ── Submit button ───────────────────────────────────────── */

#incident-submit-btn {
    border-radius: 8px;
    /* font-size: 0.85rem; */
    font-weight: 600;
    padding: 7px 22px;
    min-width: 140px;
    background: #2c3e50;
    border-color: #2c3e50;
    transition: background 0.2s;
}

#incident-submit-btn:hover:not(:disabled) {
    background: #1a252f;
    border-color: #1a252f;
}

#incident-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

#incident-submit-btn .spinner-border {
    width: 13px;
    height: 13px;
    border-width: 2px;
    margin-right: 6px;
    vertical-align: middle;
}

/* ── Success state ───────────────────────────────────────── */

#incident-success-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    display: none;
}

#incident-success-state .success-circle {
    width: 70px;
    height: 70px;
    background: #eafaf1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: #27ae60;
}

#incident-success-state h5 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.4rem;
}

#incident-success-state .ref-badge {
    display: inline-block;
    background: #fff8f0;
    border: 1px solid #f39c12;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 8px;
    margin: 0.75rem 0;
    letter-spacing: 1.5px;
}

#incident-success-state .success-note {
    font-size: 0.82rem;
    color: #666;
    max-width: 340px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ── Mobile ──────────────────────────────────────────────── */

@media (max-width: 575px) {
    #incident-trigger-btn {
        bottom: 16px;
        right: 14px;
        font-size: 0.88rem;
        padding: 11px 18px;
    }

    #incidentReportModal .modal-body {
        max-height: 75vh;
        padding: 16px 16px 8px;
    }

    #incidentReportModal .modal-dialog {
        margin: 0.5rem;
    }
}