/* =====================================================
   CLAUX - MODALS
   ===================================================== */

.modal {
    z-index: 1055;
}

.modal-backdrop {
    z-index: 1050;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal.show {
    display: block;
}

.modal.show .modal-dialog {
    transform: none;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    gap: 16px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.modal-body {
    padding: 24px;
    background: var(--bg-secondary);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.modal-form-section {
    margin-bottom: 20px;
}

.modal-form-section:last-child {
    margin-bottom: 0;
}

/* View modal specific */
#viewModal .modal-content {
    background: var(--bg-secondary);
}

.view-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.view-banner-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    margin-left: auto;
}

.view-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.view-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.view-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.view-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.view-notes {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

#viewAttachments .attachment-item {
    background: var(--bg-secondary);
    margin-bottom: 8px;
}

.view-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
}

.view-detail-cell {
    background: var(--bg-tertiary);
    padding: 12px 16px;
}

.view-detail-cell:nth-child(n+4) {
    background: var(--bg-secondary);
}

.view-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.view-detail-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.view-modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.view-modal-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Environment info modal */
.env-info-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.env-info-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.env-info-section:first-child {
    padding-top: 0;
}

.env-info-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.env-info-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--accent);
}

.env-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.env-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.env-info-item i {
    font-size: 1.25rem;
    color: var(--accent);
    margin-top: 2px;
    flex-shrink: 0;
}

.env-info-item-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.env-info-item-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

/* ── AI Summary Modal Styles ────────────────────────────────────────────── */

.summary-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.summary-section:last-child {
    border-bottom: none;
}

.summary-section-title {
    display: flex;
    align-items: center;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
    width: fit-content;
}

.summary-section-title i {
    color: var(--primary);
    font-size: 1rem;
}

.summary-text {
    font-size: .88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-list-item {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: .5rem;
    font-size: .85rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.summary-list-item::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--success);
    font-weight: 700;
    font-size: .9rem;
}

.summary-list-warning .summary-list-item::before {
    content: '⚠';
    color: var(--warning);
}

/* AI Button in View Modal */
.btn-ai-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-ai-summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.btn-ai-summary i {
    font-size: 1rem;
}


/* Attachment upload section */
.attachment-upload-section {
    transition: all 0.2s;
}

.attachment-upload-section:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
}

/* File input button */
#attachmentFileInput {
    display: none;
}

/* Attachment item badges */
.attachment-item .badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Upload progress animation */
@keyframes upload-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.uploading {
    animation: upload-pulse 1.5s ease-in-out infinite;
}

/* Icon button danger */
.btn-icon-danger {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-icon-danger:hover {
    background: var(--danger);
    color: white;
}
