/* ===========================================================================
   MODALS
   =========================================================================== */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0, 0, 0, 0.5);
    background-image: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.3) 100%);
    backdrop-filter: blur(16px) saturate(0.9);
    -webkit-backdrop-filter: blur(16px) saturate(0.9);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex;
    animation: backdropIn 0.25s ease;
}

@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: rgba(13, 13, 22, 0.88);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--r-xl);
    width: 100%; max-width: 420px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.03) inset, 0 0 60px rgba(124,110,248,0.05);
    animation: modalSpringIn 0.35s var(--ease-out-back);
}

.modal-lg { max-width: 600px; }



.modal-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 18px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.05);
    position: sticky; top: 0;
    background: rgba(13, 13, 22, 0.98); z-index: 10; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
.modal-sub   { font-size: 12px; color: var(--muted); margin-top: 3px; }

.close-btn {
    background: var(--elevated); border: 1px solid var(--border-md);
    color: var(--muted); cursor: pointer; padding: 5px;
    display: flex; align-items: center;
    border-radius: var(--r-sm);
    transition: color var(--t), background var(--t);
}
.close-btn i { width: 15px; height: 15px; }
.close-btn:hover { color: var(--text); background: var(--elevated-2); }

.modal-body {
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 14px;
}

.modal-foot {
    display: flex; gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

.cred-sec-lbl {
    font-size: 9.5px; font-weight: 700; color: var(--dim);
    text-transform: uppercase; letter-spacing: 1.2px;
    padding-bottom: 9px; border-bottom: 1px solid var(--border);
}

.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 40px; }

.pw-eye {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--muted); cursor: pointer;
    display: flex; align-items: center; padding: 0;
    transition: color var(--t);
}
.pw-eye i { width: 14px; height: 14px; }
.pw-eye:hover { color: var(--text); }

/* Modal buttons */
.btn-primary {
    flex: 1;
    height: 40px; padding: 0 18px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none; border-radius: var(--r-sm);
    font-size: 13px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: opacity 0.18s, box-shadow 0.25s, transform 0.15s var(--ease-out-back);
    box-shadow: 0 2px 12px var(--accent-glow);
    position: relative;
    overflow: hidden;
}
.btn-primary i { width: 14px; height: 14px; }
.btn-primary:hover { 
    opacity: 0.92; 
    box-shadow: 0 4px 24px var(--accent-glow);
    transform: translateY(-1px); 
}
.btn-primary:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

.btn-ghost {
    height: 40px; padding: 0 18px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--elevated); color: var(--muted);
    border: 1px solid var(--border-md); border-radius: var(--r-sm);
    font-size: 13px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: color var(--t), border-color var(--t);
}
.btn-ghost:hover { color: var(--text); border-color: var(--dim); }

/* ===========================================================================
   WATCHLIST MODAL SPECIFICS
   =========================================================================== */
.wl-modal-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 400px;
}
.wl-pane {
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-md);
    overflow: hidden;
}
.wl-pane-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.wl-pane-head .field-note {
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
    margin-left: 8px;
}
.wl-selected-list, .symbol-picker {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wl-sel-item, .sym-pick-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}
.wl-sel-item:hover, .sym-pick-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
.wl-sel-item.dragging { opacity: 0.5; }
.wl-sel-item.drag-over { border-top: 2px solid var(--accent); }

.drag-handle { width: 16px; height: 16px; color: var(--muted); margin-right: 8px; cursor: grab; }
.wl-sel-name, .sym-pick-name { flex: 1; font-size: 13px; font-weight: 500; }

.wl-rem-btn {
    background: none; border: none; color: var(--danger);
    cursor: pointer; padding: 4px; opacity: 0.6;
    transition: all 0.2s;
}
.wl-rem-btn:hover { opacity: 1; transform: scale(1.1); }
.wl-rem-btn i { width: 14px; height: 14px; }

.sym-pick-add { width: 16px; height: 16px; color: var(--accent); opacity: 0.7; }
.sym-pick-item:hover .sym-pick-add { opacity: 1; }

.wl-picker-search-wrap {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.15);
}
.wl-picker-search-icon { width: 14px; height: 14px; color: var(--muted); margin-right: 10px; }
.wl-picker-search-input {
    flex: 1; background: transparent; border: none;
    color: var(--text); font-size: 13px; outline: none;
}
.wl-picker-search-input::placeholder { color: var(--muted); }

/* Make Modal Inputs look glossy */
#wl_modal_name {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s;
}
#wl_modal_name:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}
