/* ══════════════════════════════════════════════════════════════
   MINDSUP AI — setting.css (Profile & Settings)
   Brand: Charcoal #1f271b, White #fbfffe, Purple #741054
   ══════════════════════════════════════════════════════════════ */
   :root {
    --black: #1f271b; 
    --black-hover: #2a332c; 
    --white: #fbfffe;
    
    --purple: #741054; 
    --purple-light: #9c1b74; 
    --purple-dark: #580c40;
    
    --bg: #151a12; 
    --gray-100: #f2f5f4;
    --gray-200: #e0e5e3;
    --gray-400: #a3aba8;
    --gray-600: #575e5a;
    
    --bdr: rgba(116, 16, 84, 0.15); 
    --bdr-mid: rgba(116, 16, 84, 0.3);
    
    --sh-sm: 0 2px 8px rgba(0,0,0,.05); 
    --sh-md: 0 8px 24px rgba(0,0,0,.08); 
    --sh-lg: 0 20px 40px rgba(0,0,0,.15);
    --sh-purple: 0 4px 16px rgba(116, 16, 84, 0.2);
    
    --font-body: 'Vazirmatn', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    
    --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px;
    --t: .2s cubic-bezier(.22,1,.36,1);
    --sidebar-w: 260px;
    --topbar-h: 70px;
  }
  
  *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
  body{
    font-family:var(--font-body); background:var(--gray-100); color:var(--black);
    direction:rtl; display:flex; min-height:100dvh; overflow-x:hidden;
  }
  a{text-decoration:none;color:inherit}
  button{cursor:pointer;font-family:inherit;border:none;background:none;outline:none}
  ul{list-style:none}
  ::-webkit-scrollbar{width:6px;height:6px;}
  ::-webkit-scrollbar-track{background:transparent}
  ::-webkit-scrollbar-thumb{background:var(--gray-200);border-radius:3px}
  ::-webkit-scrollbar-thumb:hover{background:var(--gray-400)}
  
  /* ─── SIDEBAR & BASE LAYOUT ─── */
  .ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.4; }
  .amb-1 { position: absolute; border-radius: 50%; filter: blur(100px); width: 50vw; height: 50vw; background: rgba(116,16,84,0.08); top: -20%; right: -10%; animation: ambDrift 15s ease-in-out infinite alternate; }
  
  .sidebar { width: var(--sidebar-w); min-width: var(--sidebar-w); height: 100dvh; background: var(--black); border-left: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; z-index: 200; transition: transform var(--t); }
  .sidebar-head { height: 70px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .logo-link { display: flex; align-items: center; gap: 10px; }
  .logo-badge { background: var(--purple); color: var(--white); font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 4px; }
  .logo-name { font-weight: 800; font-size: 18px; color: var(--white); }
  .logo-tagline { display: block; font-size: 10px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 1px; }
  .sidebar-close-btn { color: var(--gray-400); display: none; }
  
  .main-nav { flex: 1; padding: 20px 16px; display: flex; flex-direction: column; gap: 4px; }
  .nav-label { font-size:11px; font-weight:700; color:var(--gray-400); margin: 16px 8px 8px; }
  .nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--gray-200); font-size: 14px; transition: var(--t); }
  .nav-item svg { color: var(--gray-400); transition: var(--t); }
  .nav-item:hover { background: var(--black-hover); color: var(--white); }
  .nav-item.active { background: rgba(116,16,84,0.2); color: var(--purple-light); font-weight: 700; }
  .nav-item.active svg { color: var(--purple-light); }
  
  .sidebar-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,0.05); }
  .sf-user { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); background: rgba(255,255,255,0.05); }
  .sf-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--purple); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--white); flex-shrink: 0; }
  .sf-info { flex: 1; min-width: 0; }
  .sf-name { display: block; font-size: 13px; font-weight: 700; color: var(--white); }
  .sf-plan { font-size: 11px; color: var(--gray-400); }
  .sf-plan-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--purple-light); margin-left: 4px; }
  
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 150; opacity: 0; transition: var(--t); }
  
  .dashboard-wrapper { flex: 1; display: flex; flex-direction: column; z-index: 1; height: 100dvh; overflow-y: auto; }
  
  /* ─── TOPBAR ─── */
  .topbar { height: 70px; min-height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: var(--white); border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 100; }
  .tb-left { display: flex; align-items: center; gap: 16px; }
  .tb-btn { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--gray-100); color: var(--gray-600); display: flex; align-items: center; justify-content: center; transition: var(--t); }
  .tb-btn:hover { background: rgba(116,16,84,0.1); color: var(--purple); }
  .page-title { font-size: 18px; font-weight: 800; color: var(--black); }
  
  /* Buttons */
  .btn { padding: 10px 20px; border-radius: var(--r-sm); font-size: 14px; font-weight: 700; transition: var(--t); display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative;}
  .btn-primary { background: linear-gradient(135deg, var(--purple), var(--purple-dark)); border: 1px solid var(--purple-light); color: var(--white); }
  .btn-primary:hover:not(:disabled) { border-color: var(--purple-light); box-shadow: var(--sh-purple); transform: translateY(-1px); }
  .btn-outline { background: transparent; border: 1px solid var(--gray-200); color: var(--black); }
  .btn-outline:hover:not(:disabled) { background: var(--gray-100); border-color: var(--purple); color: var(--purple); }
  .btn-danger { background: #fee2e2; border: 1px solid #fca5a5; color: #ef4444; }
  .btn-danger:hover { background: #ef4444; color: #fff; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); transform: translateY(-1px);}
  .btn:disabled { opacity: 0.7; cursor: not-allowed; }
  
  /* ─── BENTO GRID ─── */
  .bento-container { padding: 24px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start;}
  .glass-panel { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--r-xl); box-shadow: var(--sh-sm); overflow: hidden; transition: var(--t); }
  .glass-panel:hover { border-color: rgba(116, 16, 84, 0.3); box-shadow: var(--sh-md); }
  
  .span-12 { grid-column: span 12; }
  .span-8 { grid-column: span 8; }
  .span-6 { grid-column: span 6; }
  .span-4 { grid-column: span 4; }
  
  /* Profile Card */
  .profile-card { padding: 40px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
  .avatar-wrapper { position: relative; margin-bottom: 16px; }
  .avatar-preview { width: 100px; height: 100px; border-radius: 50%; background: linear-gradient(135deg, var(--purple-dark), var(--purple)); color: var(--white); font-size: 40px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-purple); border: 4px solid var(--white); overflow: hidden; }
  .avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
  .avatar-edit-btn { position: absolute; bottom: 0; right: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--white); border: 1px solid var(--gray-200); color: var(--black); display: flex; align-items: center; justify-content: center; transition: var(--t); box-shadow: var(--sh-sm); }
  .avatar-edit-btn:hover { color: var(--purple); border-color: var(--purple); }
  
  .profile-name { font-size: 20px; font-weight: 800; color: var(--black); margin-bottom: 4px; }
  .profile-role { font-size: 13px; color: var(--gray-600); margin-bottom: 24px; }
  
  .profile-stats { width: 100%; display: flex; border-top: 1px solid var(--gray-100); padding-top: 20px; gap: 10px;}
  .p-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--gray-100); padding: 12px; border-radius: var(--r-sm); }
  .p-stat span { font-size: 11px; color: var(--gray-600); }
  .p-stat strong { font-size: 13px; font-weight: 700; color: var(--black); }
  
  /* Form Cards */
  .form-card { padding: 24px; }
  .card-head { margin-bottom: 24px; border-bottom: 1px solid var(--gray-100); padding-bottom: 16px;}
  .card-head h3 { font-size: 18px; font-weight: 800; color: var(--black); margin-bottom: 6px; }
  .card-head p { font-size: 13px; color: var(--gray-600); }
  
  .settings-form { display: flex; flex-direction: column; gap: 20px; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  
  .input-group { display: flex; flex-direction: column; gap: 8px; }
  .input-group label { font-size: 13px; font-weight: 700; color: var(--black); }
  .input-group input { padding: 12px 16px; font-family: var(--font-body); font-size: 14px; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: var(--r-sm); outline: none; transition: var(--t); color: var(--black); }
  .input-group input:focus { border-color: var(--purple); background: var(--white); box-shadow: 0 0 0 3px rgba(116, 16, 84, 0.1); }
  .input-group input:disabled, .input-group input[readonly] { background: var(--gray-200); cursor: not-allowed; color: var(--gray-600); opacity: 0.7;}
  
  .password-wrapper { position: relative; display: flex; align-items: center; }
  .password-wrapper input { width: 100%; padding-left: 40px; }
  .toggle-password { position: absolute; left: 12px; background: none; border: none; color: var(--gray-400); display: flex; transition: var(--t); padding: 4px;}
  .toggle-password:hover { color: var(--purple); }
  .toggle-password svg { width: 18px; height: 18px; }
  
  .form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
  
  /* Settings List (Switches) */
  .settings-list { display: flex; flex-direction: column; gap: 16px; }
  .settings-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--gray-100); border-radius: var(--r-sm); border: 1px solid transparent; transition: var(--t); }
  .settings-item:hover { border-color: var(--gray-200); background: var(--white); box-shadow: var(--sh-sm); }
  .si-text h4 { font-size: 14px; font-weight: 700; color: var(--black); margin-bottom: 4px; }
  .si-text p { font-size: 12px; color: var(--gray-600); }
  
  /* Switch Toggle CSS */
  .switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;}
  .switch input { opacity: 0; width: 0; height: 0; }
  .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--gray-400); transition: .3s; border-radius: 34px; }
  .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
  input:checked + .slider { background-color: var(--purple); }
  input:checked + .slider:before { transform: translateX(20px); }
  
  /* Danger Zone */
  .danger-zone { padding: 24px; display: flex; align-items: center; justify-content: space-between; border-color: #fecaca; background: #fff5f5; }
  .danger-info h3 { font-size: 16px; font-weight: 800; color: #b91c1c; margin-bottom: 6px; }
  .danger-info p { font-size: 13px; color: #991b1b; max-width: 600px; line-height: 1.6;}
  
  /* Button Spinner */
  .spinner { animation: rotate 2s linear infinite; width: 18px; height: 18px; display: inline-block; }
  .spinner.hidden { display: none; }
  .spinner .path { stroke: currentColor; stroke-linecap: round; animation: dash 1.5s ease-in-out infinite; }
  @keyframes rotate { 100% { transform: rotate(360deg); } }
  @keyframes dash { 0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; } 100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; } }
  
  /* ─── TOASTS ─── */
  .toasts{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%); display:flex; flex-direction:column; gap:8px; z-index:9999; pointer-events:none; }
  .toast{ padding:12px 24px; background:var(--black); color:var(--white); border-radius:var(--r-full); font-size:13px; box-shadow:var(--sh-md); white-space:nowrap; animation:toastIn .3s var(--ease); }
  .toast.ok { border-color: rgba(52,211,153,.4); color: #4ade80; }
  @keyframes toastIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
  
  /* ─── RESPONSIVE ─── */
  @media (max-width: 1024px) {
    .span-8, .span-4, .span-6 { grid-column: span 12; }
    .profile-card { flex-direction: row; text-align: right; gap: 20px;}
    .avatar-wrapper { margin-bottom: 0; }
    .profile-stats { width: auto; border-top: none; padding-top: 0; border-right: 1px solid var(--gray-100); padding-right: 20px; margin-right: auto;}
  }
  
  @media (max-width: 768px) {
    .sidebar { position: fixed; right: 0; top: 0; transform: translateX(100%); z-index: 300; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close-btn { display: block; }
    .sidebar-overlay.visible { display: block; opacity: 1; }
    
    .bento-container { padding: 16px; gap: 16px; }
    .topbar { padding: 0 16px; }
    
    .form-row { grid-template-columns: 1fr; }
    .profile-card { flex-direction: column; text-align: center; }
    .profile-stats { width: 100%; border-right: none; padding-right: 0; border-top: 1px solid var(--gray-100); padding-top: 20px; margin-right: 0;}
    
    .danger-zone { flex-direction: column; align-items: flex-start; gap: 16px; }
    .danger-zone .btn { width: 100%; }
  }
  
  @media (min-width: 769px) {
    #sidebarToggle { display: none; }
  }