/* Base Styles */
:root {
  --bg-dark: #121212;
  --bg-dark-secondary: #1e1e1e;
  --bg-gradient-start: #1a1a2e;
  --bg-gradient-end: #16213e;
  --accent-primary: #4361ee;
  --accent-secondary: #3a0ca3;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --occupied-bg: #ff9f1c;
  --available-bg: #2c3e50;
  --success-color: #06d6a0;
  --error-color: #ef476f;
  --warning-color: #ffd166;
  --smaller-guest: #7678ed;
  --call-btn-color: #38b000;
  --finish-btn-color: #fe5e41;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

input.virtual-keyboard-input {
  width: 701px;
  height: 49px;
  font-size: 21.6px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  color: var(--text-primary);
  overflow: hidden;
}

/* Main Container (Responsive) - Updated for fixed height and scrolling */
.main-container {
  width: 100%;
  height: 95%;
  /* Fixed height - 90% of viewport */
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-rows: 100%;
  grid-template-areas: "queue-left queue-right";
  gap: 1%;
  padding: 1%;
  overflow: auto;
  /* Enable scrolling if content overflows */
  background-color: rgba(41, 25, 102, 0.5);
  overflow: hidden;
}

/* Queue Area (Left Side - 50%) */
.queue-area {
  grid-area: queue-left;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 0.8%;
  padding: 0.5%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Queue Area (Right Side - 50%) */
.queue-area-right {
  grid-area: queue-right;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 0.8%;
  padding: 0.5%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.queue-area h2, .queue-area-right h2 {
  margin-bottom: 1%;
  text-align: center;
  color: var(--text-primary);
  border-bottom: 1px solid var(--accent-primary);
  padding-bottom: 0;
  font-size: 2vw;
}

.queue-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1%;
  margin-top: -5%;
}

.reset-guests-btn {
  background-color: var(--error-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5% 1%;
  font-size: 1vw;
  cursor: pointer;
}

.queue-group {
  margin-bottom: 1.5%;
  overflow: hidden;
  padding-top: 3px;
  padding-left: 10px;
  padding-right: 9px;
  border: 1px solid #747474;
  /*+border-radius: 2.5px;*/
  -moz-border-radius: 2.5px;
  -webkit-border-radius: 2.5px;
  -khtml-border-radius: 2.5px;
  border-radius: 2.5px;
  padding-bottom: 4px;
}

.queue-group-header {
  padding: 0.5% 1%;
}

.queue-group-header h3 {
  font-size: 1.6vw;
}

h3 {
}

.queue-time {
  font-size: 0.9vw;
  color: var(--warning-color);
  white-space: nowrap;
}

.queue-list {
  overflow-y: auto;
  flex-grow: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-dark-secondary);
}

.queue-list::-webkit-scrollbar {
  width: 0.8%;
}

.queue-list::-webkit-scrollbar-track {
  background: var(--bg-dark-secondary);
}

.queue-list::-webkit-scrollbar-thumb {
  background-color: var(--accent-primary);
  border-radius: 4px;
}

.queue-item {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.5%;
  padding: 0% 1%;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  margin-bottom: 1.5px;
  height: ;
}

.queue-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.queue-number {
  width: 2vw;
  height: 2vw;
  background-color: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  margin-right: 1%;
  font-size: 1vw;
}

.guest-info {
  flex-grow: 1;
  display: flex;
  flex-direction: row;
}

.guest-name {
  font-weight: bold;
  font-size: 1.1vw;
  padding-left: 6px;
}

.guest-count {
  font-size: 0.9vw;
  color: var(--text-secondary);
  padding-left: 6px;
}

.queue-id {
  font-size: 1.2vw;
  color: rgba(250, 248, 248, 0.766);
  margin-bottom: 0.5%;
}

.table-size {
  padding: 0.4% 0.8%;
  background-color: var(--accent-secondary);
  border-radius: 4px;
  font-size: 0.9vw;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 2%;
  font-style: italic;
  font-size: 2.7vw;
}

/* Call Button */
.call-button {
  background-color: var(--call-btn-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5vw 1vw 0.4vw;
  margin-left: 0.5vw;
  cursor: pointer;
  font-size: 0.9vw;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  margin-bottom: 1.5px;
}

.call-button:hover {
  filter: brightness(1.1);
}

.call-button-icon {
  margin-right: 0.5vw;
  font-size: 1vw;
}

/* Finish Button */
.finish-button {
  background-color: var(--finish-btn-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5vw 1vw 0.4vw;
  margin-left: 0.5vw;
  cursor: pointer;
  font-size: 0.9vw;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  margin-bottom: 1.5px;
}

.finish-button:hover {
  filter: brightness(1.1);
}

.finish-button-icon {
  margin-right: 0.5vw;
  font-size: 1vw;
}

/* Registration Container */
.registration-container {
  display: flex;
  flex-direction: row;
  gap: 2%;
}

.keyboard-container {
  flex: ;
  width: 71%;
}

.guest-count-container {
  display: flex;
  flex-direction: column;
  width: 241px;
  /*+box-shadow: 0 0;*/
  -moz-box-shadow: 0 0;
  -webkit-box-shadow: 0 0;
  box-shadow: 0 0;
  background-color: rgba(219, 114, 114, 0);
  padding-bottom: 0;
}

/* Keypad untuk jumlah kursi */
.seat-count-btn {
  width: 7.5vw;
  height: 4.6vw;
  border-radius: 15%;
  border: 1px solid var(--accent-primary);
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 2.1vw;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 3px;
  margin-bottom: 10px;
}

.seat-count-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 2%;
  margin-top: 5%;
  width: 193px;
  background-color: rgba(235, 50, 50, 0);
  padding: 5px;
}

.seat-count-btn.active {
  background-color: var(--accent-primary);
  color: white;
}

/* Virtual Keyboard - Updated with Fixed Layout and Quick Text buttons */
.virtual-keyboard-container {
  background-color: #2C3E50;
  border-radius: 1%;
  padding: 1%;
  margin-top: 1%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 99%;
  margin: 1% 0 1.2%;
}

.virtual-keyboard-row {
  display: flex;
  justify-content: center;
  margin-bottom: 0.8%;
}

.keyboard-key {
  flex: 1;
  height: 7.8vh;
  margin: 0 0.2%;
  border-radius: 0.5%;
  border: none;
  background-color: #34495E;
  color: #CEC6C6;
  font-size: 2vw;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.1s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.keyboard-key:active {
  transform: translateY(2px);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.keyboard-key-special {
  background-color: #2980B9;
  min-width: 6%;
}

.keyboard-key-quicktext {
  background-color: rgba(1, 126, 155, 0.766);
  flex: 2;
  margin: 0 0.3% 3px;
  font-size: 1.6vw;
  height: 41px;
  /*+border-radius: 4px;*/
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  -khtml-border-radius: 4px;
  border-radius: 4px;
  color: #FFFFFF;
}

.keyboard-key-space {
  width: 80%;
  height: 8.6vh;
  border-radius: 0.5%;
  border: none;
  background-color: #34495E;
  color: white;
  font-size: 2.5vw;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.1s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.keyboard-key-space:active {
  transform: translateY(2px);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

/* Action Buttons Area - Updated to be fixed at bottom 10% */
.action-buttons-fixed {
  position: absolute;
  bottom: 0%;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10;
  height: 5%;
}

.action-buttons-fixed button {
  flex-grow: 1;
  margin: 0 0.5%;
  padding: 1%;
  border: none;
  border-radius: 0.5%;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.2vw;
}

.config-btn {
  background-color: var(--accent-secondary);
}

.register-btn {
  background-color: var(--accent-primary);
}

.report-btn {
  background-color: #16A085;
}

.back-btn {
  background-color: var(--error-color);
}

.fullscreen-btn {
  background-color: #16A085;
}

.action-buttons-fixed button:hover {
  filter: brightness(1.1);
}

.action-buttons-fixed button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-secondary);
  margin: 1.5% 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--text-secondary);
}

.divider span {
  padding: 0 1%;
  font-size: 1vw;
}

.modal-content {
  background: linear-gradient(135deg, #1E2030 0%, #2C3E50 100%);
  border-radius: 0.8%;
  width: 118%;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  height: auto;
  padding: 20px;
}

.modal-content h2 {
  text-align: center;
  margin-bottom: 1%;
  color: var(--text-primary);
  border-bottom: 1px solid var(--accent-primary);
  padding-bottom: 0%;
  font-size: 2vw;
}

.modal-content h3 {
  font-size: 1.5vw;
  margin-bottom: 1%;
}

.modal-content p {
  font-size: 2.4vw;
  margin-bottom: 1%;
}

.modal-form {
  margin-bottom: 2%;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 1.1vw;
}

.form-group input {
  width: 100%;
  padding: 1%;
  border-radius: 4px;
  border: 1px solid #444;
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  font-size: 2.7vw;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1%;
  margin-top: -12px;
}

.primary-btn, .cancel-btn, .delete-btn, .export-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2vw;
  margin-top: -68px;
  margin-bottom: 26px;
}

.primary-btn {
  background-color: var(--accent-primary);
  color: white;
  font-size: 13.2px;
}

.export-btn {
  background-color: var(--warning-color);
  color: #333;
}

.cancel-btn {
  background-color: #666;
  color: white;
  font-size: 16.2px;
  margin-left: 8px;
}

.delete-btn {
  background-color: var(--error-color);
  color: white;
}

.message {
  margin-top: 1.5%;
  padding: 0.8%;
  border-radius: 4px;
  text-align: center;
  font-size: 1.1vw;
}

.success {
  background-color: var(--success-color);
  color: #FFF;
}

.error {
  background-color: var(--error-color);
  color: #FFF;
}

/* Restaurant Configuration */
.restaurant-config {
  margin-bottom: 20px;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

/* Grid Configuration */
.grid-config {
  margin-bottom: 20px;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.grid-config h4 {
  margin: 15px 0 10px;
  font-size: 1.2vw;
}

.grid-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.color-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 8px;
  border-radius: 4px;
  min-width: 80px;
}

.color-group label {
  margin-bottom: 5px;
  font-size: 0.9vw;
}

.color-group input[type="color"] {
  width: 40px;
  height: 30px;
  border: none;
  background: none;
  cursor: pointer;
}

.reset-colors-btn {
  background-color: #666;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 0.9vw;
  cursor: pointer;
  margin-top: 5px;
}

.reset-colors-btn:hover {
  background-color: #777;
}

/* TTS Configuration */
.tts-config {
  margin-top: 2%;
  padding: 2%;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.tts-config h3 {
  margin-bottom: 1%;
  font-size: 1.4vw;
}

.range-container {
  display: flex;
  align-items: center;
  margin-bottom: 1.5%;
}

.range-container label {
  flex: 1;
  margin-bottom: 0;
  font-size: 1.1vw;
}

.range-container input {
  flex: 2;
}

.range-value {
  width: 10%;
  text-align: right;
  font-size: 1vw;
  margin-left: 1%;
}

.test-tts-btn {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.8% 1.5%;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1vw;
}

/* Printer Configuration */
.printer-config {
  margin-top: 2%;
  padding: 2%;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.printer-config h3 {
  margin-bottom: 1%;
  font-size: 1.4vw;
}

.printer-options {
  display: flex;
  gap: 5%;
  margin-bottom: 2%;
}

.printer-option {
  display: flex;
  align-items: center;
  gap: 0.5vw;
}

.printer-option input[type="radio"] {
  width: 1.2vw;
  height: 1.2vw;
}

.printer-option label {
  font-size: 1.2vw;
}

.printer-section {
  margin-top: 2%;
  padding: 2%;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.test-connection-btn {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.8% 1.5%;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1vw;
  margin-top: 1%;
}

/* Custom People Count Configuration */
.custom-count-config {
  margin-top: 2%;
  padding: 2%;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.custom-count-config h3 {
  margin-bottom: 1%;
  font-size: 1.4vw;
}

.custom-count-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1%;
  margin-bottom: 1%;
}

.custom-count-item {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.5% 1%;
  border-radius: 4px;
}

.custom-count-value {
  margin-right: 1%;
  font-size: 1.1vw;
}

.remove-count-btn {
  background-color: var(--error-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 1.5vw;
  height: 1.5vw;
  font-size: 0.8vw;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.add-count-container {
  display: flex;
  align-items: center;
  gap: 1%;
  margin-top: 1%;
}

.add-count-input {
  width: 20%;
  padding: 0.5%;
  border-radius: 4px;
  border: 1px solid #444;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 1.1vw;
}

/* Report & Rekap Styles */
.report-section {
  margin-bottom: 20px;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.report-stats {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
}

.report-stat-item {
  flex: 1;
  min-width: 120px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 15px;
  text-align: center;
}

.stat-label {
  font-size: 1vw;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 2vw;
  font-weight: bold;
  color: var(--text-primary);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.report-table th, .report-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.report-table th {
  background-color: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-size: 1vw;
}

.report-table td {
  font-size: 0.9vw;
  color: var(--text-secondary);
}

.empty-table {
  text-align: center;
  font-style: italic;
  padding: 20px;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 20px;
}

/* Waiting Time in confirmation modal */
.waiting-time-large {
  color: var(--warning-color);
  font-size: 1.2vw;
  margin: 1% 0;
  text-align: center;
}

/* Status for WebSocket and SpeechSynthesis */
#tts-status, #printer-status {
  position: fixed;
  bottom: 10px;
  padding: 5px 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 4px;
  font-size: 0.9vw;
  z-index: 1000;
}

#tts-status {
  left: 10px;
}

#printer-status {
  right: 10px;
}

.status-connected {
  color: var(--success-color);
}

.status-disconnected {
  color: var(--error-color);
}
