/* ============================================================
   main.css — Global stiller, CSS değişkenleri, tema
   Amazon Affiliate ROI Aracı
   ============================================================ */

/* ─── CSS Değişkenleri ─────────────────────────────────────── */
:root {
  --bg-primary:   #FFF8F5;
  --bg-secondary: #FFFFFF;
  --bg-row-hover: #FFF3EE;
  --text-primary: #1e293b;
  --text-muted:   #64748b;
  --border:       #FDDCC8;
  --accent:       #FF6600;

  /* Ek yardımcı değişkenler */
  --accent-hover:    #E55100;
  --success:         #2ECC71;
  --warning:         #F59E0B;
  --danger:          #E74C3C;
  --radius-sm:       4px;
  --radius-md:       8px;
  --radius-lg:       12px;
  --shadow-sm:       0 1px 3px rgba(255, 102, 0, 0.08);
  --shadow-md:       0 4px 12px rgba(255, 102, 0, 0.08);
  --transition:      0.18s ease;
  --sidebar-width:   280px;
  --header-height:   56px;
  --font-family:     'Inter', system-ui, -apple-system, BlinkMacSystemFont,
                     'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ─── Global Reset ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font-family: inherit;
}

/* ─── ROI Renk Sınıfları ───────────────────────────────────── */
.roi-green  { color: #22c55e; font-weight: 600; }
.roi-yellow { color: #f59e0b; font-weight: 600; }
.roi-red    { color: #ef4444; font-weight: 600; }

/* ─── Layout ───────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-height);
  padding: 0 20px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.app-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.app-header__logo img {
  width: 28px;
  height: 28px;
}

.app-header__meta {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Admin panel link */
.admin-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.admin-link-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* Lang switcher */
.lang-switcher {
  display: flex;
  gap: 4px;
}

.lang-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.lang-btn.active,
.lang-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Main Content Area */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── Upload Zone ──────────────────────────────────────────── */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--bg-secondary);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background-color: rgba(255, 102, 0, 0.06);
}

.upload-zone__icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  opacity: 0.7;
}

.upload-zone__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-zone__subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upload-zone__btn {
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition);
}

.upload-zone__btn:hover {
  background: var(--accent-hover);
}

/* Progress bar */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  display: none;
}

.progress-bar-wrap.visible {
  display: block;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s ease;
  width: 0%;
}

/* ─── Filter Bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.filter-bar__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.filter-bar__input {
  padding: 6px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  transition: border-color var(--transition);
  min-width: 80px;
}

.filter-bar__input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-bar__input::placeholder {
  color: var(--text-muted);
}

/* Market tabs */
.market-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.market-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.market-tab img {
  width: 16px;
  height: 12px;
  border-radius: 2px;
}

.market-tab.active,
.market-tab:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Toast Notification Component ────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 280px;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  pointer-events: all;
  animation: toast-in 0.25s ease forwards;
  font-size: 0.85rem;
  line-height: 1.4;
}

.toast.toast--out {
  animation: toast-out 0.25s ease forwards;
}

.toast__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.toast__message {
  flex: 1;
  color: var(--text-primary);
}

.toast__close {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  transition: color var(--transition);
}

.toast__close:hover {
  color: var(--text-primary);
}

/* Toast variants */
.toast--info {
  border-left: 3px solid var(--accent);
}

.toast--info .toast__icon {
  color: var(--accent);
}

.toast--warn {
  border-left: 3px solid var(--warning);
}

.toast--warn .toast__icon {
  color: var(--warning);
}

.toast--error {
  border-left: 3px solid var(--danger);
}

.toast--error .toast__icon {
  color: var(--danger);
}

.toast--success {
  border-left: 3px solid var(--success);
}

.toast--success .toast__icon {
  color: var(--success);
}

/* Toast animations */
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

/* ─── Skip Summary ─────────────────────────────────────────── */
.skip-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.skip-summary ul {
  list-style: none;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.skip-summary li {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
}

/* ─── Browser Error Full-Page ──────────────────────────────── */
.browser-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  text-align: center;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.browser-error h1 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--danger);
}

.browser-error p {
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 12px;
}

.browser-error ul {
  list-style: none;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─── Utility Classes ──────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }

/* ============================================================
   Keepa ROI Page Style Extensions (Dark Theme)
   ============================================================ */

.keepa-control-panel {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  position: relative;
  width: 100%;
  gap: 0;
}

.control-panel-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}

.control-panel-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border);
  margin: 0 4px;
}


.upload-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  cursor: pointer;
  transition: all var(--transition);
  min-width: 200px;
}

.upload-compact:hover {
  border-color: var(--accent);
  background-color: rgba(255, 102, 0, 0.05);
}

.upload-compact i {
  color: var(--accent);
  font-size: 16px;
}

.upload-compact span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.file-info-small {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.minimal-btn-start {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 6px 16px;
  border-radius: var(--radius-md);
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
  height: 38px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.minimal-btn-start:hover:not(:disabled) {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.2);
}

.minimal-btn-start:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--text-muted);
}

.market-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-select-sm {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
}

.market-pair-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-sm);
  color: var(--success);
}

.analysis-summary {
  display: flex;
  align-items: center;
  gap: 16px;
}

.summary-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border);
}

.mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mini-stat .l {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.mini-stat .v {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-primary);
}

/* Column Filter Bar */
.cf-filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  width: 100%;
}

.cf-filter-bar-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.view-filters-group {
  display: flex;
  gap: 6px;
}

.view-filter-btn {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition);
}

.view-filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.view-filter-btn.active {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border);
}

.search-asin-wrap {
  display: flex;
  align-items: center;
  position: relative;
}

.search-asin-input {
  width: 130px;
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: monospace;
  outline: none;
  transition: border-color var(--transition);
}

.search-asin-input:focus {
  border-color: var(--accent);
}

.search-asin-clear-btn {
  position: absolute;
  right: 6px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px;
}

.search-asin-clear-btn:hover {
  color: var(--text-primary);
}

.filter-statistics {
  display: flex;
  align-items: center;
  gap: 16px;
}

.keepa-filter-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Badge and ROI Styles */
.roi-status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.roi-positive {
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.roi-negative {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* Empty state styling */
.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  width: 100%;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.empty-state-subtitle {
  font-size: 0.85rem;
}

/* Detailed card styling (expanded row) */
.expanded-detail-row {
  background-color: rgba(255, 102, 0, 0.02);
  border-bottom: 1px solid var(--border);
}

.expanded-detail-container {
  padding: 16px 20px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.expanded-detail-col {
  flex: 1;
  min-width: 250px;
}

.expanded-detail-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.8rem;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item__label {
  color: var(--text-muted);
}

.detail-item__val {
  font-weight: 600;
  color: var(--text-primary);
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-amazon-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: #ff9900;
  color: #000000;
  font-weight: 700;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  transition: opacity var(--transition);
}

.btn-amazon-link:hover {
  opacity: 0.9;
  text-decoration: none;
}
