/* ============================================================
   panel.css — Settings paneli ve detay paneli stilleri
   Amazon Affiliate ROI Aracı
   ============================================================ */

/* ─── Sidebar / Settings Panel — Sağ Çekmece (Overlay Drawer) ── */
.app-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 320px;
  max-width: 90vw;
  background-color: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.28s ease;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  box-shadow: none;
}

.app-sidebar.sidebar--open {
  transform: translateX(0);
  box-shadow: -4px 0 32px rgba(0,0,0,0.45);
}

.app-sidebar::-webkit-scrollbar {
  width: 4px;
}

.app-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 2px;
}

/* ─── Panel Header ─────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-header__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-header__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}

.panel-header__toggle:hover {
  color: var(--text-primary);
  background: rgba(255,102,0,0.1);
}

/* ─── Sidebar Backdrop (click outside to close) ─────────────── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Panel Body ───────────────────────────────────────────── */
.panel-body {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Panel Section ────────────────────────────────────────── */
.panel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-section__title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ─── Form Elements ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-label--inline {
  flex: 1;
  white-space: nowrap;
}

.form-input {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.2);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input--sm {
  padding: 5px 8px;
  font-size: 0.75rem;
}

.form-input--inline {
  width: 90px;
  text-align: right;
}

.form-select {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.2);
}

/* Shipping mode toggle */
.shipping-mode-group {
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.shipping-mode-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.shipping-mode-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ─── Market Rate Rows ─────────────────────────────────────── */
.market-rate-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-rate-row__flag {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.market-rate-row__flag img {
  width: 18px;
  height: 13px;
  border-radius: 2px;
}

.market-rate-row .form-input {
  width: 80px;
  text-align: right;
  flex-shrink: 0;
}

/* ─── Affiliate Tags ───────────────────────────────────────── */
.affiliate-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.affiliate-row__locale {
  width: 36px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  flex-shrink: 0;
}

.affiliate-row .form-input {
  flex: 1;
}

/* ─── Panel Footer Buttons ─────────────────────────────────── */
.panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.panel-footer .btn {
  width: 100%;
  justify-content: center;
}

.panel-footer__secondary {
  display: flex;
  gap: 6px;
}

.panel-footer__secondary .btn {
  flex: 1;
  font-size: 0.73rem;
  padding: 6px 8px;
}

/* ─── Import/Export File Input ─────────────────────────────── */
.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ─── Tooltip ──────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #1e293b;
  color: #ffffff;
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 200;
  max-width: 220px;
  white-space: normal;
  text-align: center;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ─── Section Accordion (collapsible panel sections) ────────── */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.accordion + .accordion {
  margin-top: 8px;
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  transition: background var(--transition);
}

.accordion__trigger:hover {
  background: rgba(255, 102, 0, 0.06);
}

.accordion__chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.accordion.open .accordion__chevron {
  transform: rotate(180deg);
}

.accordion__body {
  display: none;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.accordion.open .accordion__body {
  display: block;
}

/* ─── Status Badge ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--success { background: rgba(34, 197, 94, 0.15);  color: #22c55e; }
.badge--warn    { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge--danger  { background: rgba(239, 68, 68, 0.15);  color: #ef4444; }
.badge--info    { background: rgba(59, 130, 246, 0.15);  color: #3b82f6; }

/* ── Settings open trigger button in header ── */
.sidebar-open-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

.sidebar-open-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-row-hover);
}

