/* Reset básico - los estilos temáticos se manejan en los archivos de tema */
body {
  margin: 0;
  padding: 0;
  min-width: 320px;
  min-height: 100vh;
}

/* Fuente base - los temas pueden sobrescribir esto */
:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Global styles only for admin/backend */
.app {
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

#root {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Frontend styles are handled by theme.css */

/* Base Button Styles */
.btn {
  border: solid;
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Button Color Variants */
.btn-primary {
  background-color: #4CAF50;
  color: white;
}

.btn-primary:hover {
  background-color: #45a049;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
  background-color: #2196F3;
  color: white;
}

.btn-secondary:hover {
  background-color: #0b7dda;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-tertiary {
  background-color: #9C27B0;
  color: white;
}

.btn-tertiary:hover {
  background-color: #7b1fa2;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.header-container {
  background-color: #eb512a;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 48px;
  padding: 8px 16px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.app-title {
  font-size: 18px;
  color: #ffffff;
  margin: 0;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
  padding: 0 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .header-container {
    min-height: 42px;
    padding: 8px 12px;
    justify-content: center;
  }

  .app-title {
    font-size: 16px;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  .header-container {
    min-height: 38px;
    padding: 6px 10px;
  }

  .app-title {
    font-size: 14px;
    line-height: 1.3;
  }
}

/* Extra small screens */
@media (max-width: 360px) {
  .header-container {
    min-height: 36px;
    padding: 6px 8px;
  }

  .app-title {
    font-size: 13px;
    line-height: 1.3;
  }
}

/* Settings Menu Styles */
.settings-menu-container {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
}

.btn-settings {
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-settings:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
}

.settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 200px;
  z-index: 9999;
  overflow: hidden;
}

.settings-section {
  border-bottom: 1px solid #e0e0e0;
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section-title {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: #f5f5f5;
}

.settings-toggle-group {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  text-align: left;
}

.settings-toggle-btn:hover {
  background-color: #f0f0f0;
}

.toggle-indicator {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 2px solid #ccc;
  flex-shrink: 0;
}

.settings-toggle-btn.active .toggle-indicator {
  background-color: #4CAF50;
  border-color: #4CAF50;
}

.settings-toggle-btn.active .toggle-indicator::after {
  content: '✓';
  color: white;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.settings-logout-btn,
.settings-about-btn {
  width: 100%;
  padding: 12px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background-color 0.2s ease;
}

.settings-logout-btn {
  color: #dc3545;
  font-weight: 500;
}

.settings-logout-btn:hover {
  background-color: #f8d7da;
}

.settings-about-btn {
  color: #333;
}

.settings-about-btn:hover {
  background-color: #f0f0f0;
}

@media (max-width: 768px) {
  .settings-menu-container {
    right: 10px;
  }

  .btn-settings {
    padding: 5px;
  }

  .btn-settings svg {
    width: 18px;
    height: 18px;
  }

  .settings-dropdown {
    min-width: 180px;
  }
}

@media (max-width: 480px) {
  .settings-menu-container {
    right: 8px;
  }

  .btn-settings {
    padding: 4px;
  }

  .btn-settings svg {
    width: 16px;
    height: 16px;
  }

  .settings-dropdown {
    min-width: 160px;
    right: -4px;
  }

  .settings-section-title {
    font-size: 10px;
    padding: 6px 10px;
  }

  .settings-toggle-btn {
    padding: 6px 10px;
    font-size: 13px;
  }

  .settings-logout-btn,
  .settings-about-btn {
    padding: 10px;
    font-size: 13px;
  }
}

.buttons-container {
  display: flex;
  gap: 16px;
  margin: 0 16px 16px 16px;
  align-items: flex-start;
}

.buttons-container > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.buttons-container .btn-danger {
  margin-left: auto;
  align-self: flex-start;
}

/* Admin buttons container specific styles */
.admin-buttons-container {
  margin-bottom: 8px !important;
}

.loading {
  text-align: center;
  padding: 20px;
  font-size: 1.2rem;
  color: #666;
}

/* Time Bar Styles */
.time-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem 1rem;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 1rem;
}

.time-bar-content {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.time-container {
  display: inline-block;
}

.blinking-colon {
  animation: blink 1s infinite;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width: auto;              /* Se ajusta al contenido */
  min-width: 300px;         /* Ancho mínimo para que no se vea muy estrecho */
  max-width: 400px;         /* Ancho máximo para que no ocupe toda la pantalla */
}

.btn-active {
  background-color: #007bff;
  color: white;
  border-bottom: 4px solid #0056b3;
  text-decoration: underline;
}

/* ===== Grupos de Botones ===== */
.btn-group-menu {
  background-color: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.btn-group-menu:hover {
  background-color: #45a049;
  border-color: #45a049;
}

.btn-group-ticket {
  background-color: #eb512a;
  color: white;
  border-color: #eb512a;
}

.btn-group-ticket:hover {
  background-color: #d94520;
  border-color: #d94520;
}

.btn-group-admin {
  background-color: #6c757d;
  color: white;
  border-color: #6c757d;
}

.btn-group-admin:hover {
  background-color: #5a6268;
  border-color: #5a6268;
}

/* Estado activo para botones de grupo */
.btn-group-menu.btn-active {
  background-color: #2e7d32;
  border-bottom-color: #1b5e20;
}

.btn-group-ticket.btn-active {
  background-color: #c43e1b;
  border-bottom-color: #9c3115;
}

.btn-group-admin.btn-active {
  background-color: #495057;
  border-bottom-color: #343a40;
}

/* ===== Responsive Styles for Vertical Devices ===== */

/* Vertical/Portrait orientation - simplified with settings menu */
@media (orientation: portrait) and (max-width: 1024px) {
  .header-container {
    padding: 8px 50px 8px 16px;
    min-height: auto;
  }

  .app-title {
    font-size: 16px;
    padding: 0;
  }
}

/* Small vertical devices */
@media (orientation: portrait) and (max-width: 480px) {
  .header-container {
    padding: 6px 45px 6px 12px;
    min-height: 38px;
  }

  .app-title {
    font-size: 14px;
  }

  /* Time bar adjustments for small screens */
  .time-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .time-bar-content {
    gap: 0.5rem;
    font-size: 14px;
  }
}

/* Extra small vertical devices */
@media (orientation: portrait) and (max-width: 360px) {
  .header-container {
    padding: 6px 40px 6px 10px;
    min-height: 36px;
  }

  .app-title {
    font-size: 13px;
  }

  .time-bar-content {
    font-size: 12px;
  }
}

/* Buttons container responsive for vertical devices */
@media (orientation: portrait) and (max-width: 768px) {
  .buttons-container {
    flex-direction: column;
    gap: 12px;
    margin: 0 8px 12px 8px;
  }

  .buttons-container > div {
    justify-content: center;
  }

  .buttons-container .btn {
    font-size: 13px;
    padding: 6px 10px;
  }
}

/* Landscape orientation - keep original layout but adjust as needed */
@media (orientation: landscape) and (max-height: 500px) {
  .header-container {
    min-height: 36px;
    padding: 6px 45px 6px 12px;
  }

  .app-title {
    font-size: 14px;
  }
}
