/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #ffffff;
  color: #1a1a1a;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Layout ===== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 200px;
  min-width: 200px;
  background: #ffffff;
  border-right: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 0 1rem;
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.logo {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  color: #444;
  font-size: 0.9375rem;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  background: #f0f0f0;
  color: #1a1a1a;
}

.nav-link.active {
  background: #fff;
  color: #1a1a1a;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.nav-icon {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  color: #888;
}

.nav-link.active .nav-icon {
  color: #333;
}

.sidebar-footer {
  padding: 1rem 1rem;
  border-top: none;
}

.copyright {
  margin: 0;
  font-size: 0.75rem;
  color: #888;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

/* Üst şerit: arama alanı — logo ile aynı yükseklik, çizgi aynı hizada */
.main-content .page-header-row {
  margin: -2rem -2.5rem 0 -2.5rem;
  padding: 0 2.5rem;
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  margin: 0 0 0.35rem 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.page-desc {
  margin: 0;
  font-size: 1rem;
  color: #666;
}

/* Header row: title + search + share */
.page-header-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.page-header-row h2 {
  margin: 0;
  flex-shrink: 0;
}

.header-search-wrap {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 0 0.75rem;
  transition: border-color 0.2s, background 0.2s;
}

.header-search-wrap:focus-within {
  background: #fff;
  border-color: #ccc;
  outline: none;
}

.search-icon {
  flex-shrink: 0;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-search-wrap:focus-within .search-icon {
  color: #555;
}

.header-search {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.65rem 0;
  font-size: 0.9375rem;
  color: #1a1a1a;
}

.header-search::placeholder {
  color: #999;
}

.header-search:focus {
  outline: none;
}

/* ===== Arama dropdown ===== */
.search-dropdown {
  display: none;
  position: fixed;
  z-index: 1000;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 360px;
  overflow-y: auto;
  min-width: 280px;
}

.search-dropdown.is-open {
  display: block;
}

.search-dropdown-inner {
  padding: 0.5rem 0;
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  color: inherit;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.search-dropdown-item:hover {
  background: #f5f5f5;
}

.search-dropdown-name {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1a1a1a;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-dropdown-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.search-dropdown-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.btn-share {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #444;
  background: #f5f5f5;
  border: 1px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-share:hover {
  background: #eee;
  border-color: #ddd;
  color: #1a1a1a;
}

.share-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.page-body {
  color: #333;
}

.page-body > p {
  margin: 0 0 1.5rem 0;
  max-width: 56ch;
}

/* ===== Welcome Cards (Ana Sayfa) ===== */
.welcome-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  padding: 1.25rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.card p {
  margin: 0;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.45;
}

/* ===== Ana Sayfa Kategori Slider ===== */
.category-section {
  margin-bottom: 2.5rem;
}

.category-section:last-child {
  margin-bottom: 0;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.category-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
}

.category-slider-nav {
  display: flex;
  gap: 0.5rem;
}

.slider-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 0.875rem;
  color: #444;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.slider-nav-btn:hover {
  background: #eee;
  color: #1a1a1a;
  border-color: #ddd;
}

.palette-slider {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.25rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.palette-slider::-webkit-scrollbar {
  display: none;
}

.palette-slider .palette-card {
  flex-shrink: 0;
  width: 220px;
  min-width: 220px;
  scroll-snap-align: start;
}

/* ===== Palette Grid ===== */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.palette-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.palette-card:hover {
  border-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.palette-swatches {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
}

.palette-swatch {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
  position: relative;
}

.palette-hex {
  font-size: 0.8125rem;
  font-family: 'Consolas', 'Monaco', monospace;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.palette-swatch:hover .palette-hex {
  opacity: 1;
}

.palette-hex--light {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.palette-hex--dark {
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.85);
}

.palette-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #444;
}

.palette-label .palette-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-share-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 0.875rem;
  color: #666;
  background: transparent;
  border: 1px solid #eee;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.palette-share-btn:hover {
  color: #1a1a1a;
  background: #f5f5f5;
  border-color: #e0e0e0;
}

.palette-delete-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 0.8125rem;
  color: #c0392b;
  background: transparent;
  border: 1px solid #f2d7d5;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.palette-delete-btn:hover {
  color: #fff;
  background: #e74c3c;
  border-color: #e74c3c;
}

.palette-card {
  cursor: pointer;
}

/* ===== Ayrıntılı palet sayfası ===== */
.detail-page {
  max-width: 960px;
  position: relative;
}

.detail-empty {
  display: none;
  background: #fff;
  min-height: 320px;
  padding: 3rem 2rem;
  border-radius: 12px;
  border: 1px solid #eee;
}

.detail-empty.is-visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-empty-text {
  margin: 0;
  font-size: 1.125rem;
  color: #555;
}

.detail-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.detail-title {
  margin: 0 0 1.25rem 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.detail-palette {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid #e5e5e5;
}

.detail-palette-swatch {
  flex: 1;
  min-height: 120px;
  min-width: 0;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: #666;
}

.detail-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.detail-meta-item i {
  color: #888;
}

.detail-table-title {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.detail-table-wrap {
  margin-bottom: 1.5rem;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.detail-table th,
.detail-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.detail-table th {
  font-weight: 600;
  color: #444;
  background: #fafafa;
}

.detail-table tr:last-child td {
  border-bottom: none;
}

.detail-td-color {
  width: 52px;
}

.detail-table-swatch {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: middle;
}

.detail-td-hex {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.875rem;
}

.detail-hex-link {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
}

.detail-hex-link:hover {
  text-decoration: underline;
}

.detail-td-rgb {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.8125rem;
  color: #555;
}

.detail-share {
  padding-top: 0.5rem;
}

.detail-share-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 0.5rem;
}

.detail-share-btns {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.detail-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1rem;
  color: #fff;
  background: #1a1a1a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.detail-share-btn:hover {
  opacity: 0.85;
}

.detail-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #1a1a1a;
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.detail-edit-btn:hover {
  background: #e8e8e8;
  border-color: #ccc;
}

.detail-login-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: #999;
}

.detail-download-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
  text-align: center;
}

.detail-download-title {
  margin: 0 0 1.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
}

.detail-download-preview {
  display: flex;
  max-width: 560px;
  margin: 0 auto 1.25rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
}

.detail-download-swatch {
  flex: 1;
  min-height: 300px;
  min-width: 0;
}

.detail-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: #16a34a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.detail-download-btn:hover {
  background: #15803d;
  opacity: 0.95;
}

@media (max-width: 900px) {
  .detail-main {
    grid-template-columns: 1fr;
  }
}

/* ===== Renk Paleti Oluştur ===== */
.creator-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.creator-tool {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.creator-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  margin-bottom: -0.5rem;
}

.creator-name {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.9375rem;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  color: #1a1a1a;
}

.creator-name:focus {
  outline: none;
  border-color: #999;
}

.creator-count-wrap {
  display: flex;
  gap: 0.5rem;
}

.creator-count-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #555;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.creator-count-btn:hover {
  background: #f5f5f5;
  border-color: #ddd;
  color: #1a1a1a;
}

.creator-count-btn.active {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

.creator-colors {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.creator-color-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.creator-color-picker {
  width: 48px;
  height: 48px;
  padding: 2px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.creator-color-hex {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: 'Consolas', 'Monaco', monospace;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  color: #1a1a1a;
}

.creator-color-hex:focus {
  outline: none;
  border-color: #999;
}

.creator-random {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #555;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.creator-random:hover {
  background: #eee;
  border-color: #ddd;
  color: #1a1a1a;
}

.creator-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.creator-preview {
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.creator-preview-swatches {
  border-radius: 0;
}

.creator-preview-swatches .palette-swatch {
  min-height: 64px;
}

.creator-actions {
  display: flex;
  gap: 0.75rem;
}

.creator-copy,
.creator-share,
.creator-save {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.05s;
}

.creator-copy {
  background: #1a1a1a;
}

.creator-share {
  background: #2563eb;
}

.creator-save {
  background: #16a34a;
}

.creator-copy:hover,
.creator-share:hover,
.creator-save:hover {
  opacity: 0.9;
}

.creator-copy:active,
.creator-share:active,
.creator-save:active {
  transform: scale(0.98);
}

.creator-added-section {
  grid-column: 1 / -1;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.creator-added-title {
  margin: 0 0 1.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
}

@media (max-width: 900px) {
  .creator-page {
    grid-template-columns: 1fr;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .main-content {
    padding: 1.5rem 1.25rem;
  }

  .page-header h2 {
    font-size: 1.5rem;
  }
}

/* ===== Kopyalandı bildirimi (toast) ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #fff;
  background: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ===== Paylaş popup ===== */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.share-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.share-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.share-modal-panel {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.share-modal-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
}

.share-modal-desc {
  margin: 0 0 1.25rem 0;
  font-size: 0.875rem;
  color: #555;
}

.share-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.share-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.share-modal-download {
  color: #fff;
  background: #1a1a1a;
}

.share-modal-download:hover {
  background: #333;
}

.share-modal-copy {
  color: #1a1a1a;
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
}

.share-modal-copy:hover {
  background: #e8e8e8;
}

.share-modal-close {
  color: #555;
  background: transparent;
  border: 1px solid #ddd;
}

.share-modal-close:hover {
  background: #f5f5f5;
}
