/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&display=swap');

/* CSS CSS Variables / Theme Tokens */
:root {
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Outfit', system-ui, -apple-system, sans-serif;

  /* Color Palette (Sage Green & Warm Wood Theme) */
  --bg-main: #fcfbf9;         /* Warm milk / Soft cream background */
  --bg-card: #ffffff;         /* Pure white for containers/cards */
  --bg-accent: #f2ede7;       /* Soft light beige */
  
  --primary: #4a6351;         /* Deep Sage Green */
  --primary-light: #708a77;   /* Muted Green */
  --primary-dark: #2d3e32;    /* Dark Olive Green */
  
  --secondary: #8c6d53;       /* Warm Wood Brown */
  --secondary-light: #b0927a; /* Light Oak Brown */
  --secondary-dark: #5c4331;  /* Dark Walnut Brown */

  --text-dark: #202b23;       /* Off-black for main text */
  --text-muted: #5e6b61;      /* Grayish green for descriptions */
  --text-light: #ffffff;      /* White for overlays/buttons */
  
  --accent-gold: #cfa870;     /* Gold Accent for highlights/badges */
  --accent-gold-dark: #b89158;
  
  --border-color: #e5dfd8;    /* Soft beige borders */
  --shadow-sm: 0 2px 8px rgba(92, 107, 97, 0.08);
  --shadow-md: 0 8px 24px rgba(92, 107, 97, 0.12);
  --shadow-lg: 0 16px 40px rgba(92, 107, 97, 0.16);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--primary-dark);
  font-weight: 700;
}

p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

a {
  text-decoration: none;
  color: inherit;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-light);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--bg-accent);
  color: var(--secondary-dark);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: #d9534f;
  color: var(--text-light);
}

.btn-danger:hover {
  background-color: #c9302c;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Form Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dark);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(112, 138, 119, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* --- CUSTOMER MENU PAGE STYLES --- */

/* Header & Banner */
.menu-header {
  position: relative;
  background-color: var(--primary-dark);
  color: var(--text-light);
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Wood Accent Line in Header */
.menu-header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--secondary-light), var(--secondary), var(--secondary-dark));
}

.menu-header h1 {
  font-size: 2.5rem;
  color: var(--bg-main);
  margin-bottom: 0.25rem;
  letter-spacing: -0.5px;
}

.menu-header p {
  color: var(--bg-accent);
  font-weight: 300;
  font-size: 1rem;
  opacity: 0.9;
}

/* Floating Search and Categories Bar */
.search-container {
  max-width: 500px;
  margin: -1.5rem auto 0;
  padding: 0 1.5rem;
  position: relative;
  z-index: 10;
}

.search-wrapper {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
}

.search-input {
  border: none;
  background: transparent;
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  color: var(--text-dark);
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  color: var(--primary-light);
  font-size: 1.2rem;
  pointer-events: none;
}

/* Category Slider */
.categories-container {
  padding: 1.5rem 0;
  overflow-x: auto;
  white-space: nowrap;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  display: flex;
  gap: 0.75rem;
  scrollbar-width: none; /* Firefox */
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.categories-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-xl);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.category-tab .icon {
  font-size: 1.1rem;
}

.category-tab.active {
  background-color: var(--primary);
  color: var(--text-light);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(74, 99, 81, 0.25);
  transform: scale(1.03);
}

/* Menu Items List */
.menu-section {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.section-title {
  margin: 1.5rem 0 1rem;
  font-size: 1.5rem;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background-color: var(--border-color);
  margin-left: 10px;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Product Card - Premium Layout */
.product-card {
  display: flex;
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.product-img {
  width: 105px;
  height: 105px;
  min-width: 105px;
  object-fit: cover;
  border-right: 1px solid var(--border-color);
  transition: var(--transition);
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.product-info {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 0.25rem;
}

.product-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  white-space: nowrap;
}

.product-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

/* Item Detail Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(32, 43, 35, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end; /* Slides up from bottom on mobile */
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-card);
  width: 100%;
  max-width: 500px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

/* Modal details layout */
.modal-close-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  cursor: pointer;
}

.modal-close-handle {
  width: 40px;
  height: 5px;
  border-radius: 5px;
  background-color: var(--border-color);
}

.modal-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}

.modal-details h2 {
  font-size: 1.6rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.modal-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 1rem;
  display: inline-block;
  background-color: var(--bg-accent);
  padding: 0.25rem 1rem;
  border-radius: var(--radius-xl);
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Empty search state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* --- ADMIN PANEL PAGE STYLES (/yonetim) --- */

.admin-body {
  background-color: #f7f6f2; /* slightly different gray for dashboard style */
}

/* Admin Header navigation */
.admin-navbar {
  background-color: var(--primary-dark);
  color: var(--text-light);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid var(--secondary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-logo span {
  font-size: 0.9rem;
  background-color: var(--secondary);
  color: var(--text-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
}

.admin-nav-links {
  display: flex;
  gap: 1.5rem;
}

.admin-nav-item {
  color: var(--bg-accent);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.admin-nav-item:hover, .admin-nav-item.active {
  background-color: var(--primary);
  color: var(--text-light);
}

/* Admin Content Wrapper */
.admin-container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Admin Dashboard Summary Cards */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 50px;
  height: 50px;
  background-color: var(--bg-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
}

.stat-info h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-dark);
}

/* Chart Section */
.chart-section {
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-title h3 {
  font-size: 1.25rem;
}

.chart-filters {
  display: flex;
  background-color: var(--bg-accent);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.chart-filter-btn {
  border: none;
  background: transparent;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.chart-filter-btn.active {
  background-color: var(--primary);
  color: var(--text-light);
  box-shadow: var(--shadow-sm);
}

/* Products Management Styling */
.management-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.admin-table th {
  background-color: var(--bg-accent);
  color: var(--primary-dark);
  font-weight: 700;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.table-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-active {
  background-color: #e2f0d9;
  color: #385723;
}

.status-inactive {
  background-color: #fce4d6;
  color: #c65911;
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
}

/* Modal form style overrides */
.admin-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(32, 43, 35, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-modal.open {
  display: flex;
}

.admin-modal-content {
  background-color: var(--bg-card);
  width: 100%;
  max-width: 550px;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.modal-close-btn {
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-muted);
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: #d9534f;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.checkbox-group input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-group label {
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
}

/* Image preview in form */
.img-preview-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.img-preview {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-main);
}

/* Custom file upload styling */
.file-upload-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

/* Media Queries for Responsiveness */

/* Tablet & Desktop overrides for customer menu */
@media (min-width: 601px) {
  .modal-overlay {
    align-items: center; /* Centered modal on tablet/desktop */
  }
  .modal-content {
    border-radius: var(--radius-lg);
    transform: scale(0.9);
    opacity: 0;
  }
  .modal-overlay.open .modal-content {
    transform: scale(1);
    opacity: 1;
  }
}

/* Mobile responsive fixes for admin page */
@media (max-width: 768px) {
  .admin-navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .admin-nav-links {
    width: 100%;
    justify-content: space-around;
  }
  .admin-container {
    margin: 1rem auto;
  }
  .stats-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .chart-filters {
    width: 100%;
    margin-top: 0.5rem;
  }
  .chart-filter-btn {
    flex-grow: 1;
    text-align: center;
  }
  .management-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .management-header .btn {
    width: 100%;
  }
}
