/* web/css/gallery.css — Mukbang Feature #14: Illustration Gallery & Enlarged Food Modal */

/* Main Navigation Tabs (Header Underbar) */
.app-main-tabs {
  background: #11141D;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tabs-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.main-tab-btn {
  flex: 1;
  max-width: 220px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #8E9BAE;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-tab-btn .tab-emoji {
  font-size: 1.15rem;
}

.main-tab-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.main-tab-btn.active {
  color: #FFA94D;
  background: rgba(255, 169, 77, 0.12);
  border-color: rgba(255, 169, 77, 0.35);
  box-shadow: 0 0 16px rgba(255, 169, 77, 0.15);
}

/* Gallery Section Layout */
.gallery-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0 40px;
  width: 100%;
}

/* Controls Header (Search + Random + Counter) */
.gallery-controls-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.gallery-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.gallery-search-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.gallery-search-icon {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  color: #8E9BAE;
  pointer-events: none;
}

.gallery-search-input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px 12px 42px;
  background: #161A24;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  color: #FFFFFF;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.gallery-search-input:focus {
  border-color: #FFA94D;
  background: #1C2230;
  box-shadow: 0 0 0 3px rgba(255, 169, 77, 0.2);
}

.gallery-search-input::placeholder {
  color: #6C7A8E;
  font-weight: 500;
}

.gallery-random-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  background: linear-gradient(135deg, #FF6B6B 0%, #FFA94D 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.gallery-random-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.gallery-random-btn:active {
  transform: translateY(0);
}

/* Category Filter Chips Bar */
.gallery-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.gallery-chips-bar::-webkit-scrollbar {
  display: none;
}

.gallery-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #161A24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: #B0B8C4;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.gallery-chip:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  background: #1E2433;
}

.gallery-chip.active {
  background: rgba(255, 169, 77, 0.18);
  border-color: #FFA94D;
  color: #FFA94D;
  box-shadow: 0 0 12px rgba(255, 169, 77, 0.25);
}

.gallery-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  font-size: 0.82rem;
  color: #8E9BAE;
}

.gallery-count-badge {
  color: #FFA94D;
  font-weight: 800;
}

/* Food Cards Grid (2 cols mobile, 4-5 cols desktop) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

@media (min-width: 680px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 960px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
  }
}

/* Individual Food Card */
.gallery-food-card {
  background: #161A24;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  position: relative;
}

.gallery-food-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 169, 77, 0.4);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(255, 169, 77, 0.15);
}

.gallery-card-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  background: #0F1219;
  overflow: hidden;
}

.gallery-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-food-card:hover .gallery-card-thumb {
  transform: scale(1.05);
}

.gallery-code-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 18, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #B0B8C4;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.gallery-card-info {
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.gallery-card-origin {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #F8F9FA;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6em;
}

.gallery-card-meta {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gallery-meta-cal {
  font-size: 0.72rem;
  font-weight: 700;
  color: #FFA94D;
  background: rgba(255, 169, 77, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Empty State */
.gallery-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #161A24;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-emoji {
  font-size: 3rem;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
}

.empty-sub {
  font-size: 0.88rem;
  color: #8E9BAE;
  margin: 0;
}

/* =========================================================================
 * Enlarged Food Detail Modal (/food/{code})
 * ========================================================================= */
.food-detail-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  background: rgba(10, 12, 18, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.food-detail-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.food-detail-dialog {
  background: #161A24;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 169, 77, 0.2);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.food-detail-backdrop.open .food-detail-dialog {
  transform: translateY(0) scale(1);
}

.detail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(22, 26, 36, 0.95);
}

.detail-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-back-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #B0B8C4;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.detail-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.detail-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Large Illustration Preview */
.detail-art-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 380px;
  background: #0D1017;
  border: 1px solid rgba(255, 169, 77, 0.25);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.detail-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Badges Row */
.detail-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.detail-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #F8F9FA;
}

/* Food Headings */
.detail-text-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #FFFFFF;
  margin: 0;
  letter-spacing: -0.02em;
  font-family: "Noto Serif KR", Georgia, serif, Pretendard, sans-serif;
}

.detail-subtitle {
  font-size: 0.92rem;
  font-weight: 600;
  color: #B0B8C4;
  margin: 0;
}

/* Tagline Quote */
.detail-tagline-box {
  background: rgba(255, 234, 167, 0.06);
  border: 1px solid rgba(255, 234, 167, 0.2);
  border-left: 4px solid #FFA94D;
  border-radius: 12px;
  padding: 12px 14px;
  color: #FFEAA7;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}

/* Specs Pills (Calories + Price) */
.detail-specs-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.detail-spec-pill {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #DFC7B4;
}

.detail-spec-pill.cal {
  color: #FFA94D;
  border: 1px solid rgba(255, 169, 77, 0.3);
}

.detail-spec-pill.price {
  color: #54A0FF;
  border: 1px solid rgba(84, 160, 255, 0.3);
}

.detail-pairing-tip {
  font-size: 0.85rem;
  color: #8E9BAE;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0;
}

/* 4 Action Buttons in Enlarged View */
.detail-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.detail-actions-list .btn {
  width: 100%;
}

.detail-secondary-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-detail-secondary {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-detail-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
