/* ===== Google Fonts (modern ve okunaklı) ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

/* ===== Genel Sıfırlama ve Değişkenler ===== */
:root {
  --primary: #6C63FF;
  --primary-dark: #5A52D5;
  --primary-light: #8B83FF;
  --accent: #FF6584;
  --bg: #F4F6FC;
  --card-bg: #FFFFFF;
  --text-primary: #1E1E2F;
  --text-secondary: #4A4A5A;
  --text-muted: #7A7A8A;
  --border: #E2E5ED;
  --shadow: 0 8px 24px rgba(108, 99, 255, 0.08);
  --shadow-hover: 0 16px 40px rgba(108, 99, 255, 0.16);
  --radius: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Navigasyon ===== */
nav {
  width: 100%;
  max-width: 1200px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 28px;
  margin-bottom: 40px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 8px;
}

nav ul li a {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 40px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}

nav ul li a:hover {
  color: var(--primary);
  background: rgba(108, 99, 255, 0.06);
}

nav ul li a:hover::after {
  width: 60%;
}

nav ul li a:active {
  transform: scale(0.97);
}

/* ===== Başlık ===== */
h1 {
  text-align: center;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
}

/* ===== Ürün Listesi (Grid) ===== */
#product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  width: 100%;
  max-width: 1200px;
  list-style: none;
  padding: 0;
  margin: 0 auto;
}

/* ===== Ürün Kartı ===== */
#product-list li {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
}

#product-list li:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

/* Ürün Görseli */
#product-list li img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #E8ECF4;
  transition: var(--transition);
}

#product-list li:hover img {
  transform: scale(1.02);
}

/* Ürün Bilgi Alanı */
.product-info {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.product-info .category-badge {
  display: inline-block;
  background: rgba(108, 99, 255, 0.10);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 10px;
  align-self: flex-start;
}

.product-info .price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 6px 0 4px;
}

.product-info .price span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

.product-info .stock {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.product-info .stock.in-stock {
  color: #2ECC71;
}

.product-info .stock.out-of-stock {
  color: var(--accent);
}

.product-info .description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-info .features {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Ürün Kartındaki Aksiyon Butonları */
.product-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: none;
  border-radius: 40px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  background: var(--bg);
  color: var(--text-secondary);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(108, 99, 255, 0.30);
}

.btn-danger {
  background: #FEE2E2;
  color: #DC2626;
}

.btn-danger:hover {
  background: #FECACA;
  color: #B91C1C;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108, 99, 255, 0.04);
}

/* ===== Modal ===== */
#edit-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 30, 47, 0.6);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

#edit-modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  max-width: 520px;
  width: 90%;
  padding: 32px 36px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.20);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

#edit-modal-content::-webkit-scrollbar {
  width: 4px;
}

#edit-modal-content::-webkit-scrollbar-track {
  background: var(--bg);
}

#edit-modal-content::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 10px;
}

#close-edit-modal {
  position: absolute;
  top: 16px;
  right: 22px;
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

#close-edit-modal:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

#edit-modal-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Form Elemanları */
#edit-form label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 14px;
  margin-bottom: 4px;
}

#edit-form input,
#edit-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  background: var(--bg);
  transition: var(--transition);
  color: var(--text-primary);
}

#edit-form input:focus,
#edit-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.12);
  background: white;
}

#edit-form textarea {
  min-height: 80px;
  resize: vertical;
}

#edit-form button[type="submit"] {
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 40px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

#edit-form button[type="submit"]:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.30);
}

#edit-response-message {
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

/* ===== Hamburger Menü (sadece mobilde görünür) ===== */
.menu-toggle {
  display: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body { padding: 16px; }

  header {
    position: relative;
  }

  .top-bar {
    padding: 14px 16px;
    padding-right: 52px;
    position: relative;
  }

  .logo h1 {
    font-size: 1.8rem;
    letter-spacing: 0.1em;
  }

  nav {
    display: none;
    position: absolute;
    top: 72px;
    right: 16px;
    width: min(280px, calc(100vw - 32px));
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
    padding: 18px 16px;
    margin: 0;
    z-index: 999;
  }

  nav.open {
    display: flex;
  }

  nav ul {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  nav ul li {
    width: 100%;
    text-align: center;
  }

  nav ul li a {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1100;
  }

  .menu-toggle .bar {
    display: block;
    width: 100%;
    height: 2px;
    background: #111;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .menu-toggle.open .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .menu-toggle.open .bar:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.open .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  h1 { font-size: 2.2rem; }
  #product-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
  #edit-modal-content { padding: 24px 20px; }
}

@media (max-width: 480px) {
  #product-list { grid-template-columns: 1fr; }
  .product-actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .top-bar {
    padding: 12px 14px;
    padding-right: 48px;
  }
  .user-actions {
    gap: 10px;
  }
}
