/* Bento Grid System - Asymmetrical Layout */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-lg);
  margin-bottom: var(--gap-lg);
}

/* Bento tile base styles */
.bento-tile {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
  overflow: hidden;
  position: relative;
}

.bento-tile:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* Hero tile - spans 2x2 */
.bento-tile.hero {
  grid-column: span 2;
  grid-row: span 2;
  padding: var(--gap-xl);
  justify-content: center;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  min-height: 320px;
  position: relative;
}

.bento-tile.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top-right, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}

.bento-tile.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--gap-md);
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.bento-tile.hero p {
  font-size: 1.1rem;
  margin-bottom: var(--gap-lg);
  position: relative;
  z-index: 1;
  opacity: 0.95;
}

/* Feature tile - spans 1x1 (default) */
.bento-tile.feature {
  grid-column: span 1;
  grid-row: span 1;
  min-height: 200px;
}

/* Wide tile - spans 2x1 */
.bento-tile.wide {
  grid-column: span 2;
  grid-row: span 1;
  min-height: 200px;
  flex-direction: row;
  align-items: center;
  gap: var(--gap-lg);
}

.bento-tile.wide img,
.bento-tile.wide .content {
  flex: 1;
}

.bento-tile.wide img {
  border-radius: var(--radius-md);
  object-fit: cover;
  max-height: 200px;
}

/* Tall tile - spans 1x2 */
.bento-tile.tall {
  grid-column: span 1;
  grid-row: span 2;
  min-height: auto;
}

/* Large tile - spans 2x2 */
.bento-tile.large {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 350px;
}

/* Card content styling */
.bento-tile h2,
.bento-tile h3 {
  color: var(--color-primary);
  margin-bottom: var(--gap-sm);
  font-weight: 600;
}

.bento-tile p {
  color: var(--color-text-secondary);
  margin-bottom: var(--gap-sm);
  line-height: 1.6;
}

.bento-tile .icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--gap-md);
  flex-shrink: 0;
}

.bento-tile .icon svg {
  width: 24px;
  height: 24px;
  color: white;
  stroke: white;
  fill: none;
}

/* Button styling in tiles */
.bento-tile .btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border: none;
  color: white;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
  margin-top: var(--gap-md);
  display: inline-block;
}

.bento-tile .btn-primary:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

/* Badge styling */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--color-accent);
  color: white;
  margin-right: var(--gap-xs);
  margin-bottom: var(--gap-xs);
}

.badge.secondary {
  background-color: var(--color-primary);
}

/* Image in tiles */
.bento-tile img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  object-fit: cover;
  margin-bottom: var(--gap-md);
}

/* Testimonial tile */
.bento-tile.testimonial {
  background-color: var(--color-bg-secondary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.bento-tile.testimonial .quote {
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: var(--gap-md);
  color: var(--color-text);
  line-height: 1.7;
}

.bento-tile.testimonial .author {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.95rem;
}

.bento-tile.testimonial .role {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 992px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-md);
  }

  .bento-tile.hero {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 250px;
  }

  .bento-tile.hero h1 {
    font-size: 2rem;
  }

  .bento-tile.wide {
    grid-column: span 2;
    flex-direction: column;
  }

  .bento-tile.large {
    grid-column: span 2;
    grid-row: span 1;
    min-height: auto;
  }

  .bento-tile {
    padding: var(--gap-md);
  }
}

@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
    gap: var(--gap-md);
  }

  .bento-tile {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    min-height: auto;
    padding: var(--gap-md);
  }

  .bento-tile.hero {
    min-height: 200px;
  }

  .bento-tile.hero h1 {
    font-size: 1.75rem;
  }

  .bento-tile.hero p {
    font-size: 1rem;
  }

  .bento-tile.wide {
    flex-direction: column;
    gap: var(--gap-md);
  }

  .bento-tile.tall {
    min-height: auto;
  }

  .bento-tile .btn-primary {
    width: 100%;
    text-align: center;
  }
}

/* Animation for tiles on load */
@keyframes tileSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bento-tile {
  animation: tileSlideIn 0.6s ease-out forwards;
}

.bento-tile:nth-child(1) { animation-delay: 0.05s; }
.bento-tile:nth-child(2) { animation-delay: 0.1s; }
.bento-tile:nth-child(3) { animation-delay: 0.15s; }
.bento-tile:nth-child(4) { animation-delay: 0.2s; }
.bento-tile:nth-child(5) { animation-delay: 0.25s; }
.bento-tile:nth-child(6) { animation-delay: 0.3s; }
.bento-tile:nth-child(7) { animation-delay: 0.35s; }
.bento-tile:nth-child(8) { animation-delay: 0.4s; }
.bento-tile:nth-child(9) { animation-delay: 0.45s; }
.bento-tile:nth-child(10) { animation-delay: 0.5s; }
