﻿/* ============================================================
   AddEditForms.css
   Standalone styles for the AddEditForms component.
   Theme: XManagementPro blue/slate — matches XMPFormViewer modals.
   ============================================================ */

.aef-root {
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #1e2a45;
    padding: 4px 2px;
}

    .aef-root * {
        box-sizing: border-box;
    }

/* ── Layout rows ─────────────────────────────────────────────── */
.aef-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.aef-field {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aef-field-full {
    flex-basis: 100%;
    min-width: unset;
}

/* ── Labels ──────────────────────────────────────────────────── */
.aef-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7a99;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.aef-required {
    color: #e05c6a;
}

.aef-hint {
    font-size: 10px;
    font-weight: 400;
    color: #a0aabf;
    text-transform: none;
    letter-spacing: 0;
}

.aef-warn-text {
    color: #c06e1a !important;
}

/* ── Inputs ──────────────────────────────────────────────────── */
.aef-input,
.aef-select,
.aef-textarea {
    background: #ffffff;
    border: 1px solid #d4daea;
    border-radius: 5px;
    color: #1e2a45;
    font-family: inherit;
    font-size: 13px;
    padding: 6px 9px;
    outline: none;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .aef-input:focus,
    .aef-select:focus,
    .aef-textarea:focus {
        border-color: #5b8dee;
        box-shadow: 0 0 0 3px rgba(91,141,238,0.15);
    }

.aef-textarea {
    resize: vertical;
    min-height: 80px;
}

.aef-file-input {
    font-size: 12px;
    color: #6b7a99;
    margin-top: 4px;
}

/* ── File info row ───────────────────────────────────────────── */
.aef-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f6f8fc;
    border: 1px solid #d4daea;
    border-radius: 5px;
    margin-bottom: 6px;
}

.aef-file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.aef-file-name {
    font-size: 12px;
    font-weight: 500;
    color: #1e2a45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aef-file-size {
    font-size: 10px;
    color: #a0aabf;
}

/* ── Version warning ─────────────────────────────────────────── */
.aef-version-warn {
    font-size: 11px;
    color: #7a4a00;
    background: #fef3e7;
    border: 1px solid #f5cfa0;
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 4px;
}

/* ── Status badge ────────────────────────────────────────────── */
.aef-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.aef-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
}

.aef-active {
    background: #e6f9f1;
    color: #1a7f52;
    border: 1px solid #a5dfc3;
}

.aef-inactive {
    background: #f6f8fc;
    color: #a0aabf;
    border: 1px solid #d4daea;
}

/* ── Upload progress ─────────────────────────────────────────── */
.aef-upload-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #5b8dee;
    margin-top: 4px;
}

.aef-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #c5d8fb;
    border-top-color: #5b8dee;
    border-radius: 50%;
    animation: aef-spin 0.7s linear infinite;
}

@keyframes aef-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── XDP Metadata grid ───────────────────────────────────────── */
.aef-meta-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.aef-meta-section {
    flex: 1;
    min-width: 200px;
    background: #f6f8fc;
    border: 1px solid #d4daea;
    border-radius: 5px;
    overflow: hidden;
}

.aef-meta-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6b7a99;
    background: #edf0f7;
    padding: 5px 10px;
    border-bottom: 1px solid #d4daea;
}

.aef-meta-row {
    display: flex;
    gap: 8px;
    padding: 4px 10px;
    border-bottom: 1px solid #f0f2f8;
    font-size: 11px;
}

    .aef-meta-row:last-child {
        border-bottom: none;
    }

.aef-meta-key {
    font-weight: 600;
    color: #3a6fd8;
    min-width: 90px;
    flex-shrink: 0;
}

.aef-meta-val {
    color: #1e2a45;
    word-break: break-word;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.aef-alert {
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 4px;
    margin-top: 4px;
}

.aef-alert-danger {
    background: #fdeef0;
    border: 1px solid #f5b8be;
    color: #c0404e;
}

.aef-error-inline {
    font-size: 12px;
    color: #c0404e;
    background: #fdeef0;
    border: 1px solid #f5b8be;
    border-radius: 4px;
    padding: 5px 10px;
}

/* ── Footer / submit row ─────────────────────────────────────── */
.aef-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
    border-top: 1px solid #edf0f7;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.aef-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 5px;
    border: 1px solid #d4daea;
    background: #f6f8fc;
    color: #1e2a45;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s;
    white-space: nowrap;
    user-select: none;
}

    .aef-btn:hover:not(:disabled) {
        background: #edf0f7;
        border-color: #bcc5d9;
    }

    .aef-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

.aef-btn-primary {
    background: #5b8dee;
    border-color: #5b8dee;
    color: #ffffff;
}

    .aef-btn-primary:hover:not(:disabled) {
        background: #3a6fd8;
        border-color: #3a6fd8;
    }

.aef-btn-sm {
    padding: 4px 9px;
    font-size: 11px;
}

/* ── PDF preview overlay ─────────────────────────────────────── */
.aef-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30,42,69,0.55);
    backdrop-filter: blur(2px);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.aef-preview-box {
    background: #ffffff;
    border: 1px solid #d4daea;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(30,42,69,0.22);
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.aef-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2c3e72 0%, #3a5298 100%);
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    flex-shrink: 0;
}

.aef-preview-close {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.88);
    border-radius: 5px;
    padding: 4px 11px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.13s;
}

    .aef-preview-close:hover {
        background: rgba(255,255,255,0.22);
        color: #ffffff;
    }

.aef-preview-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
