/* ==========================================
   BENTO GRID HOMEPAGE STYLES
   Modern touch-optimized design for kiosk interface
========================================== */

/* Full Page Setup */
html {
  height: 100%;
}

/* Full Page Background.
   The background itself is set in lagoa-theme.css: this was a fixed cover photo
   of Moncorvo behind a dark gradient, and Lagoa's design is a light flat body. */
body[data-barba="wrapper"] {
  min-height: 100vh;
  width: 100%;
  position: relative;
  overflow-x: hidden;
}

/* Background Overlay for Better Contrast */
body[data-barba="wrapper"]::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(23, 36, 61, 0.85) 0%,
    rgba(15, 25, 45, 0.90) 50%,
    rgba(10, 20, 40, 0.88) 100%
  );
  z-index: 0;
  pointer-events: none;
}

/* Mobile background adjustments */
@media (max-width: 768px) {
  body[data-barba="wrapper"] {
    background-attachment: scroll; /* Better performance on mobile */
  }
}

/* Ensure header and footer appear above overlay */
.top-header {
  position: relative;
  z-index: 10;
}

footer {
  position: relative;
  z-index: 10;
}

/* Touch Optimization - Prevent selection/dragging */
.bento-container * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Main Bento Grid Container */
.bento-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 20px;
  padding: 30px;
  height: calc(100vh - 250px - 120px); /* Account for header and bottom buttons */
  max-width: 1400px;
  margin: 0 auto; /* Reset to no top margin */
  position: relative;
  z-index: 5;
}

/* Individual Bento Grid Items */
.bento-item {
  position: relative;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  border-radius: 25px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  min-height: 220px;
  backdrop-filter: blur(10px);
}

/* Bento Grid Layout - Varied, Dynamic sizes */
.bento-noticias {
  grid-column: span 3;
  grid-row: span 1;
}

.bento-agenda {
  grid-column: span 3;
  grid-row: span 1;
}

.bento-municipio {
  grid-column: span 3;
  grid-row: span 2;
}

.bento-ficar {
  grid-column: span 2;
  grid-row: span 1;
}

.bento-comer {
  grid-column: span 2;
  grid-row: span 1;
}

.bento-visitar {
  grid-column: span 2;
  grid-row: span 1;
}

.bento-roteiros {
  grid-column: span 3;
  grid-row: span 1;
}

/* Background Image Styling */
.bento-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.bento-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.bento-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s ease;
}

/* Subtle Category-Specific Gradients */
.bento-noticias .bento-overlay {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.15) 0%,
    rgba(22, 163, 74, 0.35) 50%,
    rgba(21, 128, 61, 0.5) 100%
  );
}

.bento-municipio .bento-overlay {
  background: linear-gradient(
    135deg,
    rgba(196, 77, 97, 0.15) 0%,
    rgba(196, 77, 97, 0.35) 50%,
    rgba(156, 61, 77, 0.5) 100%
  );
}

.bento-agenda .bento-overlay {
  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.15) 0%,
    rgba(245, 158, 11, 0.35) 50%,
    rgba(217, 119, 6, 0.5) 100%
  );
}

.bento-ficar .bento-overlay {
  background: linear-gradient(
    135deg,
    rgba(168, 85, 247, 0.15) 0%,
    rgba(147, 51, 234, 0.35) 50%,
    rgba(124, 58, 237, 0.5) 100%
  );
}

.bento-comer .bento-overlay {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.15) 0%,
    rgba(220, 38, 38, 0.35) 50%,
    rgba(185, 28, 28, 0.5) 100%
  );
}

.bento-visitar .bento-overlay {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.15) 0%,
    rgba(8, 145, 178, 0.35) 50%,
    rgba(14, 116, 144, 0.5) 100%
  );
}

.bento-roteiros .bento-overlay {
  background: linear-gradient(
    135deg,
    rgba(249, 115, 22, 0.15) 0%,
    rgba(234, 88, 12, 0.35) 50%,
    rgba(194, 65, 12, 0.5) 100%
  );
}

.bento-overlay-disabled {
  background: linear-gradient(
    135deg,
    rgba(23, 36, 61, 0.7) 0%,
    rgba(23, 36, 61, 0.8) 100%
  );
}

/* Content Styling */
.bento-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px;
  width: 100%;
  color: white;
}

.bento-icon {
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
  transition: all 0.3s ease;
}

.bento-icon img {
  width: 48px;
  height: 48px;
}

.bento-title {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.bento-subtitle {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  margin: 8px 0 0 0;
  opacity: 0.85;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Hover Effects */
.bento-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.bento-item:hover .bento-bg-image {
  transform: scale(1.05);
}

.bento-item:hover .bento-overlay {
  opacity: 0.8;
}

.bento-item:hover .bento-icon {
  opacity: 1;
  transform: scale(1.1);
}

.bento-item:hover .bento-title {
  transform: translateY(-2px);
}

/* Active/Press State */
.bento-item:active {
  transform: translateY(-2px);
  transition: transform 0.1s ease;
}

/* Disabled State */
.bento-disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.bento-disabled:hover {
  transform: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.bento-disabled:hover .bento-bg-image {
  transform: none;
}



/* Sidebar Animation States */
.bento-container.sidebar-mode {
  position: fixed;
  left: 0;
  top: 240px;
  width: 150px;
  height: calc(100vh - 240px - 100px);
  grid-template-columns: 1fr;
  grid-template-rows: repeat(8, auto);
  gap: 15px;
  padding: 20px;
  z-index: 100;
}

.bento-item.sidebar-state {
  width: 100px !important;
  height: 100px !important;
  min-width: 100px !important;
  max-width: 100px !important;
  min-height: 100px !important;
  max-height: 100px !important;
  border-radius: 16px !important;
  grid-column: span 1;
  grid-row: span 1;
  cursor: pointer;
  /* Removed transition to let GSAP handle all animations smoothly */
}

/* Active State Indicator - Modern white bar with grow/shrink animation */
.bento-item.sidebar-state.active {
  position: relative;
}

.bento-item.sidebar-state.active::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px; /* Start as dot */
  background: white;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  z-index: 1;
  
  /* Grow animation when appearing */
  animation: indicatorGrow 0.6s ease-out forwards, activePulse 2s ease-in-out 0.6s infinite;
}

.bento-item.sidebar-state.active.shrinking::after {
  /* Shrink animation when disappearing */
  animation: indicatorShrink 0.4s ease-in forwards;
}

/* Grow animation: dot → bar */
@keyframes indicatorGrow {
  0% { 
    height: 4px;
    opacity: 0.6;
    transform: translateY(-50%) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
  }
  100% { 
    height: 50px;
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* Shrink animation: bar → dot → fade */
@keyframes indicatorShrink {
  0% { 
    height: 50px;
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  60% {
    height: 4px;
    opacity: 0.8;
    transform: translateY(-50%) scale(0.9);
  }
  100% { 
    height: 4px;
    opacity: 0;
    transform: translateY(-50%) scale(0.6);
  }
}

/* Pulse animation for active indicator (delayed to start after grow) */
@keyframes activePulse {
  0%, 100% { 
    opacity: 1; 
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  }
  50% { 
    opacity: 0.7; 
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
  }
}

/* Enhanced active state background */
.bento-item.sidebar-state.active {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.bento-item.sidebar-state .bento-background {
  display: none !important;
  opacity: 0 !important;
}

.bento-item.sidebar-state .bento-content {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
}

.bento-item.sidebar-state .bento-icon {
  margin: 0 !important;
  transform: scale(1.4) !important;
}

.bento-item.sidebar-state .bento-icon img {
  width: 40px !important;
  height: 40px !important;
}

.bento-item.sidebar-state .bento-title,
.bento-item.sidebar-state .bento-subtitle {
  display: none !important;
  opacity: 0 !important;
}

/* Sidebar Category Background Colors - handled by JavaScript animation */

/* Content Panel */
.content-panel {
  position: fixed;
  top: 240px;
  right: -100%;
  width: calc(100% - 220px);
  height: calc(96vh - 240px - 100px);
  background: white;
  border-radius: 24px 0 0 24px;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 90;
  overflow-y: auto;
  transition: right 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-panel.visible {
  right: 0;
}

.content-panel-inner {
  padding: 40px 0px 40px 40px; /* Remove right padding for scrollbar */
  height: 100%;
}



/* Animation Helper Classes */
.bento-container.animating {
  pointer-events: none;
}

.bento-container.animating .bento-item {
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .bento-container {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 15px;
    padding: 20px;
    margin: 0 auto;
    height: calc(100vh - 200px - 100px);
  }
  
  .bento-noticias,
.bento-municipio,
.bento-roteiros {
    grid-column: span 3;
    grid-row: span 1;
  }
  
  .bento-agenda {
    grid-column: span 3;
    grid-row: span 1;
  }
  
  .bento-ficar,
  .bento-comer,
  .bento-visitar {
    grid-column: span 3;
    grid-row: span 1;
  }
  
  .bento-title {
    font-size: 1.4rem;
  }
  
  .bento-icon img {
    width: 40px;
    height: 40px;
  }
  

}

/* Portrait tablet optimization */
@media (max-width: 1024px) and (orientation: portrait) {
  .bento-container {
    height: calc(100vh - 220px - 100px);
    margin: 0 auto;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
  }
  
  .bento-noticias {
    grid-column: span 2;
    grid-row: span 2;
  }
  
  .bento-municipio {
    grid-column: span 2;
    grid-row: span 1;
  }
  
  .bento-agenda {
    grid-column: span 2;
    grid-row: span 1;
  }
  
  .bento-ficar,
  .bento-comer,
  .bento-visitar {
    grid-column: span 2;
    grid-row: span 1;
  }
  
  .bento-roteiros {
    grid-column: span 4;
    grid-row: span 1;
  }
  
  .bento-item {
    min-height: 160px;
  }
  
  .bento-content {
    padding: 20px;
  }
  
  .bento-icon img {
    width: 40px;
    height: 40px;
  }
  
  .bento-title {
    font-size: 1.5rem;
  }
}

/* Large screens optimization */
@media (min-width: 1400px) {
  .bento-container {
    max-width: 1600px;
    gap: 25px;
    padding: 40px;
  }
  
  .bento-item {
    min-height: 260px;
  }
  
  .bento-title {
    font-size: 2.2rem;
  }
  
  .bento-subtitle {
    font-size: 1.3rem;
  }
  
  .bento-icon img {
    width: 56px;
    height: 56px;
  }
  
  .bento-content {
    padding: 40px;
  }
} 