/* ==========================================================================
   ADRA - Reklam Ödəniş Hesablayıcısı
   Premium Light Theme Glassmorphism & Mobile-First CSS Dizayn Sistemi
   ========================================================================== */

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

:root {
  /* HSL Rəng Palitrası (Premium Light Theme) */
  --bg-main: hsl(220, 30%, 96%);
  /* Zərif açıq boz/mavi fon */
  --bg-card: rgba(255, 255, 255, 0.7);
  /* Şüşə effekti üçün ağ fon */
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(148, 163, 184, 0.16);
  --border-glow: hsla(263, 85%, 55%, 0.2);

  --primary: hsl(263, 85%, 55%);
  /* Göy/Bənövşəyi əsas rəng */
  --primary-glow: hsla(263, 85%, 55%, 0.12);
  --secondary: hsl(195, 85%, 45%);
  /* Neon mavi */
  --secondary-glow: hsla(195, 85%, 45%, 0.12);

  --text-primary: hsl(222, 47%, 12%);
  /* Tünd boz əsas mətn */
  --text-secondary: hsl(220, 16%, 36%);
  /* Orta tünd yardımçı mətn */
  --text-muted: hsl(220, 12%, 55%);

  --success: hsl(150, 75%, 38%);
  --success-glow: hsla(150, 75%, 38%, 0.12);
  --danger: hsl(355, 75%, 50%);
  --danger-glow: hsla(355, 75%, 50%, 0.12);
  --warning: hsl(35, 90%, 45%);

  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, hsl(280, 80%, 50%) 100%);
  --gradient-secondary: linear-gradient(135deg, hsl(190, 85%, 40%) 0%, hsl(210, 85%, 45%) 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.6) 100%);
  --gradient-accent: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);

  --font-family: 'Inter', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  --glass-blur: blur(20px);
  --shadow-main: 0 10px 30px -5px rgba(13, 20, 46, 0.06), 0 4px 18px -4px rgba(13, 20, 46, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --shadow-glow: 0 4px 14px 0 hsla(263, 85%, 55%, 0.2);
  --shadow-glow-success: 0 4px 14px 0 hsla(150, 75%, 38%, 0.2);

  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 8px;
}

/* ==========================================================================
   Əsas Elementlər
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  /* Mobil üçün arxa fonda çox yüngül zərif radial dairələr */
  background-image:
    radial-gradient(circle at 10% 20%, hsla(263, 90%, 65%, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, hsla(190, 90%, 50%, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Xüsusi Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================================================
   Header dizaynı
   ========================================================================== */

header {
  backdrop-filter: var(--glass-blur);
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Header Tabs Naviqasiyası */
.header-tabs {
  margin: 0;
  background: rgba(241, 245, 249, 0.75);
  padding: 4px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.header-tabs .tab-btn {
  padding: 8px 18px;
  min-height: 38px;
  font-size: 0.9rem;
}

@media (min-width: 992px) {
  header {
    padding: 0.65rem 2rem;
  }

  .header-tabs {
    min-width: 320px;
    max-width: 440px;
  }
}

@media (max-width: 991px) {
  header {
    flex-wrap: wrap;
    row-gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .logo-section {
    order: 1;
  }

  .header-controls {
    order: 2;
  }

  .header-tabs {
    order: 3;
    width: 100%;
  }
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-box {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  animation: float 4s ease-in-out infinite;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 1px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sync-header {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--primary, #6366f1);
  padding: 8px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: var(--border-radius-md, 14px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.08);
  flex-shrink: 0;
}

.btn-sync-header:hover {
  background: var(--primary, #6366f1);
  color: #ffffff;
  border-color: var(--primary, #6366f1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-sync-header:active {
  transform: translateY(0);
}

.btn-sync-header.loading svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#btnHistory {
  position: relative;
  padding: 8px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: var(--border-radius-md, 14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#btnHistory .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Düymə və İkon Dizaynı (Mobil üçün Touch-Friendly)
   ========================================================================== */

.btn {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: var(--text-primary);
  padding: 12px 20px;
  min-height: 48px;
  /* Mobil üçün minimum touch hündürlüyü */
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
  backdrop-filter: var(--glass-blur);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:hover:not(.btn-primary):not(.btn-success):not(.btn-danger) {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(13, 20, 46, 0.05);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
  box-shadow: var(--shadow-glow);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px 0 hsla(263, 85%, 55%, 0.3);
  border-color: transparent;
}

.btn-primary svg,
.btn-success svg,
.btn-danger svg {
  stroke: #ffffff !important;
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, hsl(160, 75%, 35%) 100%);
  border: none;
  color: #fff;
}

.btn-success:hover {
  filter: brightness(1.05);
  box-shadow: var(--shadow-glow-success);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, hsl(355, 75%, 45%) 100%);
  border: none;
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 15px 0 var(--danger-glow);
}

.btn-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--border-radius-md);
  position: relative;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #ffffff;
}

/* ==========================================================================
   Main Layout & Grid
   ========================================================================== */

main {
  flex: 1;
  max-width: 850px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Telefon və tabletlər üçün tək sütunlu layout */
@media (max-width: 992px) {
  main {
    padding: 1rem;
    gap: 1rem;
  }
}

.card {
  background: var(--gradient-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-main);
  transition: var(--transition-smooth);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-title svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

/* ==========================================================================
   Form elementləri (Mobil-Dostu İpucları)
   ========================================================================== */

.form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  /* Mobil iOS zoom-un qarşısını almaq üçün 16px */
  transition: var(--transition-smooth);
  outline: none;
  -webkit-appearance: none;
  /* iOS-da default görünüşü ləğv et */
  appearance: none;
}

/* Select sahəsi üçün özəl dizayn edilmiş SVG oxu */
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(71, 85, 105, 0.8)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  background: #ffffff;
}

/* Nömrə sahələri üçün xüsusi dizayn */
.input-with-suffix {
  position: relative;
}

.input-with-suffix input {
  padding-right: 44px;
}

.input-suffix {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  pointer-events: none;
}

/* ==========================================================================
   Canlı Hesablama Paneli (Live Preview)
   ========================================================================== */

.live-preview {
  margin-top: 1.5rem;
  background: hsla(263, 85%, 55%, 0.04);
  border: 1.5px dashed rgba(263, 85%, 55%, 0.25);
  border-radius: var(--border-radius-md);
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
  text-align: center;
}

.preview-box {
  padding: 4px;
}

.preview-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 2px;
}

.preview-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  transition: var(--transition-fast);
}

.preview-value.price {
  color: var(--success);
}

/* ==========================================================================
   Siyahı və Cədvəl (Mobil üçün Tamamilə Adaptiv)
   ========================================================================== */

.table-container {
  margin-bottom: 1rem;
  min-height: 100px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.item-row {
  transition: var(--transition-smooth);
}

.item-row:hover {
  background: rgba(255, 255, 255, 0.4);
}

.row-actions {
  display: flex;
  gap: 6px;
}

.btn-row-action {
  width: 36px;
  /* Mobil toxunuş üçün bir az böyük */
  height: 36px;
  padding: 0;
  border-radius: var(--border-radius-sm);
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-row-action:active {
  transform: scale(0.95);
}

.btn-row-action.edit {
  color: var(--primary);
  border-color: var(--primary-glow);
  background: var(--primary-glow);
}

.btn-row-action.edit:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-row-action.delete {
  color: var(--danger);
  border-color: var(--danger-glow);
  background: var(--danger-glow);
}

.btn-row-action.delete:hover {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.btn-row-action svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.item-total-mobile {
  display: none;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 0;
  color: var(--text-muted);
  gap: 10px;
}

.empty-state svg {
  width: 44px;
  height: 44px;
  stroke: var(--text-muted);
}

/* --------------------------------------------------------------------------
   CƏDVƏLİN MOBİLDƏ KART SİYAHISINA ÇEVRİLMƏSİ (Responsiveness)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
    /* Sütun başlıqlarını gizlədirik */
  }

  tr.item-row {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    margin-bottom: 12px;
    padding: 10px 14px;
    position: relative;
    box-shadow: 0 4px 12px rgba(13, 20, 46, 0.02);
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;
  }

  td {
    border-bottom: none;
    padding: 6px 0;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    font-size: 0.88rem;
    box-sizing: border-box;
    white-space: nowrap;
  }

  /* data-label ilə başlığı sol tərəfə əlavə edirik */
  td:before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-right: 6px;
  }

  td[data-label="Reklam Növü"] {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 4px;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    white-space: normal;
  }

  td[data-label="Reklam Növü"]:before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-right: auto;
    margin-bottom: 0;
  }

  td[data-label="Reklam Növü"] .ad-type-title {
    font-weight: 800;
    color: var(--text-primary);
    font-size: 0.95rem;
    text-align: right;
    margin-left: auto;
  }

  td[data-label="Reklam Növü"] .ad-custom-name {
    width: 100% !important;
    font-weight: 700 !important;
    color: var(--primary) !important;
    font-size: 0.92rem !important;
    text-align: left !important;
    margin-top: 6px !important;
    display: block !important;
  }

  td[data-label="Ölçü"] {
    width: 58%;
    padding-right: 4px;
  }

  td[data-label="Sahə"] {
    width: 42%;
    padding-left: 4px;
  }

  td[data-label="Rüsum"] {
    width: 58%;
    padding-right: 4px;
  }

  td[data-label="Yayım"] {
    width: 42%;
    padding-left: 4px;
  }

  td.row-actions-cell {
    width: 100% !important;
    border-top: 1px solid var(--border-color);
    margin-top: 6px;
    padding-top: 10px;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .item-total-mobile {
    display: block !important;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    margin-right: auto !important;
    /* Düymələri tam sağa sıxışdırıb cəmi sola yaslayır */
  }

  .item-total-mobile strong {
    color: var(--primary);
    font-size: 1rem;
    margin-left: 4px;
  }
}

/* ==========================================================================
   Məbləğ bloku (Summary Block)
   ========================================================================== */

.summary-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.summary-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.summary-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px dashed var(--border-color);
}

.summary-value-small {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.summary-grid-vat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: rgba(148, 163, 184, 0.03);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 0.6rem 1rem;
}

.vat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.vat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-grid-middle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.main-item {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  gap: 2px;
  transition: var(--transition-smooth);
}

.main-item:hover {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(13, 20, 46, 0.03);
}

.main-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Rüsum ödənişi, Yayım haqqı (Cəmi) və Yekun Cəm eyni fontda olsun */
.main-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.main-value.highlight-yayim {
  color: var(--success);
}

.main-value.highlight-rusum {
  color: var(--primary);
}

/* Yekun Cəm (Ən altdakı sətir, tam en) */
.summary-row-bottom {
  width: 100%;
}

.yekun-item {
  display: flex;
  flex-direction: column;
  background: var(--gradient-primary);
  color: #ffffff;
  border-radius: var(--border-radius-md);
  padding: 0.9rem 1.25rem;
  box-shadow: var(--shadow-glow);
  gap: 4px;
}

.yekun-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.yekun-discount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  padding: 6px 10px;
  margin-top: 5px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  gap: 8px;
  box-sizing: border-box;
}

.yekun-discount-row:hover {
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Ultra-Modern Switch (Kompakt və Mobil Uyğun) */
.modern-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
  flex-shrink: 0;
}

.modern-switch-text {
  font-weight: 700;
  font-size: 0.88rem;
  color: #ffffff;
}

.modern-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.modern-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  pointer-events: none;
}

.modern-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.22);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 22px;
}

.modern-switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 1.5px;
  background: #ffffff;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.modern-switch input:checked + .modern-switch-slider {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.modern-switch input:checked + .modern-switch-slider:before {
  transform: translateX(16px);
}

.modern-switch:hover .modern-switch-slider {
  border-color: rgba(255, 255, 255, 0.7);
}

.yekun-discount-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.yekun-discount-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 2px 8px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.8rem;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.yekun-discount-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  text-align: right;
}

.yekun-discount-amount {
  font-weight: 800;
  font-size: 1.05rem;
  color: #a7f3d0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.3px;
}

/* Reklam adı və növü göstərilməsi */
.ad-name-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}

.ad-type-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.ad-custom-name {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.88rem;
  line-height: 1.25;
}

.yekun-sub-row {
  display: none;
  /* JS ilə idarə olunacaq */
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.9;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 4px;
  margin-top: 2px;
}

.yekun-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.yekun-value {
  font-size: 1.5rem;
  /* Tamamilə eyni font ölçüsü */
  font-weight: 800;
  line-height: 1.2;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

/* Siyahı cəmi və düymələr mobil telefonda alt-alta yığılır */
@media (max-width: 576px) {
  .summary-block {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }

  .summary-grid-vat {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
  }

  .summary-grid-middle {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .main-value,
  .yekun-value {
    font-size: 1.2rem;
    /* Mobildə eyni font ölçüsü */
  }

  .yekun-item {
    padding: 0.75rem 1rem;
  }

  .action-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .action-buttons .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Yadda Saxlanılanlar - Drawer (Sağ Panel)
   ========================================================================== */

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 20, 46, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  background: #ffffff;
  border-left: 1px solid var(--border-color);
  z-index: 1001;
  box-shadow: -10px 0 35px rgba(13, 20, 46, 0.1);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobil telefonlarda drawer ekranı tam örtür */
@media (max-width: 600px) {
  .drawer {
    width: 100%;
    right: -100%;
  }
}

.drawer.active {
  right: 0;
}

.drawer-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.drawer-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.drawer-close:hover {
  color: var(--text-primary);
  transform: rotate(90deg);
}

.drawer-close svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

/* Yadda saxlanılan element kartları */
.saved-item-card {
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.15rem;
  margin-bottom: 0.75rem;
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.saved-item-card:hover {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(13, 20, 46, 0.04);
}

.saved-item-card.active {
  border-color: var(--success);
  background: hsla(150, 75%, 38%, 0.03);
}

.saved-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.saved-item-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
  padding-right: 32px;
  /* sil düyməsinin altda qalmaması üçün */
}

.saved-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.saved-item-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.85rem;
}

.saved-item-desc {
  color: var(--text-secondary);
  font-weight: 500;
}

.saved-item-price {
  font-weight: 700;
  color: var(--success);
}

.saved-item-actions {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
}

.btn-card-delete {
  background: rgba(355, 75, 50, 0.08);
  color: var(--danger);
  border: 1px solid rgba(355, 75, 50, 0.2);
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-card-delete:hover {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.btn-card-delete svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ==========================================================================
   Bildiriş Sistemi (Toasts)
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  left: 1.5rem;
  /* Mobil ekranlarda sola da sıxılsın */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 576px) {
  .toast-container {
    left: auto;
    width: 320px;
  }
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 25px rgba(13, 20, 46, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: var(--transition-smooth);
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-info {
  border-left: 4px solid var(--secondary);
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 18px;
  height: 18px;
}

.toast-icon.success svg {
  color: var(--success);
}

.toast-icon.error svg {
  color: var(--danger);
}

.toast-icon.info svg {
  color: var(--secondary);
}

.toast-message {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ==========================================================================
   Modal/Dialog (Yadda saxla üçün başlığı daxil etmə)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 20, 46, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 45px rgba(13, 20, 46, 0.15);
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  margin-bottom: 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  margin-bottom: 1.25rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Mobil telefonda modal düymələrini yan-yana tam yerləşdiririk */
@media (max-width: 480px) {
  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   Animasiyalar
   ========================================================================== */

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-4px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes slideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ==========================================================================
   Lüğət Axtarışı & Tab Naviqasiya Dizaynı
   ========================================================================== */

.tabs-container {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: var(--glass-blur);
  padding: 6px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(13, 20, 46, 0.02);
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn svg {
  width: 20px;
  height: 20px;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-main);
}

.tab-btn.active svg {
  color: var(--primary);
}

.tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.4);
  color: var(--text-primary);
}

.tab-content {
  transition: var(--transition-smooth);
}

/* Lüğət Bölməsi Elementləri */
.search-group {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon svg {
  width: 20px;
  height: 20px;
}

.search-input {
  padding-left: 48px !important;
}

.dict-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  padding: 0 4px;
}

.dict-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding: 6px 4px;
  border-radius: var(--border-radius-sm);
}

.dict-word-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 8px rgba(13, 20, 46, 0.01);
}

.dict-word-card:hover {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: var(--shadow-main);
  transform: translateY(-1.5px);
}

.dict-word-card .word-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 3px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(263, 85, 55, 0.1);
}

/* Spinner yüklənmə animasiyası */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--primary-glow);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 576px) {
  .dict-results {
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 400px;
  }

  .tab-btn {
    font-size: 0.85rem;
    padding: 10px 8px;
  }
}

/* Qlobal Ayarlar Grid Sistemi */
.settings-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
  width: 100%;
}

@media (max-width: 576px) {
  .settings-grid {
    grid-template-columns: 1.6fr 1fr;
    gap: 0.75rem;
  }
}

/* ==========================================================================
   Modern Xüsusi Seçim Menyusu (Custom Select)
   ========================================================================== */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-wrapper.open {
  z-index: 50;
}

.custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.custom-select-trigger:hover {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(13, 20, 46, 0.05);
}

.custom-select-wrapper.open .custom-select-trigger {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  background: #ffffff;
}

.custom-select-trigger .chevron {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.custom-select-wrapper.open .chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.custom-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 15px 35px rgba(13, 20, 46, 0.12);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
  overflow: hidden;
  padding: 4px;
}

.custom-select-wrapper.open .custom-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-option {
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 10px;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.custom-option:hover {
  background: var(--primary-glow);
  color: var(--primary);
}

.custom-option.selected {
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 700;
}

.custom-option.selected::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 9px;
  border: solid var(--primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-right: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   Tərəflərin Sayı Üçün Sayğac (Counter) Stilləri
   ========================================================================== */
.counter-input {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  width: 100%;
}

.counter-input:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  background: #ffffff;
}

.counter-input input {
  border: none !important;
  border-radius: 0 !important;
  text-align: center;
  padding: 14px 0 !important;
  background: transparent !important;
  font-weight: 700;
  font-size: 1.1rem;
  width: 100%;
  outline: none !important;
  box-shadow: none !important;
  -moz-appearance: textfield;
}

.counter-input input::-webkit-outer-spin-button,
.counter-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-counter {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 600;
  width: 60px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-counter:hover {
  background: var(--primary-glow);
  color: var(--primary);
}

.btn-counter:active {
  background: rgba(263, 85, 55, 0.15);
}