/* showroom.css - Program cards styles */

/* Program Card (based on old system) */

.program-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 270px;
}

.program-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.13);
}

.card-header {
  padding: 12px 14px;
  color: white;
  font-size: 17px;
  font-weight: bold;
  font-family: "Montserrat", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Colorful gradient headers */

.card-header.gradient-1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-header.gradient-2 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.card-header.gradient-3 {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.card-header.gradient-4 {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.card-header.gradient-5 {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.card-header.gradient-6 {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.card-header.gradient-7 {
  background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%);
}

.card-header.gradient-8 {
  background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
}

.card-header.gradient-9 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.card-header.gradient-10 {
  background: linear-gradient(135deg, #4481eb 0%, #04befe 100%);
}

.card-key-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 10px 16px;
  background: #f8f9fa;
  font-size: 13px;
  color: #555;
  border-bottom: 1px solid #e9ecef;
}

.key-info-item {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.key-info-label {
  font-weight: 600;
  color: #333;
}

.card-body {
  padding: 14px;
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-description-area {
  flex: 1;
  overflow: hidden;
  min-height: 0;
  max-height: 147px;
}

.card-info-line {
  font-size: 12px;
  color: #1a5276;
  margin-bottom: 8px;
  line-height: 1.3;
  font-weight: 700;
}

.card-text {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
  font-family: "Open Sans", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.card-image {
  width: 100px;
  height: 80px;
  border-radius: 8px;
  object-fit: contain;
  background: #eaeaea;
  float: right;
  margin-left: 12px;
  margin-bottom: 4px;
}

.card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 8px;
}

.card-tag {
  background: #f0cb6c;
  color: #0a2952;
  padding: 4px 9px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Pagination */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.page-btn {
  padding: 10px 16px;
  border: 2px solid #d1a018;
  background: white;
  color: #d1a018;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
  background: #d1a018;
  color: white;
}

.page-btn.active {
  background: #d1a018;
  color: white;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  color: #666;
  font-weight: 500;
}

/* Loading Indicator */

.loading-indicator {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #666;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.loading-indicator p {
  margin-top: 16px;
  font-size: 16px;
}

/* Empty State */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  grid-column: 1 / -1;
}

.empty-state h3 {
  font-size: 24px;
  margin-bottom: 12px;
  color: #333;
}

/* Sidebar content container - fills remaining space below user header */
#sidebarContent {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Sidebar page-specific content styling */
.sidebar-page-content {
  display: none;
  flex: 1;
  overflow: hidden;
}

.sidebar-page-content.active {
  display: flex;
  flex-direction: column;
}

.sidebar-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8f9fa;
}

.sidebar-section-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.sidebar-section-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-section-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.filter-section {
  margin-bottom: 24px;
}

.filter-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.filter-section-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.clear-btn {
  background: none;
  border: none;
  color: #d1a018;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.clear-btn:hover {
  color: #b88f15;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  padding: 6px 0;
}

.filter-checkbox input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.filter-checkbox span {
  font-size: 14px;
  color: #444;
}

.tags-list {
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f5f5f5;
}

.tags-list::-webkit-scrollbar {
  width: 6px;
}

.tags-list::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

.tags-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.tags-list::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Tag Group Styles */
.tag-group {
  margin-bottom: 8px;
}

.tag-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  background: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.tag-group-header:hover {
  background: #e9ecef;
}

.tag-group-arrow {
  font-size: 10px;
  color: #666;
  transition: transform 0.2s;
  display: inline-block;
  width: 12px;
}

.tag-group-arrow.expanded {
  transform: rotate(90deg);
}

.tag-group-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  flex: 1;
}

.tag-group-count {
  font-size: 11px;
  color: #999;
  font-weight: 500;
}

.tag-group-content {
  padding: 6px 0 6px 18px;
}

.tag-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  padding: 4px 0;
}

.tag-checkbox input[type="checkbox"] {
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.tag-checkbox span {
  font-size: 13px;
  color: #555;
}

.tag-checkbox:hover span {
  color: #333;
  font-weight: 500;
}

.no-tags,
.error-text,
.loading-text {
  font-size: 13px;
  color: #999;
  padding: 8px 0;
}

/* Showroom/Consultation layout - overflow controlled by mode */
#programsContainer,
#resultsContainer {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #d1a018 #f5f5f5;
}

#programsContainer::-webkit-scrollbar,
#resultsContainer::-webkit-scrollbar {
  width: 8px;
}

#programsContainer::-webkit-scrollbar-track,
#resultsContainer::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

#programsContainer::-webkit-scrollbar-thumb,
#resultsContainer::-webkit-scrollbar-thumb {
  background: #d1a018;
  border-radius: 4px;
}

#programsContainer::-webkit-scrollbar-thumb:hover,
#resultsContainer::-webkit-scrollbar-thumb:hover {
  background: #b8901e;
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  align-content: start;
  padding-bottom: 20px;
}

/* Card Header Layout */
.card-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.program-id {
  font-size: 13px;
  opacity: 0.85;
  min-width: 30px;
}

.bookmark-btn {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  width: 24px;
  height: 24px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  color: rgba(255, 255, 255, 0.7);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.bookmark-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #ff0000;
  transform: scale(1.1);
}

.bookmark-btn.bookmarked {
  background: rgba(255, 255, 255, 0.95);
  color: #ff0000;
  text-shadow: 0 0 2px rgba(255, 0, 0, 0.5);
}

.program-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .programs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .program-card {
    height: auto;
    min-height: 240px;
  }
  .filter-bar {
    flex-direction: column;
  }
  .search-input {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .showroom-container {
    padding: 20px 12px;
  }
  .page-title {
    font-size: 26px;
  }
  .card-header {
    font-size: 18px;
  }
  .pagination {
    flex-wrap: wrap;
  }
}
