/* ============= ESTRUCTURA GENERAL ============= */

.reviews-layout {
  margin: 0;
  background-color: #1c3b70;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  font-family: "Special Elite", cursive;
}

/* ============= HEADER ============= */

.full-width-header {
  background-color: #1a54fa;
  filter: brightness(0.8) contrast(0.9);
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(to right, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to bottom, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to left, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to top, rgba(107, 63, 47, 0.8) 6px, transparent 6px);
  background-position:
    0 0,
    0 0,
    100% 0,
    0 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-sizing: border-box;
  padding: 30px;
  animation:
    slideInRight 1.5s ease-out,
    flicker 3s infinite 1.5s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 200px;
  width: 100%;
  z-index: 10;
}

.back-link {
  font-family: "Special Elite", cursive;
  color: #f5d742;
  text-decoration: none;
  margin-top: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
}

/* ============= CONTENEDOR PRINCIPAL ============= */

.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ============= SIDEBAR ============= */

.wide-sidebar {
  background-color: #1a54fa;
  filter: brightness(0.8) contrast(0.9);
  position: relative;
  overflow: hidden;
  width: 400px;
  min-width: 400px;
  background-image:
    linear-gradient(to right, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to bottom, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to left, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to top, rgba(107, 63, 47, 0.8) 6px, transparent 6px);
  background-position:
    0 0,
    0 0,
    100% 0,
    0 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-sizing: border-box;
  padding: 20px;
  opacity: 0;
  transition:
    background-image 0.5s ease-in-out,
    opacity 0.5s ease;
}

/* ============= ÁREA DE CONTENIDO ============= */

.content-scrollable {
  position: relative;
  overflow-y: scroll;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background-color: #1a54fa;
  filter: brightness(0.8) contrast(0.9);
  background-image:
    linear-gradient(to right, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to bottom, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to left, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to top, rgba(107, 63, 47, 0.8) 6px, transparent 6px);
  background-position:
    0 0,
    0 0,
    100% 0,
    0 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-sizing: border-box;
  padding: 20px;
  animation: flicker 3s infinite;
}

.content-scrollable::-webkit-scrollbar {
  display: none;
}

/* ============= LISTA DE REVIEWS ============= */

.reviews-list {
  list-style-type: none;
  padding: 0;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
}

.review-item {
  margin: 15px 0;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  width: 80%;
  position: relative;
}

.review-item.even {
  margin-right: auto;
  margin-left: 0;
  text-align: left;
  border-left: 4px solid rgba(107, 63, 47, 0.8);
  border-right: none;
}

.review-item.odd {
  margin-left: auto;
  margin-right: 0;
  text-align: right;
  border-right: 4px solid #f5d742;
  border-left: none;
}

.review-item:hover {
  transform: translateX(10px);
  filter: brightness(1.1);
}

.review-item a {
  font-family: "Special Elite", cursive;
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  display: block;
}

.review-year {
  font-family: "Special Elite", cursive;
  color: #f5d742;
  font-size: 0.9rem;
}

.review-count {
  font-family: "Special Elite", cursive;
  display: inline-block;
  margin-left: 10px;
  background-color: #f5d742;
  color: #1c3b70;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
  vertical-align: middle;
  cursor: help;
}

/* ============= FLECHAS DE SCROLL ============= */

.scroll-arrow {
  position: sticky;
  z-index: 100;
  cursor: pointer;
  margin: auto;
  display: block;
  transition: background 0.3s;
  width: 30px;
  height: 30px;
}

.scroll-up {
  top: 0;
  margin-top: 5px;
}

.scroll-down {
  bottom: 0;
  margin-bottom: 5px;
}

/* ============= EFECTOS DE PELÍCULA ============= */

.film-grain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: url("/images/old_photo_texture_bw_by_firesign24_7_d1ni173-414w-2x.jpg");
  background-size: cover;
  opacity: 0.15;
  z-index: 100;
  animation: flickerGrain 10s infinite steps(60);
}

.old-film-scratches {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("/images/old_photo_texture_bw_by_firesign24_7_d1ni173-414w-2x.jpg") repeat;
  background-size: cover;
  pointer-events: none;
  mix-blend-mode: lighten;
  z-index: 101;
  animation: scratchesFlicker 7s infinite steps(60);
  opacity: 0.12;
}

/* ============= ANIMACIONES ============= */

@keyframes flicker {
  0%,
  100% {
    filter: brightness(0.8) contrast(0.9);
  }
  50% {
    filter: brightness(0.9) contrast(1);
  }
  75% {
    filter: brightness(0.85) contrast(1.05);
  }
}

@keyframes slideInRight {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInFromTop {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  80% {
    transform: translateY(10px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes flickerGrain {
  0% {
    opacity: 0.1;
    transform: translate(0px, 0px);
  }
  25% {
    opacity: 0.2;
    transform: translate(1px, -1px);
  }
  50% {
    opacity: 0.05;
    transform: translate(-1px, 1px);
  }
  75% {
    opacity: 0.15;
    transform: translate(2px, -2px);
  }
  100% {
    opacity: 0.1;
    transform: translate(0px, 0px);
  }
}

@keyframes scratchesFlicker {
  0% {
    opacity: 0.1;
    transform: translate(0, 0) scale(1);
  }
  25% {
    opacity: 0.2;
    transform: translateY(-2px) scale(1.01);
  }
  50% {
    opacity: 0.05;
    transform: translateX(1px) scale(0.99);
  }
  75% {
    opacity: 0.15;
    transform: translate(-2px, 1px) scale(1.02);
  }
  100% {
    opacity: 0.1;
    transform: translate(0, 0) scale(1);
  }
}

/* ============= RESPONSIVE ============= */

@media (hover: none) and (pointer: coarse) {
  .mobile-toast {
    display: block;
  }
}

/* Tablets y pantallas medianas (hasta 1024px) */
@media screen and (max-width: 1024px) {
  .full-width-header {
    min-height: 150px;
    padding: 20px;
  }

  .full-width-header h1 {
    font-size: 1.8rem;
  }

  .wide-sidebar {
    width: 250px;
    min-width: 250px;
    padding: 15px;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }

  .reviews-list {
    width: 95%;
  }

  .review-item {
    width: 85%;
    padding: 12px;
  }

  .review-item a {
    font-size: 1.1rem;
  }

  .back-link {
    font-size: 0.9rem;
  }
}

/* Tablets pequeños (hasta 768px) */
@media screen and (max-width: 768px) {
  .reviews-layout {
    height: auto;
    min-height: 100vh;
  }

  .full-width-header {
    min-height: 120px;
    padding: 15px;
  }

  .full-width-header h1 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  .main-container {
    flex-direction: column;
  }

  .wide-sidebar {
    width: 100%;
    min-width: 100%;
    height: 250px;
    min-height: 250px;
    padding: 0;
    order: 1;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }

  .content-scrollable {
    order: 2;
    height: auto;
    min-height: 400px;
    overflow-y: visible;
    padding: 15px;
  }

  .reviews-list {
    width: 100%;
  }

  .review-item {
    width: 100%;
    margin: 10px 0;
    text-align: left;
    border-left: 4px solid rgba(107, 63, 47, 0.8);
    border-right: none;
  }

  .review-item.odd {
    margin-left: 0;
    margin-right: 0;
    text-align: left;
    border-right: none;
    border-left: 4px solid #f5d742;
  }

  .review-item:hover {
    transform: translateX(5px);
  }

  .review-item a {
    font-size: 1rem;
  }

  .review-year {
    font-size: 0.85rem;
  }

  .back-link {
    font-size: 0.85rem;
    margin-top: 8px;
  }

  .scroll-arrow {
    width: 25px;
    height: 25px;
  }

  .scroll-up {
    margin-top: 3px;
  }

  .scroll-down {
    margin-bottom: 3px;
  }

  .mobile-toast {
    display: block;
  }

  /* Reducir intensidad de animaciones */
  @keyframes flicker {
    0%, 100% {
      filter: brightness(0.85) contrast(0.95);
    }
    50% {
      filter: brightness(0.9) contrast(1);
    }
  }

  .film-grain,
  .old-film-scratches {
    opacity: 0.08;
  }

  /* Bordes más sutiles */
  .full-width-header,
  .wide-sidebar,
  .content-scrollable {
    background-image:
      linear-gradient(to right, rgba(107, 63, 47, 0.6) 4px, transparent 4px),
      linear-gradient(to bottom, rgba(107, 63, 47, 0.6) 4px, transparent 4px),
      linear-gradient(to left, rgba(107, 63, 47, 0.6) 4px, transparent 4px),
      linear-gradient(to top, rgba(107, 63, 47, 0.6) 4px, transparent 4px);
  }

  .review-item a {
    padding: 5px 0;
    display: inline-block;
    width: 100%;
  }

  .back-link {
    padding: 8px 12px;
    display: inline-block;
  }

  .content-scrollable {
    -webkit-overflow-scrolling: touch;
  }

  .reviews-list {
    padding-bottom: 20px;
  }
}

/* Móviles (hasta 480px) */
@media screen and (max-width: 480px) {
  .full-width-header {
    min-height: 100px;
    padding: 12px;
  }

  .full-width-header h1 {
    font-size: 1.1rem;
    line-height: 1.2;
  }

  .wide-sidebar {
    height: 200px;
    min-height: 200px;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }

  .content-scrollable {
    padding: 10px;
    min-height: 300px;
  }

  .review-item {
    padding: 10px;
    margin: 8px 0;
    border-width: 3px;
  }

  .review-item a {
    font-size: 0.9rem;
  }

  .review-year {
    font-size: 0.75rem;
    display: block;
    margin-top: 4px;
  }

  .back-link {
    font-size: 0.75rem;
  }

  .scroll-arrow {
    width: 20px;
    height: 20px;
  }
}

/* Landscape en móviles y tablets */
@media screen and (max-width: 896px) and (orientation: landscape) {
  .reviews-layout {
    height: auto;
  }

  .full-width-header {
    min-height: 80px;
    padding: 10px;
  }

  .full-width-header h1 {
    font-size: 1.2rem;
  }

  .main-container {
    flex-direction: row;
    min-height: calc(100vh - 80px);
  }

  .wide-sidebar {
    width: 200px;
    min-width: 200px;
    height: auto;
    order: 0;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }

  .content-scrollable {
    order: 1;
    overflow-y: scroll;
    height: calc(100vh - 80px);
  }

  .reviews-list {
    width: 90%;
  }

  .review-item {
    width: 90%;
  }
}

/* Muy pequeños (hasta 360px) */
@media screen and (max-width: 360px) {
  .full-width-header h1 {
    font-size: 1rem;
  }

  .wide-sidebar {
    height: 150px;
    min-height: 150px;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }

  .review-item a {
    font-size: 0.85rem;
  }

  .back-link {
    font-size: 0.7rem;
  }
}
