.theme-grid.container {
  max-width: 1400px;
  min-height: 500px;
}

@media (min-width: 1200px) {
  .theme-grid.container {
    padding-left: 24px;
    padding-right: 24px;
  }
}

.theme-grid .card.theme-card {
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.theme-grid .card.theme-card.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-shadow), var(--shadow-medium);
  transform: translateY(-4px) scale(1.02);
}

.theme-grid .card-body {
  flex-grow: 1;
  padding: 1rem;
  display: block;
}

.theme-grid .card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.theme-grid .card-text {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
  display: block;
}

.theme-grid .card-header {
  font-weight: 600;
  text-align: center;
  background-color: var(--surface-alt);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  display: block;
}

#theme-selection-status {
  min-height: 1.5rem;
  font-size: 0.9rem;
  transition: opacity var(--transition-normal);
}

@media (min-width: 577px) {
  .theme-scroll {
    display: grid !important;
    gap: 1.25rem;
    align-items: stretch;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  }

  .theme-scroll > .col,
  .theme-scroll > [class*="col-"] {
    width: auto !important;
    max-width: none !important;
    flex: initial !important;
  }

  .theme-slider-item {
    display: block !important;
    width: 100%;
    max-width: none;
  }

  .theme-slider-item .theme-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100%;
  }

  .theme-grid .card-header,
  .theme-grid .card-body,
  .theme-grid .card-text {
    display: block !important;
    writing-mode: horizontal-tb !important;
  }

  .theme-dots {
    display: none;
  }
}

@media (min-width: 1200px) {
  .theme-scroll {
    gap: 1.75rem;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  }

  .theme-grid .card-text {
    font-size: 0.95rem;
  }
}

@media (hover: hover) {
  .theme-grid .card.theme-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
  }
}

@media (max-width: 576px) {
  .theme-grid .card-img-top {
    padding: 0.75rem;
  }

  .theme-grid .card-body {
    padding: 0.85rem;
  }

  .theme-grid .card-text {
    font-size: 0.85rem;
  }

  .theme-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 0.75rem;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.75rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .theme-scroll::-webkit-scrollbar {
    display: none;
  }

  .theme-slider-item {
    flex: 0 0 85% !important;
    max-width: 85% !important;
    scroll-snap-align: center;
    display: block !important;
  }

  .theme-slider-item .theme-card {
    border-width: 1px;
    box-shadow: none;
  }

  .theme-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
  }

  .theme-dots span {
    width: 7px;
    height: 7px;
    background: #ccc;
    border-radius: 50%;
    transition: background var(--transition-fast);
  }

  .theme-dots span.active {
    background: var(--primary-color);
    width: 20px;
    border-radius: 4px;
  }
}

.bottom-bar {
  justify-content: center;
  align-items: center;
}
