@import "tailwindcss";

/* 
 * ==========================================================
 * TR MVP BOOKING PLUGIN - BEAUTIFUL FRONTEND STYLES
 * ==========================================================
 * Скопируйте всё, что ниже этой строки и вставьте в ваш файл:
 * wp-content/plugins/table-reservation-mvp/assets/css/frontend.css
 * ==========================================================
 */

.tr-booking-app {
  font-family: system-ui, -apple-system, sans-serif;
  color: #1e293b;
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.tr-page-title {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

/* Toolbar (Date picker) */
.tr-toolbar {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}
.tr-toolbar label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 16px;
  color: #475569;
}
.tr-toolbar input[type="date"] {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
  cursor: pointer;
}
.tr-toolbar input[type="date"]:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* The Map / Room */
.tr-map-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 20px 0;
}

.tr-map {
  background: #ffffff !important;
  border: 10px solid #fd6868 !important; /* Червона стіна */
  border-radius: 4px !important;
  min-height: 440px !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: row-reverse !important; /* Стіл 1 справа, 5 зліва */
  justify-content: center !important;
  align-items: center !important;
  gap: 30px !important;
  padding: 40px 30px !important;
  position: relative !important;
  box-sizing: border-box !important;
}

/* Map door entrance indicator */
.tr-map::after {
  content: 'ВХІД' !important;
  position: absolute !important;
  top: 50% !important;
  right: -10px !important; /* Перекриває рамку */
  transform: translateY(-50%) !important;
  width: 40px !important; /* Ширше щоб вмістити текст, фон білий тому зливається з кімнатою */
  height: 120px !important; /* Розмір отвору */
  background: #ffffff !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding-right: 14px !important; /* Відступ від зовнішнього краю */
  font-weight: 800 !important;
  font-size: 12px !important;
  letter-spacing: 4px !important;
  writing-mode: vertical-rl !important;
  text-orientation: upright !important;
  text-indent: 0 !important;
}

/* Tables */
.tr-table {
  appearance: none !important;
  background: #313f68 !important; 
  width: 100px !important;
  height: 180px !important;
  min-width: 40px !important;
  border: 2px solid #ffffff !important;
  border-radius: 2px !important;
  position: relative !important;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.4) !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  text-decoration: none !important;
  margin: 0 !important;
}

.tr-table:hover:not(.is-disabled) {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 4px 12px 20px rgba(0, 0, 0, 0.3) !important;
  background: #3d4f80 !important;
}

/* Ping Pong Net */
.tr-table::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: -4px !important;
  right: -4px !important;
  height: 4px !important;
  background: #cbd5e1 !important;
  transform: translateY(-50%) !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3) !important;
  z-index: 1 !important;
  border-radius: 0 !important;
}

/* Ping Pong Center Line */
.tr-table::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 50% !important;
  width: 2px !important;
  background: #ffffff !important;
  transform: translateX(-50%) !important;
  opacity: 0.6 !important;
  border-radius: 0 !important;
}

/* Table Name/Number */
.tr-table__name {
  position: relative !important;
  z-index: 2 !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1 !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
}

/* Closed/Disabled tables */
.tr-table--closed,
.tr-table.is-disabled {
  background: #64748b !important;
  cursor: not-allowed !important;
  filter: grayscale(0.5) !important;
  box-shadow: none !important;
  transform: none !important;
}
.tr-table.is-disabled .tr-table__name {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Modal styling */
.tr-modal[hidden] {
  display: none !important;
}

.tr-modal {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(8px) !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  animation: tr-fade-in 0.2s ease-out !important;
  margin: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

@keyframes tr-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tr-modal__dialog {
  background: #ffffff !important;
  width: 100% !important;
  max-width: 500px !important;
  border-radius: 20px !important;
  padding: 32px !important;
  position: relative !important;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25) !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  animation: tr-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

@keyframes tr-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tr-close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #f1f5f9 !important;
  border: none !important;
  color: #64748b !important;
  font-size: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  line-height: 1 !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.tr-close:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

#tr-modal-title {
  margin: 0 0 8px !important;
  font-size: 28px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.2 !important;
  text-align: left !important;
}

.tr-meta {
  color: #64748b !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  margin-bottom: 24px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-align: left !important;
}

/* Slots Grid */
.tr-slots {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 24px !important;
}

.tr-slot {
  appearance: none !important;
  background: #ffffff !important;
  border: 2px solid #e2e8f0 !important;
  color: #334155 !important;
  padding: 12px 8px !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  font-family: inherit !important;
  margin: 0 !important;
  text-align: center !important;
  line-height: 1 !important;
}

.tr-slot:hover:not(.is-disabled) {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

.tr-slot.is-selected {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.tr-slot.is-disabled {
  background: #f8fafc !important;
  border-color: #f1f5f9 !important;
  color: #cbd5e1 !important;
  text-decoration: line-through !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}

.tr-summary {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  color: #166534 !important;
  padding: 16px !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  margin-bottom: 24px !important;
  text-align: center !important;
}

.tr-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 16px 24px !important;
  border-radius: 12px !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  font-family: inherit !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.tr-btn:hover {
  background: #dc2626 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4) !important;
}

/* Empty State */
.tr-empty {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  background: #f8fafc;
  border-radius: 12px;
  color: #64748b;
  font-weight: 600;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .tr-booking-app {
    padding: 16px;
    border-radius: 0;
    box-shadow: none;
  }
  
  .tr-page-title {
    font-size: 24px;
  }

  .tr-map-wrap {
    overflow-x: auto;
    padding-bottom: 20px;
  }

  .tr-map {
    padding: 30px 10px !important;
    gap: 4px !important;
    min-height: 240px !important;
    border-width: 6px !important;
    align-items: center !important;
    min-width: 220px;
    box-sizing: border-box;
  }
  
  .tr-map::after {
    right: -9px !important;
    width: 6px !important;
    height: 50px !important;
    font-size: 12px !important;
    text-indent: -34px !important;
  }

  /* Make tables proportioned for mobile */
  .tr-table {
    flex: 1 !important;
    height: 100px !important;
    min-width: 0 !important;
  }
  
  .tr-table__name {
    font-size: 20px !important;
  }

  .tr-modal__dialog {
    padding: 24px 20px !important;
    margin: 16px !important;
    border-radius: 16px !important;
    width: auto !important;
  }

  #tr-modal-title {
    font-size: 22px !important;
    padding-right: 32px !important;
  }
  
  .tr-slots {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}