/* Ocultar todo hasta que cargue */
body:not(.loaded) .container,
body:not(.loaded) .slider,
body:not(.loaded) .screen {
  visibility: hidden;
  opacity: 0;
}

body.loaded .container,
body.loaded .slider,
body.loaded .screen {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  touch-action: pan-y;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  font-size: 1em;
  background: #333333;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.container {
  position: fixed;
  top: 0;
  left: 0;
  height: -webkit-fill-available;
  background: #000000;
  overflow: hidden;
  transition: opacity 0.5s ease-out;
}

.slider {
  display: flex;
  width: 500%;
  height: 100%;
  transition: transform 0.3s ease-in-out;
  transition: opacity 0.5s ease-out;
}

.screen {
  width: 20%;
  height: 100%;
  flex-shrink: 0;
  padding: 1.25em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  transition: opacity 0.5s ease-out;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Colores pantallas */
#main-screen {
  background-image: image-set(
    url("/assets/img/app/LivingNao.avif") type("image/avif"),
    url("/assets/img/app/LivingNao.jpg") type("image/jpeg")
  );
}
#screen-1 {
  background-image: image-set(
    url("/assets/img/app/ClosetNao.avif") type("image/avif"),
    url("/assets/img/app/ClosetNao.jpg") type("image/jpeg")
  );
}
#screen-2 {
  background-image: image-set(
    url("/assets/img/app/MenuIANao.avif") type("image/avif"),
    url("/assets/img/app/MenuIANao.jpg") type("image/jpeg")
  );
}
#screen-3 {
  background-image: image-set(
    url("/assets/img/app/JuegosNao.avif") type("image/avif"),
    url("/assets/img/app/JuegosNao.jpg") type("image/jpeg")
  );
}
#screen-4 {
  background-image: image-set(
    url("/assets/img/app/TareasNao.avif") type("image/avif"),
    url("/assets/img/app/TareasNao.jpg") type("image/jpeg")
  );
}

.screen-content {
  width: 90%;
  max-width: 25em;
  margin: 0 auto;
  margin-top: 2em;
  max-height: 80dvh;
  text-align: center;
  overflow: auto;
}

.contenido {
  background-color: #ffffff;
  padding: 1.25em;
  border-radius: 0.9375em;
}

.nav-dots {
  position: absolute;
  bottom: max(0.9375em, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.625em;
  z-index: 100;
}

.dot {
  width: 0.625em;
  height: 0.625em;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s;
}

.active-dot {
  background: #ffffff;
  transform: scale(1.2);
}

.no-select {
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* Versión celular */
@media (max-width: 767px), (max-height: 499px) {
  .container {
    width: 100dvw;
    height: 100dvh;
  }
}

/* Versión PC-tablet */
@media (min-width: 768px) and (min-height: 500px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000000;
  }

  .container {
    position: relative;
    aspect-ratio: 9 / 16;
    border: 1em solid #333333;
    border-radius: 2.25em;
    box-shadow: 0 0 1.875em rgba(0, 0, 0, 0.7);
  }

  .screen-content {
    max-height: 90%;
  }

  body::after {
    content: "Versión móvil (simulada)";
    position: fixed;
    bottom: 0.1em;
    text-align: center;
    color: #ffffff;
    font-size: 1em;
    opacity: 0.5;
  }
}

/* Soporte Safari iOS*/
@supports (-webkit-touch-callout: none) {
  body {
    height: -webkit-fill-available;
  }
}

/* Pantalla de carga */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  color: #ffffff;
}

.loading-spinner {
  width: 3.125em;
  height: 3.125em;
  border: 0.3125em solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto 1.25em;
}

.loading-text {
  font-size: 1.2em;
  font-weight: bold;
}

/* Mensaje girar celular */
.orientation-warning {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000000;
  color: #ffffff;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.25em;
  z-index: 1000;
  font-size: 1.3em;
}

.orientation-warning svg {
  width: 6.25em;
  height: 6.25em;
  margin-bottom: 1.875em;
}

.orientation-warning p {
  margin: 0.625em 0;
  max-width: 80%;
}

@media (max-width: 767px) and (orientation: landscape) {
  .container {
    display: none !important;
  }

  .orientation-warning {
    display: flex;
  }
}

/* Animación girar */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Usuarios con reducción de movimientos */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Estilos contenido */
/* Encabezados */
h1,
h2 {
  font-weight: bold;
  text-align: center;
  margin-bottom: 0;
}

h1 {
  font-size: 1.6em;
  line-height: 1;
}

h2 {
  font-size: 1.375em;
  line-height: 1.0909;
}

h3 {
  font-size: 1.2em;
  line-height: 1.2;
}

h4 {
  font-size: 1.125em;
  line-height: 1.33333333;
}

div.separador {
  height: 1em;
  margin: 0 auto;
}

/*Logo*/
picture.logo img {
  width: 100%;
  max-width: 300px;
  max-height: 3em;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* Estilos base */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.1em;
  display: flex;
  flex-direction: column;
}

#screen-2 div.contenido {
  padding: 1em;
}

.message {
  max-width: 80%;
  padding: 0.75em 1em;
  margin-bottom: 0.625em;
  border-radius: 1em;
  line-height: 1.4;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  font-size: 0.8em;
}

.user {
  align-self: flex-end;
  background-color: #0084ff;
  color: white;
  border-bottom-right-radius: 0;
}

.gemini {
  align-self: flex-start;
  background-color: #e0e0e0;
  color: #000;
  border-bottom-left-radius: 0;
}

/* Estilos de botones unificados */
.btn {
  padding: 0.625em 1.25em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
  font-family: inherit;
}

.btn-sm {
  padding: 0.5em;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-danger {
  background-color: #ff4444;
  color: white;
}

.btn-danger:hover {
  background-color: #cc0000;
}

.btn-success {
  background-color: #4caf50;
  color: white;
}

.btn-success:hover {
  background-color: #388e3c;
}

.btn-ia {
  padding: 0.5em;
}

/* Input area */
.input-area {
  display: flex;
  padding: 10px;
  background: white;
  border-top: 1px solid #ccc;
  gap: 10px;
}

.input-area textarea {
  flex: 1;
  resize: none;
  padding: 0.5em;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 1em;
  height: 50px;
}

/* Game styles */
.game-menu {
  margin: 0 auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.game-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 8px;
  transition: transform 0.2s;
  box-shadow: 0 0 0.9375em rgba(0, 0, 0, 0.2);
}

.game-item:hover {
  transform: translateY(-2px);
}

.game-image {
  max-width: 20%;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 15px;
}

.game-info {
  flex: 1;
  margin-right: 15px;
}

.game-info h3 {
  margin: 0 0 5px 0;
  color: #2c3e50;
}

.game-info p {
  margin: 0;
  font-size: 0.9em;
  color: #7f8c8d;
}

/* Calendar styles */
.date-display {
  font-size: 1.2em;
  line-height: 1.2;
  font-weight: bold;
  color: #333;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 0 0.9375em rgba(0, 0, 0, 0.2);
}

.date-navigation {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tasks-container {
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 0 0.9375em rgba(0, 0, 0, 0.2);
  padding: 20px;
  margin-bottom: 20px;
}

.task-list {
  font-size: 1em;
  list-style-type: none;
  padding: 0;
  margin-top: 15px;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
  gap: 5px;
}

.task-item:last-child {
  border-bottom: none;
}

.task-text {
  flex-grow: 1;
}

.task-text p {
  margin-top: 5px;
}

.task-completed {
  text-decoration: line-through;
  color: #888;
}

.task-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 80px;
}

/* Dialog styles */
#task-dialog {
  border: none;
  border-radius: 8px;
  padding: 0;
  width: 90%;
  max-width: 25em;
  box-shadow: 0 0 0.9375em rgba(0, 0, 0, 0.2);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 90dvh;
  overflow-y: auto;
}

#task-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.dialog-content {
  padding: 20px;
  max-height: calc(90vh - 40px);
  overflow-y: auto;
}

/* Form styles */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  font-family: inherit;
}

.form-group textarea {
  height: 100px;
  resize: none;
}
