/* Kitchen Dashboard Container - Premium */
#masalar.kitchen-dashboard {
  padding: var(--space-5);
  background: var(--surface-app);
  min-height: 100vh;
}

/* Header Section - Masalarust Responsive Design */
#masalar .masalarust {
  background: var(--surface-base);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

#masalar .bolumler {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: relative;
}

#masalar .bolumleric {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  background: var(--theme-primary-light);
  padding: var(--space-2);
  border-radius: var(--radius-xl);
  border: 2px solid var(--theme-primary-lighter);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-base);
}

#masalar .tab-item {
  padding: var(--space-2) var(--space-4);
  background: var(--surface-base);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  border: 2px solid transparent;
  backdrop-filter: blur(15px);
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-align: center;
  line-height: 1.4;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#masalar .tab-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-theme-md);
  border-color: var(--theme-primary);
  background: var(--surface-base);
}

#masalar .tab-item.active {
  background: var(--theme-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-theme-lg);
  border-color: transparent;
  transform: translateY(-1px);
}

#masalar .tab-item.active:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(255, 98, 71, 0.5);
}

/* Live Screen - Main Content Area */
#canlianaekran.live-screen {
  padding: 0;
  margin: 0;
}

/* Table Grid System */
.table-grid {
  margin: 0;
  padding: 0;
}

/* Table Card Wrapper */
.table-card-wrapper {
  padding: 8px !important;
  margin: 0 !important;
}

/* Main Table Card */
.masaitem.table-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 2px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  height: auto;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

/* Order Type Indicator Badge */
.order-type-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 16px 16px 0 0;
}

.order-type-indicator i {
  font-size: 16px;
}

/* Masa Siparişi - Mavi Tema */
.order-type-masa {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Paket Servis - Turuncu Tema */
.order-type-paket {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

/* Self Servis - Yeşil Tema */
.order-type-self {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.masaitem.table-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 98, 71, 0.3);
}

/* Table Header */
.katman1.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #ff6247 0%, #ff8a7b 100%);
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.katman1.table-header:hover {
  color: white;
  background: linear-gradient(135deg, #e55440 0%, #e67a6d 100%);
}

/* Table Info Section */
.table-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.table-section {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.5px;
}

.table-timer {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
  width: fit-content;
}

/* Table Number Badge */
.table-number {
  display: flex;
  align-items: center;
  justify-content: center;
}

.number-badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 18px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 50%;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Orders Container */
.orders-container {
  padding: 0;
  background: transparent;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 98, 71, 0.3) transparent;
}

.orders-container::-webkit-scrollbar {
  width: 6px;
}

.orders-container::-webkit-scrollbar-track {
  background: transparent;
}

.orders-container::-webkit-scrollbar-thumb {
  background: rgba(255, 98, 71, 0.3);
  border-radius: 3px;
}

.orders-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 98, 71, 0.5);
}

/* Individual Order Items */
.siparis {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin: 0 !important;
  background: rgba(248, 249, 250, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  border-radius: 8px;
  margin-bottom: 4px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
/* Individual Order Items */
.siparis .dropdown-menu {
  position: relative;
  z-index: 1000;
}

.siparis:hover {
  background: rgba(255, 98, 71, 0.05);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.siparis:last-child {
  border-bottom: none;
}

/* Order Image */
.siparis .res {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  margin-right: 12px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Order Info */
.siparis .bilgi {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.siparis .bilgi .adi {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  margin-bottom: 2px;
}

.siparis .bilgi .adi span:first-child {
  color: #ff6247;
  font-weight: 700;
}

.siparis .bilgi .adi span:last-child {
  color: #666;
  font-size: 11px;
  font-weight: 500;
}

.siparis .bilgi .durum {
  font-size: 11px;
  color: #28a745;
  font-weight: 600;
  background: rgba(40, 167, 69, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
  width: fit-content;
}

.siparis .bilgi .fiyat {
  font-size: 12px;
  font-weight: 700;
  color: #ff6247;
  margin-top: 2px;
}

/* Action Buttons */
.btn-group {
  margin-left: 8px;
}

.btn-ana {
  background: rgba(255, 98, 71, 0.1);
  border: 1px solid rgba(255, 98, 71, 0.3);
  color: #ff6247;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.btn-ana:hover {
  background: rgba(255, 98, 71, 0.2);
  color: #e55440;
  transform: scale(1.05);
}

/* Dropdown Menu Styling */
.dropdown-menu {
  border: none;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  position: absolute !important;
  z-index: 9999 !important;
  min-width: 140px;
  right: 0;
  left: auto;
  transform: translateX(0) !important;
}

/* Fix for dropstart positioning */
.btn-group.dropstart .dropdown-menu {
  right: 0;
  left: auto;
  transform: translateX(0) !important;
}

/* Ensure dropdown is visible */
.siparis .btn-group {
  position: relative;
  z-index: 10;
}

.siparis .btn-group .dropdown-menu {
  position: absolute;
  z-index: 9999;
  right: 0;
  top: 100%;
  margin-top: 2px;
}

.dropdown-item {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background: rgba(255, 98, 71, 0.1);
  color: #ff6247;
  transform: translateX(4px);
}

/* Responsive Design Breakpoints */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
  #masalar .masalarust {
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 16px;
  }

  #masalar .bolumleric {
    padding: 12px;
    gap: 15px;
    border-radius: 16px;
  }

  #masalar .tab-item {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 12px;
  }

  .table-card-wrapper {
    padding: 12px !important;
  }

  .masaitem.table-card {
    min-height: 140px;
  }

  .katman1.table-header {
    padding: 20px;
  }

  .siparis .res {
    width: 60px;
    height: 60px;
  }
}

/* Desktop (1200px - 1399px) */
@media (max-width: 1399px) and (min-width: 1200px) {
  .table-card-wrapper {
    padding: 10px !important;
  }
}

/* Medium Desktop (992px - 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
  .masaitem.table-card {
    min-height: 120px;
  }

  .katman1.table-header {
    padding: 14px;
  }

  .table-section {
    font-size: 13px;
  }

  .number-badge {
    font-size: 16px;
    min-width: 36px;
    min-height: 36px;
  }
}

/* Tablet Landscape (768px - 991px) */
@media (max-width: 991px) and (min-width: 768px) {
  .table-card-wrapper {
    padding: 6px !important;
  }

  .masaitem.table-card {
    min-height: 100px;
  }

  .katman1.table-header {
    padding: 12px;
  }

  .siparis {
    padding: 10px 12px;
  }

  .siparis .res {
    width: 45px;
    height: 45px;
  }
}

/* Tablet Portrait & Mobile Large (576px - 767px) */
@media (max-width: 767px) {
  #masalar.kitchen-dashboard {
    padding: 15px;
  }

  .table-grid {
    margin: 0 -4px;
  }

  .table-card-wrapper {
    padding: 4px !important;
    flex: 0 0 50% !important; /* Max 2 cards per row on mobile */
    max-width: 50% !important;
  }

  .masaitem.table-card {
    min-height: 90px;
  }

  .katman1.table-header {
    padding: 10px;
  }

  .table-section {
    font-size: 12px;
  }

  .table-timer {
    font-size: 10px;
    padding: 1px 6px;
  }

  .number-badge {
    font-size: 14px;
    min-width: 32px;
    min-height: 32px;
    padding: 6px 8px;
  }

  .siparis {
    padding: 8px 10px;
  }

  .siparis .res {
    width: 40px;
    height: 40px;
    margin-right: 8px;
  }

  .siparis .bilgi .adi {
    font-size: 12px;
  }

  .siparis .bilgi .durum {
    font-size: 10px;
  }

  .siparis .bilgi .fiyat {
    font-size: 11px;
  }

  .orders-container {
    max-height: 300px;
  }

  /* Disable hover effects on mobile */
  .masaitem.table-card:hover {
    transform: none;
  }

  .siparis:hover {
    transform: none;
    background: rgba(248, 249, 250, 0.8);
  }

  /* Order type indicator mobile */
  .order-type-indicator {
    padding: 6px 8px;
    font-size: 10px;
    gap: 5px;
  }

  .order-type-indicator i {
    font-size: 13px;
  }
}

/* Mobile Small (320px - 575px) */
@media (max-width: 575px) {
  #masalar.kitchen-dashboard {
    padding: 10px;
  }

  .table-card-wrapper {
    padding: 3px !important;
    flex: 0 0 50% !important; /* Max 2 cards per row on small mobile */
    max-width: 50% !important;
  }

  .masaitem.table-card {
    min-height: 80px;
    border-radius: 12px;
  }

  .katman1.table-header {
    padding: 8px;
  }

  .table-section {
    font-size: 11px;
  }

  .table-timer {
    font-size: 9px;
  }

  .number-badge {
    font-size: 12px;
    min-width: 28px;
    min-height: 28px;
    padding: 4px 6px;
  }

  .siparis {
    padding: 6px 8px;
  }

  .siparis .res {
    width: 35px;
    height: 35px;
    margin-right: 6px;
  }

  .siparis .bilgi .adi {
    font-size: 11px;
  }

  .siparis .bilgi .durum {
    font-size: 9px;
    padding: 1px 4px;
  }

  .siparis .bilgi .fiyat {
    font-size: 10px;
  }

  .btn-ana {
    padding: 4px 6px;
    font-size: 12px;
  }

  .orders-container {
    max-height: 250px;
  }

  /* Order type indicator small mobile */
  .order-type-indicator {
    padding: 4px 6px;
    font-size: 9px;
    gap: 4px;
    border-radius: 12px 12px 0 0;
  }

  .order-type-indicator i {
    font-size: 11px;
  }
}

/* Button Layout Fix for smaller screens */
@media (max-width: 960px) {
  #masalar .butonlar {
    display: grid;
    /*grid-template-columns: 1fr 1fr;*/
    gap: 10px;
  }

  #masalar .butonlar .btn {
    width: 100% !important;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .tab-item {
    min-height: 44px;
  }

  .tab-item:hover {
    transform: none;
  }

  .tab-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  .masaitem.table-card:active {
    transform: scale(0.98);
  }
}

/* High DPI screens optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  #masalar .masalarust {
    backdrop-filter: blur(25px);
  }

  #masalar .bolumleric {
    backdrop-filter: blur(15px);
  }

  #masalar .tab-item {
    backdrop-filter: blur(20px);
  }
}

/* Landscape orientation optimization for mobile */
@media (max-width: 767px) and (orientation: landscape) {
  #masalar .masalarust {
    padding: 8px 12px;
    margin-bottom: 10px;
  }

  .masaitem.table-card {
    min-height: 70px;
  }

  .katman1.table-header {
    padding: 6px 8px;
  }

  .orders-container {
    max-height: 200px;
  }
}

/* Loading animation for dynamic content */
.masaitem.table-card.loading {
  opacity: 0.7;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.7;
  }
}

/* Status color variations */
.masaitem.table-card.border-success .katman1.table-header {
  background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
}

.masaitem.table-card.border-warning .katman1.table-header {
  background: linear-gradient(135deg, #ffc107 0%, #ffcd39 100%);
}

.masaitem.table-card.border-danger .katman1.table-header {
  background: linear-gradient(135deg, #dc3545 0%, #e4606d 100%);
}

.masaitem.table-card.border-dark .katman1.table-header {
  background: linear-gradient(135deg, #6c757d 0%, #7d8591 100%);
}

/* Status-specific order styling */
.siparis.info {
  background: rgba(23, 162, 184, 0.1);
  border-left: 4px solid #17a2b8;
}

.siparis.info .durum {
  background: rgba(23, 162, 184, 0.2);
  color: #17a2b8;
  font-weight: 700;
}

.siparis.success {
  background: rgba(40, 167, 69, 0.1);
  border-left: 4px solid #28a745;
}

.siparis.success .durum {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  font-weight: 700;
}

.siparis.primary {
  background: rgba(0, 123, 255, 0.1);
  border-left: 4px solid #007bff;
}

.siparis.primary .durum {
  background: rgba(0, 123, 255, 0.2);
  color: #007bff;
  font-weight: 700;
}

.siparis.secondary {
  background: rgba(108, 117, 125, 0.1);
  border-left: 4px solid #6c757d;
}

.siparis.secondary .durum {
  background: rgba(108, 117, 125, 0.2);
  color: #6c757d;
  font-weight: 700;
}

/* Order count badge */
.orders-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #ff6247 0%, #ff8a7b 100%);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(255, 98, 71, 0.4);
  z-index: 10;
}

/* Priority indicators */
.siparis.priority-high {
  border-left: 4px solid #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.siparis.priority-medium {
  border-left: 4px solid #ffc107;
  background: rgba(255, 193, 7, 0.1);
}

.siparis.priority-low {
  border-left: 4px solid #28a745;
  background: rgba(40, 167, 69, 0.1);
}
