/* SAMIR Trading - Redesign V1
   Test environment only
   Goal: professional, calm, corporate dark UI without changing Flask logic.
*/

:root{
  --neon-purple:#0f172a !important;
  --neon-blue:#2563eb !important;
  --neon-pink:#2563eb !important;
  --bg-dark:#0b1120 !important;
  --glass-bg:#111827 !important;
  --glass-border:#263246 !important;

  --samir-bg:#0b1120;
  --samir-surface:#111827;
  --samir-surface-2:#162033;
  --samir-surface-3:#1b2940;
  --samir-border:#263246;
  --samir-text:#f8fafc;
  --samir-muted:#94a3b8;
  --samir-accent:#2563eb;
  --samir-accent-2:#3b82f6;
  --samir-danger:#dc2626;
  --samir-success:#16a34a;
  --samir-shadow:0 10px 30px rgba(0,0,0,.18);
}

html{
  background:var(--samir-bg) !important;
}

body{
  background:
    radial-gradient(circle at 85% 0%, rgba(37,99,235,.10), transparent 28rem),
    var(--samir-bg) !important;
  color:var(--samir-text) !important;
  font-family:'Vazirmatn','Vazir','IRANSans',Tahoma,Arial,sans-serif !important;
}

body::before{
  display:none !important;
}

/* Main page width */
.container{
  max-width:min(1440px, 96vw) !important;
  padding:1.1rem 1.25rem !important;
}

/* Header / top navigation */
.header{
  position:sticky !important;
  top:0 !important;
  z-index:9000 !important;
  margin-bottom:1.4rem !important;
  padding:.7rem 0 !important;
  background:rgba(15,23,42,.97) !important;
  border-bottom:1px solid var(--samir-border) !important;
  box-shadow:0 8px 24px rgba(0,0,0,.16) !important;
  backdrop-filter:blur(12px) !important;
}

.header .container{
  gap:1.25rem !important;
}

.logo{
  width:auto !important;
  max-width:160px !important;
  max-height:76px !important;
  object-fit:contain !important;
  background:#fff !important;
  border-radius:12px !important;
  padding:6px 10px !important;
  border:1px solid rgba(255,255,255,.18) !important;
  box-shadow:none !important;
}

.header-right{
  gap:.7rem !important;
}

.nav-links{
  gap:.45rem !important;
  padding:.25rem !important;
}

.nav-links a{
  width:40px !important;
  height:40px !important;
  min-width:40px !important;
  min-height:40px !important;
  padding:0 !important;
  border-radius:9px !important;
  color:#dbeafe !important;
  background:#142035 !important;
  border:1px solid #2b3a52 !important;
  box-shadow:none !important;
}

.nav-links a:hover,
.nav-links a:focus-visible{
  background:#1d4ed8 !important;
  border-color:#3b82f6 !important;
  color:#fff !important;
}

.notif-badge{
  border:2px solid #0f172a !important;
  box-shadow:none !important;
}

/* Search */
.top-search{
  max-width:780px !important;
  gap:.55rem !important;
}

.top-search input[type="text"]{
  min-height:42px !important;
  padding:.65rem .9rem !important;
  border-radius:9px !important;
  background:#0b1324 !important;
  border:1px solid #2b3a52 !important;
  color:#f8fafc !important;
  box-shadow:none !important;
}

.top-search input[type="text"]::placeholder{
  color:#7f8ea6 !important;
}

.top-search input[type="text"]:focus{
  border-color:#3b82f6 !important;
  box-shadow:0 0 0 3px rgba(59,130,246,.15) !important;
}

.top-search button{
  width:42px !important;
  height:42px !important;
  border-radius:9px !important;
  background:#2563eb !important;
  border:1px solid #3b82f6 !important;
  box-shadow:none !important;
}

.global-search-bakhsh-toggle,
.bakhsh-subscribe-cta{
  min-height:42px !important;
  border-radius:9px !important;
  background:#142035 !important;
  border:1px solid #2b3a52 !important;
  color:#dbeafe !important;
  box-shadow:none !important;
}

/* Brand title */
.title{
  margin:1.2rem 0 .25rem !important;
  font-size:clamp(1.8rem, 3vw, 2.5rem) !important;
  line-height:1.15 !important;
  font-weight:800 !important;
  letter-spacing:.02em !important;
  color:#f8fafc !important;
  text-shadow:none !important;
}

.tagline{
  margin:.2rem 0 1.4rem !important;
  color:var(--samir-muted) !important;
  opacity:1 !important;
  font-size:.92rem !important;
  font-weight:500 !important;
}

/* Cards */
.card{
  background:var(--samir-surface) !important;
  border:1px solid var(--samir-border) !important;
  border-radius:14px !important;
  padding:1.25rem !important;
  box-shadow:var(--samir-shadow) !important;
  backdrop-filter:none !important;
  overflow:visible !important;
}

.card::before{
  display:none !important;
}

.card:hover{
  background:var(--samir-surface) !important;
  border-color:#33445f !important;
  box-shadow:var(--samir-shadow) !important;
}

.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card .text-white{
  color:#f8fafc !important;
}

.card .text-gray-300,
.card .text-gray-400,
.text-gray-300,
.text-gray-400{
  color:#94a3b8 !important;
}

/* Useful links */
#useful-links-card{
  padding:1.25rem !important;
}

#useful-links-card .useful-links-grid{
  gap:.75rem !important;
}

#useful-links-card .useful-link-card{
  height:58px !important;
  border-radius:10px !important;
  background:#152136 !important;
  border:1px solid #2b3a52 !important;
  color:#eef4ff !important;
  padding:0 14px !important;
  box-shadow:none !important;
}

#useful-links-card .useful-link-card:hover{
  background:#192942 !important;
  border-color:#3b82f6 !important;
}

/* Forms / login */
.form-container{
  max-width:430px !important;
  margin:2rem auto !important;
  padding:1.6rem !important;
  border-radius:14px !important;
  background:var(--samir-surface) !important;
  border:1px solid var(--samir-border) !important;
  box-shadow:0 18px 50px rgba(0,0,0,.25) !important;
  backdrop-filter:none !important;
}

.form-container input,
.form-container select,
.form-container textarea,
.tb-input,
.tb-select,
input.tb-input,
textarea.tb-input,
select.tb-input,
select.tb-select{
  background:#0b1324 !important;
  color:#f8fafc !important;
  border:1px solid #2b3a52 !important;
  border-radius:9px !important;
  box-shadow:none !important;
}

.form-container input::placeholder,
.form-container textarea::placeholder,
.tb-input::placeholder,
input.tb-input::placeholder,
textarea.tb-input::placeholder{
  color:#7f8ea6 !important;
}

.form-container input:focus,
.form-container select:focus,
.form-container textarea:focus,
.tb-input:focus,
.tb-select:focus{
  border-color:#3b82f6 !important;
  box-shadow:0 0 0 3px rgba(59,130,246,.15) !important;
  outline:none !important;
}

.form-container .relative label,
.form-container label{
  color:#cbd5e1 !important;
}

.form-container .relative input:focus + label,
.form-container .relative input:not(:placeholder-shown) + label,
.form-container .relative select:focus + label,
.form-container .relative select:not(:placeholder-shown) + label{
  color:#93c5fd !important;
}

/* Buttons */
.btn,
.btn-sm{
  background:#2563eb !important;
  color:#fff !important;
  border:1px solid #3b82f6 !important;
  border-radius:9px !important;
  box-shadow:none !important;
  font-weight:700 !important;
}

.btn::before,
.btn-sm::before{
  display:none !important;
}

.btn:hover,
.btn-sm:hover{
  background:#1d4ed8 !important;
  border-color:#60a5fa !important;
  box-shadow:none !important;
}

.btn-danger{
  background:#b91c1c !important;
  border-color:#dc2626 !important;
}

.btn-danger:hover{
  background:#991b1b !important;
}

.btn-ghost{
  background:#172033 !important;
  border-color:#334155 !important;
  color:#e2e8f0 !important;
}

.link-button{
  background:#2563eb !important;
  border:1px solid #3b82f6 !important;
  color:#fff !important;
  border-radius:9px !important;
  box-shadow:none !important;
}

/* Tables and data-heavy admin screens */
table{
  border-collapse:separate !important;
  border-spacing:0 !important;
}

th{
  color:#dbeafe !important;
}

td{
  color:#e5edf8 !important;
}

table th,
table td{
  border-color:#29364b !important;
}

.overflow-x-auto{
  border-radius:12px !important;
}

/* Native select options need a readable palette */
select option{
  background:#fff !important;
  color:#111827 !important;
}

/* Toasts */
.toast{
  background:#111827 !important;
  border:1px solid #334155 !important;
  color:#f8fafc !important;
  border-radius:10px !important;
  box-shadow:0 14px 40px rgba(0,0,0,.28) !important;
}

/* AI widget */
.aiw-toggle{
  background:#2563eb !important;
  border:1px solid #3b82f6 !important;
  opacity:.92 !important;
  box-shadow:0 10px 30px rgba(0,0,0,.25) !important;
}

.aiw-panel{
  background:#0f172a !important;
  border:1px solid #334155 !important;
  border-radius:14px !important;
  box-shadow:0 20px 60px rgba(0,0,0,.4) !important;
}

.aiw-header,
.aiw-input{
  background:#111827 !important;
  border-color:#263246 !important;
}

.aiw-input input{
  background:#0b1324 !important;
  border-color:#2b3a52 !important;
}

/* Status pills / generic white-transparent utility remnants */
.bg-white\/10{
  background-color:#172033 !important;
}
.border-white\/20,
.border-white\/10{
  border-color:#334155 !important;
}

/* Keep destructive dialogs / overlays visually distinct */
.modal-content{
  border-color:#334155 !important;
}

/* Mobile */
@media (max-width:640px){
  .header{
    position:relative !important;
    padding:.55rem 0 !important;
  }

  .header .container{
    gap:.7rem !important;
  }

  .logo{
    max-width:135px !important;
    max-height:64px !important;
  }

  .nav-links{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:.5rem !important;
    width:100% !important;
  }

  .nav-links a{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    min-height:42px !important;
    height:42px !important;
    padding:0 .65rem !important;
  }

  .nav-links a::after{
    color:#dbeafe !important;
    font-weight:600 !important;
    font-size:.85rem !important;
  }

  .top-search{
    gap:.45rem !important;
  }

  .title{
    font-size:1.75rem !important;
    margin-top:.8rem !important;
  }

  .card,
  .form-container{
    border-radius:12px !important;
    padding:1rem !important;
  }

  #useful-links-card .useful-links-grid{
    grid-template-columns:1fr !important;
  }
}
