/* ============================================
   Notika - style.css
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1117;
  --bg2:       #161b27;
  --bg3:       #1e2436;
  --border:    #2a3145;
  --primary:   #3b82f6;
  --primary-h: #2563eb;
  --teal:      #14b8a6;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --danger:    #ef4444;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

body { font-family: 'Vazirmatn', Tahoma, sans-serif; background: var(--bg); color: var(--text);
       direction: rtl; font-size: 15px; min-height: 100vh; }

/* ─── Utilities ─────────────────────────────── */
.hidden { display: none !important; }
.w-full { width: 100%; }
.text-muted { color: var(--muted); font-size: 13px; }

/* ─── Buttons ───────────────────────────────── */
.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: 8px;
               padding: 10px 20px; cursor: pointer; font-family: inherit; font-size: 14px;
               font-weight: 600; transition: background .2s, transform .1s; }
.btn-primary:hover { background: var(--primary-h); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { background: var(--bg3); color: var(--muted); cursor: not-allowed; }

.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border);
               border-radius: 8px; padding: 9px 18px; cursor: pointer; font-family: inherit;
               font-size: 14px; font-weight: 500; transition: border-color .2s; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); border: none;
             border-radius: 8px; padding: 10px 20px; cursor: pointer; font-family: inherit;
             font-size: 14px; transition: background .2s; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }

.btn-link { background: none; border: none; color: var(--primary); cursor: pointer;
            font-family: inherit; text-decoration: underline; }

.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 10px; }

.btn-logout { background: none; border: 1px solid var(--border); color: var(--muted);
              border-radius: 8px; padding: 8px 14px; cursor: pointer; font-family: inherit;
              font-size: 13px; width: 100%; margin-top: 12px; transition: color .2s; }
.btn-logout:hover { color: var(--danger); border-color: var(--danger); }

/* ─── Inputs ────────────────────────────────── */
.input-field { width: 100%; background: var(--bg3); border: 1.5px solid var(--border);
               color: var(--text); border-radius: 8px; padding: 11px 14px; font-family: inherit;
               font-size: 14px; outline: none; transition: border-color .2s; margin-bottom: 12px; }
.input-field:focus { border-color: var(--primary); }
.input-group { display: flex; gap: 10px; }
.input-group .input-field { margin-bottom: 0; }

/* ─── Alerts ────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error   { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.35); color: #fcd34d; }
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); color: #86efac; }

/* ─── LANDING ────────────────────────────────── */
.nav-bar { display: flex; align-items: center; justify-content: space-between;
           padding: 18px 60px; position: sticky; top: 0; z-index: 100;
           background: rgba(15,17,23,.9); backdrop-filter: blur(12px);
           border-bottom: 1px solid var(--border); }
.logo { font-size: 22px; font-weight: 800; color: var(--primary); }
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: var(--text); }

.hero { text-align: center; padding: 100px 20px 80px; max-width: 700px; margin: 0 auto; }
.hero-badge { display: inline-block; background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.3);
              color: var(--primary); border-radius: 20px; padding: 5px 16px; font-size: 13px;
              font-weight: 600; margin-bottom: 24px; }
.hero h1 { font-size: 52px; font-weight: 800; line-height: 1.3; color: #fff; margin-bottom: 20px; }
.hero p  { font-size: 18px; color: var(--muted); line-height: 1.7; margin-bottom: 36px; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; justify-content: center; gap: 48px; }
.hero-stats div { text-align: center; }
.hero-stats strong { display: block; font-size: 28px; font-weight: 800; color: var(--teal); }
.hero-stats span { font-size: 13px; color: var(--muted); }

.features { padding: 80px 60px; text-align: center; }
.features h2 { font-size: 32px; font-weight: 700; margin-bottom: 48px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 24px; max-width: 1100px; margin: 0 auto; }
.feature-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
                padding: 28px 24px; text-align: center; transition: border-color .2s, transform .2s; }
.feature-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.feature-icon { font-size: 32px; margin-bottom: 14px; }
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }

.pricing { padding: 80px 60px; text-align: center; }
.pricing h2 { font-size: 32px; font-weight: 700; margin-bottom: 48px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
                gap: 24px; max-width: 900px; margin: 0 auto; }
.pricing-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
                padding: 32px 28px; position: relative; text-align: right; }
.pricing-card.popular { border-color: var(--primary); }
.popular-badge { display: inline-block; background: var(--primary); color: #fff; border-radius: 20px;
                 padding: 3px 12px; font-size: 12px; font-weight: 700; margin-bottom: 14px; }
.plan-name  { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.plan-price { font-size: 28px; font-weight: 800; color: var(--primary); margin-bottom: 24px; }
.plan-price span { font-size: 14px; color: var(--muted); font-weight: 400; margin-right: 6px; }
.pricing-card ul { list-style: none; margin-bottom: 28px; }
.pricing-card li { padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.pricing-card li:last-child { border: none; }

.site-footer { text-align: center; padding: 40px; color: var(--muted); font-size: 13px;
               border-top: 1px solid var(--border); }

/* ─── APP LAYOUT ─────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }

.sidebar { width: 260px; min-width: 260px; background: var(--bg2); border-left: 1px solid var(--border);
           display: flex; flex-direction: column; padding: 24px 0; overflow-y: auto; }
.sidebar-logo { font-size: 20px; font-weight: 800; color: var(--primary); padding: 0 20px 24px; }

.sidebar-nav { flex: 1; }
.nav-item { display: block; padding: 11px 20px; color: var(--muted); text-decoration: none;
            font-size: 14px; transition: background .15s, color .15s; border-radius: 8px; margin: 2px 8px; }
.nav-item:hover  { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(59,130,246,.15); color: var(--primary); font-weight: 600; }
.nav-item.upgrade { color: var(--warning); }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.user-name  { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.user-plan  { font-size: 12px; border-radius: 4px; padding: 2px 8px; display: inline-block;
              margin-bottom: 10px; }
.plan-badge-free { background: rgba(100,116,139,.2); color: var(--muted); }
.plan-badge-basic { background: rgba(59,130,246,.2); color: var(--primary); }
.plan-badge-pro   { background: rgba(20,184,166,.2); color: var(--teal); }
.plan-badge-enterprise { background: rgba(245,158,11,.2); color: var(--warning); }

.usage-text  { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.usage-track { background: var(--border); border-radius: 4px; height: 4px; }
.usage-fill  { background: var(--primary); border-radius: 4px; height: 4px; transition: width .3s; }

.main-content { flex: 1; overflow-y: auto; padding: 32px 40px; }
.page-title   { font-size: 24px; font-weight: 700; margin-bottom: 28px; }

/* ─── Input Cards ────────────────────────────── */
.input-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 20px; }
.input-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
              padding: 28px; position: relative; overflow: hidden; transition: border-color .2s; }
.input-card:hover { border-color: rgba(59,130,246,.4); }
.input-card.card-locked { opacity: .6; pointer-events: none; }
.card-icon { font-size: 28px; margin-bottom: 12px; }
.input-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.input-card p  { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }

.lock-overlay { position: absolute; inset: 0; background: rgba(15,17,23,.6); backdrop-filter: blur(4px);
                display: flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.lock-overlay span { background: var(--warning); color: #000; border-radius: 8px; padding: 8px 18px;
                     font-weight: 700; font-size: 14px; cursor: pointer; }

/* Drop Zone */
.drop-zone { border: 2px dashed var(--border); border-radius: 8px; padding: 28px 20px;
             text-align: center; cursor: pointer; transition: border-color .2s; margin-bottom: 14px; }
.drop-zone:hover { border-color: var(--primary); }
.drop-zone.drag-over { border-color: var(--primary); background: rgba(59,130,246,.08); }
.drop-icon { font-size: 24px; display: block; margin-bottom: 8px; }
#drop-placeholder { color: var(--muted); font-size: 13px; }
#file-selected { display: flex; align-items: center; justify-content: space-between; }
#file-selected span { font-size: 13px; color: var(--text); }
#file-selected button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }

/* Recorder */
.recorder-ui { text-align: center; margin-bottom: 16px; }
.rec-btn { background: var(--bg3); border: 2px solid var(--border); color: var(--text);
           border-radius: 50px; padding: 12px 22px; cursor: pointer; font-family: inherit;
           font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
           transition: all .2s; }
.rec-btn:hover { border-color: var(--danger); color: var(--danger); }
.rec-btn.recording { border-color: var(--danger); background: rgba(239,68,68,.1); color: var(--danger); }
.rec-btn-blue:hover { border-color: var(--primary); color: var(--primary); }
.rec-btn-blue.recording { border-color: var(--primary); background: rgba(59,130,246,.1); color: var(--primary); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.rec-dot-blue { background: var(--primary); }
.recording .rec-dot { animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.rec-timer { font-size: 22px; font-weight: 700; color: var(--danger); margin-top: 10px; }

audio { width: 100%; margin-top: 10px; border-radius: 8px; }

/* Processing */
.processing-spinner { text-align: center; padding: 60px 20px; }
.spinner { width: 48px; height: 48px; border: 4px solid var(--border); border-top-color: var(--primary);
           border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Result ─────────────────────────────────── */
.result-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
               padding: 28px; margin-top: 24px; }
.result-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.result-title { font-size: 20px; font-weight: 700; }
.result-actions { display: flex; gap: 10px; }
.result-section { margin-bottom: 24px; }
.result-section h3 { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 10px;
                     padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.result-section ul { padding-right: 18px; }
.result-section li { margin-bottom: 5px; font-size: 14px; line-height: 1.6; }
.result-section p  { font-size: 14px; line-height: 1.8; white-space: pre-wrap; color: #cbd5e1; }
.action-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.action-table th { background: var(--bg3); padding: 8px 12px; font-weight: 600;
                   text-align: right; border: 1px solid var(--border); }
.action-table td { padding: 8px 12px; border: 1px solid var(--border); vertical-align: top; line-height: 1.5; }
.action-table tr:nth-child(even) td { background: rgba(255,255,255,.02); }

/* ─── History ────────────────────────────────── */
.history-item { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
                padding: 16px 20px; margin-bottom: 12px; display: flex; align-items: center;
                justify-content: space-between; cursor: pointer; transition: border-color .2s; }
.history-item:hover { border-color: var(--primary); }
.history-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.history-meta { font-size: 12px; color: var(--muted); }
.status-badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; }
.status-done       { background: rgba(34,197,94,.15); color: #86efac; }
.status-processing { background: rgba(245,158,11,.15); color: #fcd34d; }
.status-failed     { background: rgba(239,68,68,.15); color: #fca5a5; }

/* ─── Settings ───────────────────────────────── */
.settings-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
                 padding: 24px; margin-bottom: 20px; }
.settings-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.settings-card p { font-size: 14px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }

/* ─── Modal ──────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
         z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
             padding: 36px 32px; width: 100%; max-width: 420px; position: relative; }
.modal-close { position: absolute; top: 16px; left: 16px; background: none; border: none;
               color: var(--muted); font-size: 20px; cursor: pointer; }
.modal-box h2 { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.modal-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.modal-switch a { color: var(--primary); }

/* ─── Toast ──────────────────────────────────── */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
         background: var(--bg3); border: 1px solid var(--border); color: var(--text);
         padding: 12px 24px; border-radius: 10px; font-size: 14px; z-index: 300;
         box-shadow: var(--shadow); animation: fadeIn .3s; }
.toast.success { border-color: var(--success); color: #86efac; }
.toast.error   { border-color: var(--danger); color: #fca5a5; }
@keyframes fadeIn { from { opacity:0; transform: translateX(-50%) translateY(10px); } }

/* ─── View system ────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; min-width: unset; height: auto; flex-direction: row; flex-wrap: wrap;
             padding: 12px; border-left: none; border-bottom: 1px solid var(--border); }
  .sidebar-nav { display: flex; gap: 4px; }
  .sidebar-footer { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
  .main-content { padding: 20px 16px; }
  .nav-bar { padding: 14px 20px; }
  .hero h1 { font-size: 32px; }
  .features, .pricing { padding: 48px 20px; }
}

/* ─── Auth Tabs ──────────────────────────────── */
.auth-tabs { display:flex; gap:8px; margin-bottom:20px; background:var(--bg3);
             border-radius:8px; padding:4px; }
.auth-tab  { flex:1; background:none; border:none; color:var(--muted); padding:8px;
             border-radius:6px; cursor:pointer; font-family:inherit; font-size:13px;
             font-weight:500; transition:all .2s; }
.auth-tab.active { background:var(--primary); color:#fff; }

/* ─── OTP Inputs ─────────────────────────────── */
.otp-inputs { display:flex; gap:8px; justify-content:center; margin:16px 0; }
.otp-digit  { width:44px; height:52px; text-align:center; font-size:22px; font-weight:700;
              background:var(--bg3); border:2px solid var(--border); color:var(--text);
              border-radius:10px; outline:none; transition:border-color .2s;
              -moz-appearance:textfield; }
.otp-digit::-webkit-outer-spin-button,
.otp-digit::-webkit-inner-spin-button { -webkit-appearance:none; }
.otp-digit:focus { border-color:var(--primary); }

/* ─── Google Button ──────────────────────────── */
.btn-google { display:flex; align-items:center; justify-content:center; gap:10px;
              width:100%; padding:10px; background:#fff; color:#333; border:1.5px solid #ddd;
              border-radius:8px; cursor:pointer; font-family:inherit; font-size:14px;
              font-weight:500; transition:background .2s; margin-top:8px; }
.btn-google:hover { background:#f5f5f5; }
.btn-google img   { width:18px; height:18px; }

/* ─── Divider ────────────────────────────────── */
.divider-text { display:flex; align-items:center; gap:10px; color:var(--muted);
                font-size:12px; margin:12px 0; }
.divider-text::before,.divider-text::after { content:''; flex:1;
                                              height:1px; background:var(--border); }

/* ─── Plan Minutes ───────────────────────────── */
.plan-minutes { font-size:14px; color:var(--teal); margin-bottom:12px; font-weight:600; }

/* ─── Purchase Modal ─────────────────────────── */
.purchase-summary { background:var(--bg3); border-radius:10px; padding:16px; margin:16px 0; }
.purchase-row { display:flex; justify-content:space-between; padding:8px 0;
                border-bottom:1px solid var(--border); font-size:14px; }
.purchase-row:last-child { border:none; }
.total-row { font-size:16px; font-weight:700; color:var(--primary); }

/* ─── User Avatar ────────────────────────────── */
.user-avatar { width:36px; height:36px; border-radius:50%; margin-bottom:8px;
               border:2px solid var(--border); }

/* ─── History Delete ─────────────────────────── */
.history-actions { display:flex; gap:8px; align-items:center; }
.btn-delete { background:rgba(239,68,68,.1); border:1px solid rgba(239,68,68,.3);
              color:var(--danger); border-radius:6px; padding:4px 10px; cursor:pointer;
              font-size:12px; font-family:inherit; transition:all .2s; }
.btn-delete:hover { background:rgba(239,68,68,.2); }

/* ─── Minutes Warning ────────────────────────── */
.minutes-low { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

/* ─── Ticket System ──────────────────────────── */
.ticket-item { background:var(--bg2); border:1px solid var(--border); border-radius:10px;
               padding:16px 20px; margin-bottom:10px; display:flex; align-items:center;
               justify-content:space-between; cursor:pointer; transition:border-color .2s; }
.ticket-item:hover { border-color:var(--primary); }
.ticket-title { font-size:14px; font-weight:600; margin-bottom:4px; }
.ticket-meta  { font-size:12px; color:var(--muted); }
.badge-open   { background:rgba(59,130,246,.15); color:var(--primary); }
.badge-closed { background:rgba(100,116,139,.15); color:var(--muted); }

.msg-bubble { max-width:80%; padding:12px 16px; border-radius:12px; font-size:14px; line-height:1.7; }
.msg-user    { background:var(--primary); color:#fff; align-self:flex-start; border-radius:12px 12px 12px 0; }
.msg-support { background:var(--bg3); color:var(--text); align-self:flex-end; border-radius:12px 12px 0 12px; }
.msg-admin   { background:rgba(245,158,11,.15); color:var(--warning); align-self:flex-end; border-radius:12px 12px 0 12px; border:1px solid rgba(245,158,11,.3); }
.msg-wrapper { display:flex; flex-direction:column; }
.msg-wrapper.from-user   { align-items:flex-start; }
.msg-wrapper.from-support { align-items:flex-end; }
.msg-sender { font-size:11px; color:var(--muted); margin-bottom:4px; }
.msg-time   { font-size:11px; color:var(--muted); margin-top:4px; }
.ai-badge   { font-size:10px; background:rgba(139,92,246,.2); color:var(--purple);
              border-radius:4px; padding:1px 6px; margin-right:4px; }
.admin-link { text-decoration:none; }

/* ─── AI Badge بهتر ──────────────────────────── */
.ai-badge {
  display:inline-block; font-size:10px; padding:2px 8px;
  background:linear-gradient(135deg,rgba(139,92,246,.3),rgba(59,130,246,.3));
  color:#c4b5fd; border-radius:10px; border:1px solid rgba(139,92,246,.4);
  font-weight:600; margin-right:4px; vertical-align:middle;
}
.msg-support {
  border:1px solid rgba(139,92,246,.2);
  background:linear-gradient(135deg,rgba(30,36,54,.8),rgba(25,30,50,.9));
}
/* نشانگر تیکت جدید در لیست */
.ticket-item.has-reply { border-color:var(--primary); }
.ticket-item.has-reply .ticket-title::after {
  content:'● ';  color:var(--primary); margin-left:6px; font-size:10px;
}

/* ─── Progress Bar پردازش ────────────────────── */
.progress-wrap { max-width:400px; margin:20px auto 0; }
.progress-track { background:var(--bg3); border-radius:8px; height:10px; overflow:hidden; }
.progress-fill { height:100%; background:linear-gradient(90deg,var(--primary),var(--teal));
                 border-radius:8px; transition:width 1s ease; }
.progress-meta { display:flex; justify-content:space-between; margin-top:8px;
                 font-size:12px; color:var(--muted); }

/* ─── Toast info ─────────────────────────────── */
.toast.info { border-color: var(--primary); color: #93c5fd; max-width: 380px; }

/* ─── Expiry note در تاریخچه و نتیجه ──────────── */
.expiry-note { font-size: 11px; margin-top: 4px; padding: 2px 0; }
.expiry-normal { color: var(--muted); }
.expiry-urgent { color: var(--warning); font-weight: 600; }
