/* ==========================================================================
   CAFE DIGITAL MENU - MODERN DARK CAFE STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-main: #0c0806;
  --bg-surface: #17100b;
  --bg-card: #1f1610;
  --bg-card-hover: #2a1e16;
  --bg-input: #120b07;
  
  --accent-gold: #d4a373;
  --accent-gold-hover: #faedcd;
  --accent-amber: #e76f51;
  --accent-green: #2a9d8f;
  --accent-red: #e63946;
  
  --text-primary: #fefae0;
  --text-secondary: #c2b6a9;
  --text-muted: #807366;
  
  --border-subtle: rgba(212, 163, 115, 0.12);
  --border-glow: rgba(212, 163, 115, 0.35);
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(212, 163, 115, 0.15);
  
  --glass-bg: rgba(23, 16, 11, 0.85);
  --glass-border: rgba(212, 163, 115, 0.18);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(212, 163, 115, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(231, 111, 81, 0.03) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-card-hover);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* App Container */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 90px;
  min-height: 100vh;
  position: relative;
}

/* Cafe Branding Banner (No Header, minimal top bar) */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.cafe-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-gold), #bc8a5f);
  color: #17100b;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 500;
}

.admin-trigger-btn {
  background: rgba(212, 163, 115, 0.1);
  border: 1px solid var(--border-subtle);
  color: var(--accent-gold);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.admin-trigger-btn:hover {
  background: var(--accent-gold);
  color: #17100b;
}

/* Search Box */
.search-container {
  padding: 16px 20px 8px 20px;
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-glow);
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Horizontal Category Navigation Bar */
.category-nav {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  white-space: nowrap;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.category-btn.active {
  background: linear-gradient(135deg, var(--accent-gold), #bc8a5f);
  color: #120b07;
  font-weight: 700;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.category-btn:hover:not(.active) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-glow);
}

/* Product Grid Layout */
.menu-section {
  padding: 16px 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-count {
  font-size: 0.8rem;
  color: var(--accent-gold);
  background: rgba(212, 163, 115, 0.1);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Product Card Component */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  transition: var(--transition-normal);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.product-card.unavailable {
  opacity: 0.6;
  filter: grayscale(0.6);
}

.product-img-wrapper {
  width: 110px;
  min-width: 110px;
  height: 110px;
  position: relative;
  overflow: hidden;
  background: #000;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.product-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent-gold);
  border: 1px solid var(--border-subtle);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.product-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.product-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.product-price {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.price-currency {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-right: 3px;
}

.unavailable-tag {
  font-size: 0.72rem;
  color: var(--accent-red);
  background: rgba(230, 57, 70, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Modals System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  position: relative;
  transform: scale(0.95);
  transition: var(--transition-fast);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--accent-red);
  border-color: transparent;
}

/* Product Details Modal Specifics */
.detail-img-container {
  width: 100%;
  height: 220px;
  position: relative;
  background: #000;
}

.detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-body {
  padding: 20px;
}

.detail-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.detail-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.detail-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-top: 14px;
  margin-bottom: 6px;
}

.detail-description {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.detail-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* Admin View & Admin Floating Button */
.admin-view-header {
  padding: 16px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-actions-bar {
  padding: 16px 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #bc8a5f);
  color: #120b07;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
}

.btn-danger {
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid rgba(230, 57, 70, 0.3);
  color: var(--accent-red);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.btn-danger:hover {
  background: var(--accent-red);
  color: #fff;
}

/* Admin Item Management Table/List */
.admin-items-list {
  padding: 0 20px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
  min-width: 0; /* Prevents text overflow */
}

.admin-item-thumb {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
}

.admin-item-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-item-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-item-category {
  font-size: 0.75rem;
  color: var(--accent-gold);
}

.admin-item-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.admin-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.admin-price-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-price-input {
  width: 90px;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
}

.admin-price-input:focus {
  border-color: var(--accent-gold);
  outline: none;
}

.price-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-toggle-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--accent-green);
  border-color: transparent;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: #fff;
}

/* Forms in Modal */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-gold);
}

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

/* QR Code Container */
.qr-preview-box {
  background: #ffffff;
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.qr-preview-box canvas, .qr-preview-box img {
  max-width: 100%;
  height: auto;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--accent-gold);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state svg {
  margin-bottom: 12px;
  color: var(--accent-gold);
  opacity: 0.5;
}

/* ==========================================================================
   DEVELOPER PROMOTIONAL BADGE & SOCIAL MODAL
   ========================================================================== */

/* Floating Badge Pill (Mobile & Desktop) */
.dev-badge-floating {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 90;
  background: rgba(23, 16, 11, 0.92);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(212, 163, 115, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 10px rgba(212, 163, 115, 0.2); }
  50% { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 163, 115, 0.45); }
}

.dev-badge-floating:hover {
  transform: translateY(-2px) scale(1.04);
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
}

.dev-badge-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--accent-gold), #bc8a5f);
  color: #120b07;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

/* Social Link Cards in Modal */
.dev-social-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  margin-bottom: 10px;
}

.dev-social-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.social-linkedin {
  background: linear-gradient(135deg, #0077b5, #005582);
  box-shadow: 0 4px 14px rgba(0, 119, 181, 0.35);
}

.social-telegram {
  background: linear-gradient(135deg, #2aabee, #229ed9);
  box-shadow: 0 4px 14px rgba(42, 171, 238, 0.35);
}

.social-instagram {
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  box-shadow: 0 4px 14px rgba(253, 29, 29, 0.35);
}

/* Footer Section */
.cafe-footer {
  text-align: center;
  padding: 30px 20px 20px 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 30px;
}

.dev-credit-link {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.dev-credit-link:hover {
  text-decoration: underline;
  color: var(--accent-gold-hover);
}
