/* ==========================================================================
   Iran Phone & Excel Hub - Design System & Modern Dark Glassmorphic Theme
   فونت وزیرمتن، پالت رنگی اختصاصی، تم دارک مدرن، انیمیشن‌های روان و استایل شیشه‌ای
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #111726;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 56, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.6);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;

  --badge-mci: #00b4d8;
  --badge-mci-bg: rgba(0, 180, 216, 0.15);
  --badge-irancell: #ffb703;
  --badge-irancell-bg: rgba(255, 183, 3, 0.15);
  --badge-rightel: #a855f7;
  --badge-rightel-bg: rgba(168, 85, 247, 0.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 12px 36px -8px rgba(0, 0, 0, 0.5), 0 0 1px 1px var(--border-color);
  --shadow-glow: 0 0 25px rgba(79, 172, 254, 0.25);
  --shadow-emerald-glow: 0 0 25px rgba(16, 185, 129, 0.25);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  direction: rtl;
  text-align: right;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* پس‌زمینه پویا با اشکال گرادیانی محو */
body::before,
body::after {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
body::before {
  top: -150px;
  right: -100px;
  background: radial-gradient(circle, #00f2fe, #4facfe);
}
body::after {
  bottom: -150px;
  left: -100px;
  background: radial-gradient(circle, #8b5cf6, #ec4899);
}

.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 24px 80px;
}

/* ==========================================================================
   Header Section
   ========================================================================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 20px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 3px;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.pill-badge.live-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

/* ==========================================================================
   Stats Grid
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon-wrapper.cyan { background: rgba(0, 242, 254, 0.12); color: var(--accent-cyan); }
.stat-icon-wrapper.emerald { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.stat-icon-wrapper.amber { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }
.stat-icon-wrapper.blue { background: rgba(0, 180, 216, 0.12); color: var(--badge-mci); }
.stat-icon-wrapper.yellow { background: rgba(255, 183, 3, 0.12); color: var(--badge-irancell); }
.stat-icon-wrapper.purple { background: rgba(168, 85, 247, 0.12); color: var(--badge-rightel); }

.stat-info .stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   Main Grid Layout
   ========================================================================== */
.main-grid {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1100px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Glass Cards & Panels
   ========================================================================== */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #fff;
}

.panel-title svg {
  color: var(--accent-cyan);
}

/* ==========================================================================
   Tabs Component
   ========================================================================== */
.tabs-header {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 18px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #fff;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* ==========================================================================
   Dropzone Uploader
   ========================================================================== */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.04);
  box-shadow: inset 0 0 20px rgba(0, 242, 254, 0.1);
}

.dropzone-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent-cyan);
  transition: transform var(--transition-fast);
}

.dropzone:hover .dropzone-icon {
  transform: translateY(-4px) scale(1.05);
}

.dropzone h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.dropzone p {
  font-size: 12px;
  color: var(--text-muted);
}

.file-input-hidden {
  display: none;
}

/* لیست فایل‌های آپلودشده */
.uploaded-files-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 140px;
  overflow-y: auto;
}

.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  border: 1px solid var(--border-color);
}

.file-chip .name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip .remove-file {
  background: transparent;
  border: none;
  color: var(--accent-rose);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
}

/* ==========================================================================
   Textarea Input
   ========================================================================== */
.textarea-wrapper {
  position: relative;
}

.input-textarea {
  width: 100%;
  height: 180px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  line-height: 1.7;
  direction: ltr;
  text-align: left;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

.input-textarea::placeholder {
  color: var(--text-dim);
  direction: rtl;
  text-align: right;
}

.textarea-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

/* ==========================================================================
   Controls & Options
   ========================================================================== */
.options-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.format-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.format-btn {
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  direction: ltr;
}

.format-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.format-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 242, 254, 0.3);
}

.switch-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-main);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: var(--transition-fast);
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition-fast);
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--accent-gradient);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   Buttons System
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #0b0f19;
  font-weight: 700;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
}

.btn-copy {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}
.btn-copy:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}
.btn-copy.copied {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5) !important;
  color: #fff !important;
}

.btn-excel {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: var(--shadow-emerald-glow);
}
.btn-excel:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.btn-outline:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
}
.btn-danger-outline:hover {
  background: rgba(244, 63, 94, 0.1);
  border-color: var(--accent-rose);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Table & Results Panel
   ========================================================================== */
.table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.table-search-box {
  position: relative;
  min-width: 240px;
}

.table-search-box input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 36px 8px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
}
.table-search-box input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.table-search-box svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-chip {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-chip.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* جدول ریسپانسیو */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13px;
}

.custom-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.phone-cell {
  font-family: monospace, monospace;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  direction: ltr;
  text-align: right;
}

.badge-operator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.source-tag {
  font-size: 11px;
  color: var(--text-dim);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.action-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}
.action-icon-btn:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

/* وضعیت خالی جدول */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.empty-state h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* صفحه‌بندی جدول */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 12px;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.page-btn.active {
  background: var(--accent-gradient);
  color: #000;
  font-weight: 700;
  border: none;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-right: 4px solid var(--accent-emerald); }
.toast.info { border-right: 4px solid var(--accent-cyan); }
.toast.error { border-right: 4px solid var(--accent-rose); }
