/* === Genel Ayarlar === */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background-color: #fdfdfd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  color: #333;
}

/* === Odaklanma (Focus) Efektleri === */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
  outline: none;
}

/* === Form Placeholder ve Floating Label === */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color, #6c757d);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* === Kart ve Ürün Kartları Stil === */
.card,
.product-card {
  border-radius: 12px;
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
  background-color: #fff;
  overflow: hidden;
}

.card:hover,
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 6px 12px 24px rgba(0, 0, 0, 0.15);
}

/* === Container Z-index Ayarı === */
.container {
  position: relative;
  z-index: 1;
}

/* === Kategori Kartları === */
.category-card {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.category-card:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.category-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: transparent;
  transition: background-color 0.3s ease;
}

.category-link {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(25, 135, 84, 0.8); /* Yeşil arkaplan */
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 1.1rem;
  color: white;
  text-align: center;
  z-index: 2;
  transition: all 0.3s ease;
  width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-card:hover .category-link {
  background-color: rgba(25, 135, 84, 0.9); /* Hover'da daha opak */
  transform: translateX(-50%) scale(1.05);
}

/* === Animasyon: Düşen Yaprak === */
.falling-leaf {
  position: fixed;
  top: -50px;
  font-size: 24px;
  color: green;
  animation: fallDown 8s linear forwards;
  z-index: 10;
}

@keyframes fallDown {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* === Navbar Stil === */
.navbar {
  background: linear-gradient(90deg, #ffffff, #f8f9fa);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: #198754 !important;
  user-select: none;
}

.navbar-nav .nav-link {
  transition: color 0.3s ease, transform 0.3s ease;
  color: #333;
  user-select: none;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: #198754 !important;
  transform: scale(1.05);
  outline: none;
}

/* === Logout Butonu Stil === */
.btn-logout {
  border-color: #198754;
  color: #198754;
  background-color: transparent;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-logout:hover,
.btn-logout:focus {
  background-color: #198754;
  color: #fff;
  outline: none;
}

/* === Footer Stil === */
footer {
  background-color: #f8f9fa;
  font-size: 0.9rem;
  padding: 1rem 0;
  text-align: center;
  color: #444;
  user-select: none;
}

footer a {
  color: #198754;
  text-decoration: none;
  transition: text-decoration 0.3s ease;
}

footer a:hover,
footer a:focus {
  text-decoration: underline;
  outline: none;
}

/* === Slider: En Çok Satanlar === */
.slider-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 20px;
  padding: 20px 0;
  position: relative;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.slider-container::-webkit-scrollbar {
  display: none;
}

.slider-item {
  flex: 0 0 250px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.slider-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.slider-item .price {
  font-size: 1.2rem;
  font-weight: bold;
  color: #198754;
  text-align: center;
  margin-bottom: 0.75rem;
  margin-top: auto;
}

/* === Slider Navigation Buttons === */
.slider-prev,
.slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(25, 135, 84, 0.85);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.slider-prev {
  left: 10px;
}

.slider-next {
  right: 10px;
}

.slider-prev:hover,
.slider-next:hover,
.slider-prev:focus,
.slider-next:focus {
  background-color: #198754;
  outline: none;
}


/* === Admin Panel Stilleri === */
.card {
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 0.125rem 0.25rem rgb(0 0 0 / 0.075);
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1rem 1.5rem;
  background-color: #f8f9fa;
  font-weight: 600;
  font-size: 1.1rem;
  border-bottom: 1px solid #dee2e6;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  color: #212529;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: middle;
  border-top: 1px solid #dee2e6;
}

.table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  background-color: #f8f9fa !important;
  border-bottom: 2px solid #dee2e6;
}

.table td {
  vertical-align: middle;
  font-size: 0.9rem;
  color: #444;
}

.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35em 0.65em;
  border-radius: 0.375rem;
  color: #fff;
  background-color: #198754;
  display: inline-block;
  text-align: center;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-sm:hover,
.btn-sm:focus {
  background-color: #145c32;
  color: #fff;
  outline: none;
}

/* === Responsive Tablo === */
@media (max-width: 768px) {
  .table-responsive {
    border: 0;
  }
  
  .table thead {
    display: none;
  }
  
  .table tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.5rem;
  }
  
  .table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.85rem;
  }
  
  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 1rem;
    color: #198754;
    white-space: nowrap;
  }
  
  .table td:last-child {
    border-bottom: 0;
  }
}

/* === Sepet Sayfası Stilleri === */
.cart-counter {
  font-size: 0.7rem;
  padding: 0.25em 0.5em;
  vertical-align: top;
}

.add-to-cart-btn {
  position: relative;
  overflow: hidden;
}

.add-to-cart-btn .fa-check {
  display: none;
}

.add-to-cart-btn.added .fa-shopping-basket {
  display: none;
}

.add-to-cart-btn.added .fa-check {
  display: inline-block;
  animation: bounce 0.5s;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* Responsive Tablo - Sepet Sayfası için */
@media (max-width: 768px) {
  .table-responsive table {
    width: 100%;
  }
  
  .table-responsive thead {
    display: none;
  }
  
  .table-responsive tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.5rem;
  }
  
  .table-responsive td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 0.5rem;
  }
  
  .table-responsive td::before {
    content: attr(data-label);
    font-weight: bold;
    margin-right: 1rem;
    color: #198754;
  }
  
  .table-responsive td:last-child {
    border-bottom: none;
  }
  
  .table-responsive .img-thumbnail {
    width: 40px !important;
    height: 40px !important;
  }
  
}
@media (max-width: 768px) {
  .slider-prev,
  .slider-next {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
}
