:root {
  --primary: #3b82f6;
  --primary-hover: #1d4ed8;
  --primary-dark: #2563eb;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text-color: #1e40af;
  --info-bg: #dbeafe;
  --toast-bg: #1e3a8a;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  margin: 0;
  padding: 0;
  color: #000;
  transition: background 0.3s, color 0.3s;
}

body.dark-mode {
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --primary-dark: #1e40af;
  --bg: #1e1e2f;
  --card-bg: #2c2c3e;
  --text-color: #dbeafe;
  --info-bg: #374151;
  --toast-bg: #2563eb;
  color: #dbeafe;
}

/* Sekmeler */
.tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--primary-dark);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  flex: none;
  padding: 14px 20px;
  min-width: 120px;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  white-space: nowrap;
  transition: 0.3s;
}

.tabs button:hover,
.tabs button.active {
  background: var(--primary-hover);
}

/* Sekme içeriği */
.tab-content {
  display: none;
  padding: 20px;
}

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

/* Kayan ok */
.tabs-container {
  display: flex;
  align-items: center;
  position: relative;
  background: var(--primary-dark);
}

.tabs-container::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(to right, transparent, var(--primary-dark));
  pointer-events: none;
}

.tabs-scroll-indicator {
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  animation: bounce 1.5s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
  }
  50% {
    transform: translateY(-50%) translateX(5px);
  }
}

.tabs-scroll-indicator::before {
  content: "";
  border: solid white;
  border-width: 0 3px 3px 0;
  display: inline-block;
  padding: 6px;
  transform: rotate(-45deg);
}

.tabs-scroll-indicator:hover {
  transform: translateY(-50%) scale(1.2);
}

.tabs-container.scrolled .tabs-scroll-indicator {
  opacity: 0;
}

@media (max-width: 768px) {
  .tabs-scroll-indicator {
    display: flex;
  }
}

/* Kartlar */
.container {
  max-width: 500px;
  margin: 20px auto;
  text-align: center;
}

.card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 25px;
  transition: 0.3s;
}

h2 {
  margin-bottom: 15px;
  color: var(--text-color);
}

input {
  width: 100%;
  max-width: none;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-size: 15px;
  box-sizing: border-box;
}

input:focus {
  border-color: var(--primary);
  outline: none;
}

/* Sonuç kutuları */
.result-box {
  background: var(--info-bg);
  border-left: 5px solid var(--primary);
  padding: 12px;
  margin-top: 15px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  color: var(--text-color);
  transition: 0.3s;
  text-align: left;
  white-space: nowrap;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

/* Butonlar */
button.copy-btn,
.video-btn,
.calc-btn {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s all;
}

button.copy-btn:hover,
.video-btn:hover,
.calc-btn:hover {
  background: var(--primary-hover);
}

/* Video kutusu */
.video-container {
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 0.5s ease, opacity 0.5s ease;
  margin-top: 15px;
  text-align: center;
}

.video-container.show {
  height: 315px;
  opacity: 1;
}

/* Info & sponsor */
.info-box {
  background: var(--info-bg);
  border-left: 5px solid var(--primary);
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 12px;
  font-size: 14px;
  text-align: left;
  color: var(--text-color);
}

/* Sponsor ve mail alanı */
.sponsor-box {
  background: #dcdcdc;
  padding: 12px;
  border-radius: 10px;
  display: inline-block;
  text-align: center;
  min-width: 220px;
  margin: 2px auto; /* boşluk küçültüldü */
  font-size: 14px;
  color: #333;
}

.container.mail {
  margin: 6px auto; /* daha sıkı hizalama */
  font-size: 14px;
  text-align: center;
  color: #555;
}

.container.mail a {
  text-decoration: none;
  color: inherit;
}

/* Dark mode uyumu */
body.dark-mode .sponsor-box {
  background: #3a3a50;
  color: #dbeafe;
}

body.dark-mode .container.mail {
  color: #dbeafe;
}

/* Toast */
#toast {
  visibility: hidden;
  min-width: 220px;
  background-color: var(--toast-bg);
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 12px;
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.5s, bottom 0.5s;
}

/* Mobil uyumluluk */
@media (max-width: 600px) {
  input {
    width: 100%;
  }
  .result-actions {
    flex-direction: column;
  }
  button.copy-btn,
  .video-btn,
  .calc-btn {
    width: 100%;
  }
}

/* Dark mode toggle */
#toggle-theme {
  width: auto;
  height: auto;
  padding: 10 5px;
  font-size: 15px;
  background: transparent;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

#toggle-theme:hover {
  transform: scale(1.2);
}

/* Filament kart */
.filament-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin: 20px auto;
  max-width: 500px;
  position: relative;
}

.filament-card h2 {
  text-align: center;
  margin-bottom: 10px;
}

.filament-info {
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.filament-list {
  max-height: 500px; /* Normal ekran */
  overflow-y: auto;
  display: block;
  flex-direction: column;
  gap: 12px;
  padding-right: 5px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
  .filament-list {
    max-height: 300px; /* Mobil ekran */
  }
}

.filament-list::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(to top, #fff, transparent);
  pointer-events: none;
}

.filament-list::before {
  content: "";
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(to bottom, #fff, transparent);
  pointer-events: none;
}

.filament-list::-webkit-scrollbar {
  width: 4px;
}
.filament-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.filament-list::-webkit-scrollbar-track {
  background: transparent;
}

.filament-item {
  display: flex;
  flex-direction: column;
  background: #f9f9f9;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: 0.2s;
}
.filament-item:hover {
  background: #f1f1f1;
}

.filament-details h3 {
  font-size: 15px;
  margin: 0 0 6px 0;
}

.spool-badges {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  position: relative;
  display: inline-block;
  background: #5c6bc0;
  color: white;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: default;
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Makara türü renkleri */
.badge.plastic {
  background: #000;
  width: 5px;
  border-radius: 4px;
}

.badge.cardboard {
  background: #deb887;
  width: 5px;
  border-radius: 4px;
}

.tolerance {
  background: #eee;
  color: #555;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 6px;
  font-weight: normal;
  display: inline-block;
  vertical-align: middle;
}

.brand-note {
  font-size: 12px;
  color: #777;
  margin-left: 4px;
  font-weight: normal;
  vertical-align: middle;
}

/* Mobil uyumluluk */
@media (max-width: 480px) {
  .container,
  .card,
  .filament-card {
    padding: 14px;
    margin: 12px auto;
    border-radius: 10px;
  }

  h2 {
    font-size: 17px;
    margin-bottom: 10px;
  }

  h3 {
    font-size: 15px;
  }

  .badge {
    font-size: 12px;
    padding: 5px 8px;
  }
  .tolerance {
    font-size: 11px;
    padding: 2px 4px;
  }
  .brand-note {
    font-size: 11px;
    margin-left: 2px;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#filament-icon {
  animation: spin 4s linear infinite;
}

/* Dark Mode */
body.dark-mode {
  background: #1f1f2e;
  color: #e0e7ff;
}
body.dark-mode .filament-card {
  background: #2c2c3e;
  color: #dbeafe;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
body.dark-mode .filament-info {
  color: #cbd5e1;
}
body.dark-mode .filament-item {
  background: #3a3a50;
  color: #e0e7ff;
}
body.dark-mode .filament-item:hover {
  background: #4a4a65;
}
body.dark-mode .badge {
  background: #6366f1;
  color: #fff;
}
body.dark-mode .tolerance {
  color: #d1d5db;
  background: #4b5563;
}

body.dark-mode .brand-note {
  color: #d1d5db;
}

body.dark-mode .tabs-container {
  background: #2c2c3e;
}
body.dark-mode .tabs {
  background: #2c2c3e;
}
body.dark-mode .tabs button {
  background: #3a3a50;
  color: #dbeafe;
}
body.dark-mode .tabs button:hover,
body.dark-mode .tabs button.active {
  background: #6366f1;
  color: #fff;
}
body.dark-mode .tabs-container::after {
  background: linear-gradient(to right, transparent, #2c2c3e);
}
body.dark-mode .tabs-scroll-indicator::before {
  border-color: #dbeafe;
}

body.dark-mode .badge.plastic {
  background: #000;
  width: 5px;
  border-radius: 4px;
}

body.dark-mode .badge.cardboard {
  background: #deb887;
  width: 5px;
  border-radius: 4px;
}

.filament-search {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 12px;
  border: 1px solid #ccc;
  font-size: 14px;
  box-sizing: border-box;
  transition: 0.3s;
}

.filament-search:focus {
  border-color: var(--primary);
  outline: none;
}

/* Dark mode uyum */
body.dark-mode .filament-search {
  background: #3a3a50;
  border: 1px solid #555;
  color: #fff;
}
body.dark-mode .filament-search::placeholder {
  color: #9ca3af;
}

/* Tüm input, select ve textarea'lar için */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #2f2f3a;
  color: #f1f1f1;
  border: 1px solid #555;
  border-radius: 8px;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #9ca3af; /* gri placeholder */
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: var(--primary);
  outline: none;
  background: #3a3a50;
}

/* Number ve range gibi özel inputlar */
body.dark-mode input[type="number"],
body.dark-mode input[type="range"] {
  background: #3a3a50;
  color: #fff;
}

/* Checkbox & radio */
body.dark-mode input[type="checkbox"],
body.dark-mode input[type="radio"] {
  accent-color: var(--primary); /* tarayıcı destekli */
}

/* Tüm number inputlardan ok işaretlerini kaldır */
input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none; /* Chrome, Safari, Edge, Opera */
  margin: 0;
}
