/* ================================================================
   FILE: assets/css/components/modals.css
   PURPOSE: Modals, Popups & Overlays (100% Preserved)
   ================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.show,
.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: var(--modal-bg);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-color);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-xs);
    transition: color var(--transition-fast);
}
.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    color: var(--text-primary);
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ------------------------------------------------------------
   Custom Confirmation Dialog Modal
   ------------------------------------------------------------ */
.confirm-dialog {
    max-width: 440px;
    text-align: center;
    padding: 2rem 1.75rem;
}

.confirm-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.confirm-icon-box.danger {
    background: var(--status-danger-bg);
    color: var(--status-danger-dot);
}

.confirm-icon-box.warning {
    background: var(--status-warning-bg);
    color: var(--status-warning-dot);
}

.confirm-icon-box.info {
    background: var(--status-info-bg);
    color: var(--status-info-dot);
}

.confirm-icon-box svg {
    width: 32px;
    height: 32px;
}

.confirm-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.confirm-desc {
    font-size: 0.925rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions .btn {
    flex: 1;
}

/* ------------------------------------------------------------
   Image 5 Upload Status Modal Styling
   ------------------------------------------------------------ */
.upload-status-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.upload-status-icon-box {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.upload-status-icon-box svg {
    width: 22px;
    height: 22px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.upload-status-info {
    flex: 1;
    min-width: 0;
}

.upload-status-info h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 2px 0;
    letter-spacing: -0.01em;
}

.upload-status-filename {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.server-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.server-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.server-name-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.server-name-group .status-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.server-name-group .status-icon svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.server-name-group .server-label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px solid transparent;
    background: var(--card-bg);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Status States */
.server-status-row.completed {
    background-color: var(--status-success-bg);
    border-color: var(--status-success-border);
}
.server-status-row.completed .server-badge {
    color: var(--status-success-text);
    border-color: var(--status-success-border);
}

.server-status-row.failed {
    background-color: var(--status-danger-bg);
    border-color: var(--status-danger-border);
}
.server-status-row.failed .server-badge {
    color: var(--status-danger-text);
    border-color: var(--status-danger-border);
}

.server-status-row.processing,
.server-status-row.waiting {
    background-color: var(--status-info-bg);
    border-color: var(--status-info-border);
}
.server-status-row.processing .server-badge,
.server-status-row.waiting .server-badge {
    color: var(--status-info-text);
    border-color: var(--status-info-border);
}

.upload-status-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.status-footer-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-refresh-btn {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.2rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.status-refresh-btn:hover {
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-1px);
}

.status-refresh-btn svg {
    width: 15px;
    height: 15px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
