/**
 * Modern Gallery Guide Styles - Compact Version
 * Design inspirovaný Digitalizujeme vás
 */

:root {
  --primary: #1e4a7a;
  --primary-dark: #153557;
  --accent: #d4a043;
  --accent-hover: #c59339;
  --text: #2d3748;
  --text-light: #718096;
  --text-muted: #a0aec0;
  --bg: #f7fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  top: 0 !important;
  position: relative !important;
}

/* ============================================
   HEADER - KOMPAKTNÍ
   ============================================ */

header {
  /*position: sticky;*/
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1.25rem 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.logo-container img {
  max-height: 45px;
  width: auto;
  filter: brightness(0) invert(1);
}

.gallery-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: 400;
}

.language-switcher {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.flag-btn {
  width: 40px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.flag-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.flag-btn.active {
  border-color: white;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================
   TOUR INTRO - KOMPAKTNÍ
   ============================================ */

.tour-intro {
  background: linear-gradient(135deg, #1e4a7a 0%, #2563a8 100%);
  color: white;
  padding: 2rem 1.5rem;
  margin: 1rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.tour-intro h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.tour-intro p {
  font-size: 1rem;
  opacity: 0.95;
  margin-bottom: 1.25rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-qr,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: var(--accent);
  color: white;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(212, 160, 67, 0.3);
}

.btn-qr:hover,
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 160, 67, 0.4);
}

/* ============================================
   EXHIBITS LIST
   ============================================ */

.exhibits-list {
  padding: 0.75rem 0.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================
   EXHIBIT CARD - KOMPAKTNÍ DESIGN
   ============================================ */

.exhibit-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 0.875rem auto;
  max-width: 700px;
  transition: all 0.25s ease;
  border: 1px solid var(--border);
}

.exhibit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Header karty - modrý s číslem a názvem */
.card-header {
  background: linear-gradient(135deg, #2563a8 0%, #1e4a7a 100%);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Číslo exponátu - zlatý/oranžový kruh */
.card-number {
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Název exponátu - bílý text v headeru */
.card-title {
  color: white;
  font-size: 1.15rem;
  font-weight: 600;
  flex: 1;
  line-height: 1.3;
  margin: 0;
}

/* Obrázek karty - samostatně pod headerem */
.card-image-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.exhibit-card:hover .card-image {
  transform: scale(1.03);
}

/* Zlaté tlačítko Play - na obrázku */
.card-audio-btn {
  position: absolute;
  bottom: 0.875rem;
  right: 0.875rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(212, 160, 67, 0.5);
  transition: all 0.2s ease;
  z-index: 2;
}

.card-audio-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(212, 160, 67, 0.6);
}

.card-audio-btn i {
  margin-left: 2px;
}

/* Tělo karty */
.card-body {
  padding: 1.25rem;
}

/* Meta informace - horizontální layout */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
  padding: 0.375rem 0;
}

.meta-item i {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Badge pro techniku */
.card-body > span,
.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: #f7fafc;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
}

/* Audio dostupné - oranžová */
.meta-item.audio-available {
  color: var(--accent);
  font-weight: 600;
}

.meta-item.audio-available i {
  color: var(--accent);
}

/* ============================================
   AUDIO SECTION
   ============================================ */

.card-audio {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
  border-radius: var(--radius);
  border: 1px solid #d4e5f7;
}

.audio-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-audio audio,
.audio-player-container audio {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  outline: none;
}

.audio-not-available {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.875rem;
}

/* ============================================
   TTS CONTROLS
   ============================================ */

.card-tts {
  text-align: center;
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: center;
}

.btn-tts {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 6px rgba(212, 160, 67, 0.3);
}

.btn-tts:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-tts:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  opacity: 0.5;
}

.btn-tts-stop {
  background: #64748b !important;
}

.btn-tts-stop:hover {
  background: #475569 !important;
}

/* ============================================
   DETAIL VIEW
   ============================================ */

.section-title {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  color: var(--primary);
  padding: 1.5rem 1rem;
  border-radius: var(--radius-lg);
  margin: 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.section-title h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-title p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.exhibit-image-container {
  width: 100%;
  max-width: 800px;
  margin: 1.25rem auto;
  padding: 0 1rem;
}

.exhibit-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: block;
  margin: 0 auto;
  max-height: 550px;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--border);
}

.exhibit-meta {
  margin: 1rem;
  padding: 0;
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.exhibit-meta .meta-item,
.exhibit-meta .badge {
  margin: 0;
}

.tts-controls {
  display: flex;
  justify-content: center;
  gap: 0.875rem;
  margin: 1.5rem 1rem;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: #64748b;
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.audio-section {
  margin: 1.25rem 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid #d4e5f7;
}

.audio-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audio-player-container {
  background: white;
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.audio-lang-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navigation {
  text-align: center;
  margin: 2rem 1rem 1.5rem;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  background: var(--bg);
}

/* ============================================
   QR MODAL
   ============================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal > div {
  background: white;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal h3 {
  margin-bottom: 1rem;
  color: var(--primary);
  font-size: 1.375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal p {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

#qr-reader {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

/* ============================================
   LOADING
   ============================================ */

.audio-loading {
  text-align: center;
  color: var(--text-light);
  padding: 0.875rem;
  font-size: 0.9rem;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fa-spinner {
  animation: spin 1s linear infinite;
}

/* ============================================
   HIDE GOOGLE TRANSLATE
   ============================================ */

.goog-te-banner-frame,
iframe.goog-te-banner-frame,
.goog-te-gadget,
#google_translate_element,
.goog-te-ftab,
.skiptranslate {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

body.translated-ltr,
body.translated-rtl {
  top: 0 !important;
  margin-top: 0 !important;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 640px) {
  .tour-intro {
    padding: 1.5rem 1.25rem;
    margin: 0.75rem;
  }

  .tour-intro h2 {
    font-size: 1.375rem;
  }

  .exhibit-card {
    margin: 0.75rem 0.5rem;
  }

  .card-body {
    padding: 1rem;
  }

  .card-title {
    font-size: 1.125rem;
  }

  .card-header {
    padding: 0.875rem 1rem;
  }

  .card-number {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  .card-title {
    font-size: 1.05rem;
  }

  .card-audio-btn {
    width: 46px;
    height: 46px;
    bottom: 0.75rem;
    right: 0.75rem;
  }

  .meta-item {
    font-size: 0.8rem;
  }

  .flag-btn {
    width: 36px;
    height: 26px;
    font-size: 1.15rem;
  }
}

@media (min-width: 641px) {
  .exhibits-list {
    padding: 1rem 1rem 2.5rem;
  }

  .tour-intro {
    max-width: 700px;
    margin: 1.5rem auto;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   PRINT
   ============================================ */

@media print {
  header,
  .language-switcher,
  .navigation,
  .btn,
  .btn-qr,
  .btn-tts,
  .card-audio,
  .audio-section,
  footer,
  .card-audio-btn {
    display: none !important;
  }

  .exhibit-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }
}
