/* ============================================================
   ATLAS — Profile modal styles
   WP03 — FR-006 / FR-007
   Uses CSS custom properties from styles.css (light + dark themes).
   ============================================================ */

/* ------------------------------------------------------------------
   Profile open button (header affordance — all users)
   ------------------------------------------------------------------ */

#open-profile-btn {
    /* Inherits atlas-btn-topbar styles; no overrides needed by default */
}

/* ------------------------------------------------------------------
   Profile modal overlay
   ------------------------------------------------------------------ */

#profile-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md, 1rem);
}

/* ------------------------------------------------------------------
   Modal box
   ------------------------------------------------------------------ */

.profile-modal-box {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--border-radius-lg, 12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

/* ------------------------------------------------------------------
   Modal header
   ------------------------------------------------------------------ */

.profile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.profile-modal-header h3 {
    margin: 0;
    font-size: var(--font-size-lg, 1.125rem);
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.profile-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-muted, #64748b);
    padding: 0.25rem 0.4rem;
    border-radius: var(--border-radius-sm, 4px);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.profile-modal-close:hover {
    background: var(--surface-hover, #f1f5f9);
    color: var(--text-primary, #0f172a);
}

/* ------------------------------------------------------------------
   Modal body — form fields
   ------------------------------------------------------------------ */

.profile-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-modal-body .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.profile-modal-body label {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--text-secondary, #475569);
}

.profile-modal-body input[type="text"],
.profile-modal-body select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--border-radius, 6px);
    font-size: var(--font-size-base, 0.9375rem);
    color: var(--text-primary, #0f172a);
    background: var(--input-bg, var(--surface, #fff));
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    box-sizing: border-box;
}

.profile-modal-body input[type="text"]:focus,
.profile-modal-body select:focus {
    outline: none;
    border-color: var(--primary, #2175d9);
    box-shadow: 0 0 0 3px rgba(33, 117, 217, 0.15);
}

/* ------------------------------------------------------------------
   Modal footer — action buttons
   ------------------------------------------------------------------ */

.profile-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem 1.125rem;
    border-top: 1px solid var(--border, #e2e8f0);
}

/* Dark theme adjustments */
[data-theme="dark"] .profile-modal-box {
    background: var(--surface, #1e2a3a);
    border-color: var(--border, #334155);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .profile-modal-body input[type="text"],
[data-theme="dark"] .profile-modal-body select {
    background: var(--input-bg, #162032);
    color: var(--text-primary, #e2e8f0);
    border-color: var(--border, #334155);
}
