/* --- BEER CAPS GALLERY STYLES --- */

/* Import moderního fontu (volitelné, ale doporučené pro hezčí vzhled) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

.beer-app-body {
  --primary-color: #2d5f6e;
  --accent-color: #d4a574;
  --bg-light: #f5f5f5;
  --bg-white: #ffffff;
  --text-dark: #333333;
  --text-light: #666666;
  --border-color: #e0e0e0;
  
  /* Změněno na moderní Google Font, záložní systémové fonty zůstávají */
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #eef4f6 100%);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.beer-container {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px;
  box-shadow: 5px 0 15px rgba(45, 95, 110, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 10;
}

.sidebar h2 {
  font-size: 13px;
  margin-bottom: 10px;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 1px;
  font-weight: 600;
}

.search-box {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(45, 95, 110, 0.1);
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.7);
  transition: all 0.3s;
}

.search-box:focus {
  outline: none;
  border-color: var(--accent-color);
  background: #fff;
  box-shadow: 0 4px 15px rgba(212, 165, 116, 0.15);
}

.countries-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.countries-list li {
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 6px;
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.1s ease;
  border-left: 3px solid transparent;
}

.countries-list li:hover { 
  background: linear-gradient(135deg, #f5f7fa 0%, #eef4f6 100%); 
  border-left-color: var(--accent-color); 
}

.countries-list li.active { 
  background-color: #eef4f6; 
  color: var(--primary-color); 
  font-weight: 600; 
  border-left-color: var(--primary-color); 
}

.country-info { display: flex; align-items: center; flex: 1; min-width: 0; }
.country-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 500; }

.country-count {
  background-color: #e0e0e0;
  color: #555;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 8px;
}

.countries-list li.active .country-count { background-color: var(--primary-color); color: white; }

.main-content {
  flex: 1;
  background-color: transparent;
  padding: 24px;
  overflow-y: auto;
  position: relative;
}

.dashboard-wrapper { max-width: 1000px; margin: 0 auto; }

.dashboard-hero {
  text-align: center;
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-hero h1 { font-size: 3.5em; font-weight: 800; color: var(--primary-color); margin-bottom: 10px; letter-spacing: -1px; }
.dashboard-hero p { font-size: 1.2em; color: var(--text-light); font-weight: 300; }

.dashboard-stats { display: flex; justify-content: center; gap: 30px; margin-bottom: 60px; flex-wrap: wrap; }
.stat-card { 
  background: white; 
  padding: 30px 40px; 
  border-radius: 12px; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
  border: 1px solid rgba(45, 95, 110, 0.08);
  min-width: 200px; 
  text-align: center; 
  transition: transform 0.3s; 
}
.stat-card:hover { transform: translateY(-5px); }
.stat-number { font-size: 3.5em; font-weight: 800; color: var(--accent-color); line-height: 1; margin-bottom: 10px; }
.stat-label { font-size: 0.9em; text-transform: uppercase; letter-spacing: 2px; color: var(--text-light); font-weight: 600; }

.gallery-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.gallery-header h2 { font-size: 28px; color: var(--primary-color); margin: 0; display: flex; align-items: center; }

.back-btn { padding: 8px 20px; background-color: white; color: var(--primary-color); border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; font-weight: 600; transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.back-btn:hover { background: linear-gradient(135deg, #f5f7fa 0%, #eef4f6 100%); transform: translateY(-1px); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}

.cap-item {
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background-color: transparent;
  padding: 8px;
  border: 1px solid rgba(45, 95, 110, 0.08);
  border-radius: 12px;
  content-visibility: auto;
  contain-intrinsic-size: 140px 160px;
}

.cap-item:hover { transform: translateY(-4px) scale(1.02); border-color: var(--accent-color); }

.cap-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

.cap-name {
  margin-top: 8px;
  font-weight: 600;
  color: var(--primary-color);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-state { background: #fff; border: 1px solid var(--border-color); border-radius: 10px; padding: 30px; text-align: center; color: var(--text-light); }

/* RAKOUSKO REGIONY */
.austria-region-header { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
.austria-region-header h3 { margin: 0; color: var(--primary-color); font-size: 22px; line-height: 1.2; }
.austria-region-flag { width: 42px; height: 28px; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

/* LIGHTBOX */
.lightbox { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(29, 35, 39, 0.95); z-index: 9999; justify-content: center; align-items: center; padding: 20px; }
.lightbox.active { display: flex; }
.lightbox-content { position: relative; max-width: 100%; text-align: center; }
.lightbox-close { position: absolute; top: -50px; right: 0; font-size: 40px; cursor: pointer; color: white; opacity: 0.7; transition: opacity 0.2s; }
.lightbox-close:hover { opacity: 1; }
.lightbox-image { max-width: 90vw; max-height: 80vh; border: 4px solid white; border-radius: 4px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.mobile-toggle, .mobile-overlay { display: none; }

/* TLAČÍTKO SMAZAT */
.delete-btn {
  position: absolute; top: -8px; right: -8px; background: #ff4d4d; color: white; border: none; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; font-size: 13px; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.delete-btn:hover { background: #ff1a1a; transform: scale(1.15); }

/* LOADER & VLAJKY & UPLOADER */
.beercaps-loader { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; width: 100%; background: var(--bg-light); }
.spinner { width: 50px; height: 50px; border: 5px solid var(--border-color); border-top: 5px solid var(--accent-color); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.country-flag-sidebar { width: 24px; height: 16px; object-fit: cover; margin-right: 10px; border-radius: 2px; }
.country-flag-header { width: 40px; height: 26px; object-fit: cover; margin-right: 15px; border-radius: 3px; }
.uploader-box { box-shadow: 0 8px 24px rgba(0,0,0,0.05); }

/* MOBIL */
@media (max-width: 980px) {
  .beer-container { flex-direction: column; height: auto; overflow: visible; padding: 0; }
  .sidebar { position: fixed; top: 0; left: -100%; width: 85%; height: 100%; max-width: 300px; z-index: 1001; transition: left 0.3s ease-in-out; box-shadow: 5px 0 30px rgba(0,0,0,0.3); }
  .sidebar.open { left: 0; }
  .mobile-toggle { display: flex; align-items: center; justify-content: center; position: fixed; bottom: 25px; right: 25px; width: 60px; height: 60px; background-color: var(--primary-color); color: white; border-radius: 50%; box-shadow: 0 4px 15px rgba(0,0,0,0.4); z-index: 1002; font-size: 28px; cursor: pointer; transition: transform 0.2s; }
  .mobile-toggle:active { transform: scale(0.9); }
  .mobile-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; backdrop-filter: blur(3px); }
  .mobile-overlay.active { display: block; }
  .main-content { padding: 14px; }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .dashboard-hero h1 { font-size: 2.5em; }
  .stat-card { padding: 20px; min-width: 140px; }
  .stat-number { font-size: 2.5em; }
  .gallery-header { flex-direction: column; align-items: flex-start; gap: 15px; }
  .gallery-header h2 { font-size: 24px; }
  .back-btn { width: 100%; text-align: center; }
  .cap-item { padding: 6px; }
  .cap-name { font-size: 11px; }
}
