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

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #ffffff;
  padding: 0;
  color: #1a1a1a;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 16px;
  width: 100%;
  box-sizing: border-box;
}

.header {
  background: #1a1a1a;
  color: white;
  padding: 24px 20px;
  margin-bottom: 24px;
}

.header-content {
  max-width: 1440px;
  margin: 0 auto;
}

h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.header-subtitle {
  font-size: 16px;
  color: #b0b0b0;
  font-weight: 400;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: #1a1a1a;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e5e5;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #1a1a1a;
}

.section {
  background: white;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e5e5e5;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.top-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
  align-items: start;
}

.selected-section {
  width: 100%;
}

.selected-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.video-panel {
  width: 100%;
}

.video-player {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 4px;
  background: #000;
}

.video-missing {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  background: #f5f5f5;
  border-radius: 4px;
}

.empty-message {
  padding: 40px 20px;
  text-align: center;
  color: #999;
}

.all-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.photo-card {
  background: white;
  border: 1px solid #e5e5e5;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.photo-card:hover {
  border-color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.photo-card.selected {
  border: 2px solid #1a1a1a;
}

.photo-card.disqualified {
  opacity: 0.6;
  filter: grayscale(0.7);
}

.photo-image-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.photo-image-link {
  display: block;
  cursor: pointer;
  text-decoration: none;
}

.photo-image-link:hover {
  opacity: 0.9;
}

.photo-image {
  width: auto;
  height: 200px;
  max-width: 100%;
  object-fit: contain;
  background: #f5f5f5;
  display: block;
  margin: 0 auto;
}

.badges-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 2px;
}

.badge-odrzucone {
  background: rgba(220, 53, 69, 0.9);
  color: white;
}

.badge-private {
  background: rgba(108, 117, 125, 0.9);
  color: white;
}

.badge-night {
  background: rgba(33, 37, 41, 0.9);
  color: white;
}

.photo-info {
  padding: 12px;
}

.photo-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-category {
  display: inline-block;
  background: #1a1a1a;
  color: white;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 2px;
}

.photo-description {
  font-size: 12px;
  color: #4a4a4a;
  line-height: 1.5;
  margin-bottom: 8px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.photo-ratings {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
  padding: 8px 0;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  flex-wrap: wrap;
}

.rating-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rating-label {
  font-size: 9px;
  color: #666;
  text-align: center;
  line-height: 1.2;
}

.rating-badge {
  display: inline-block;
  padding: 4px 10px;
  background: #1a1a1a;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  white-space: nowrap;
}

.rating-badge.rating-score {
  background: #4a4a4a;
}


.photo-stats {
  font-size: 11px;
  color: #666;
  margin-bottom: 8px;
}

.photo-stats-line {
  margin-bottom: 4px;
}

.photo-diversity {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e5e5;
  font-size: 10px;
}

.diversity-label {
  font-size: 9px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  font-weight: 600;
}

.diversity-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}

.diversity-metric {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
}

.diversity-metric-label {
  color: #666;
  font-weight: 500;
}

.diversity-metric-value {
  color: #1a1a1a;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-weight: 600;
  background: #f5f5f5;
  padding: 2px 5px;
  border-radius: 2px;
}

.diversity-metric-indicator {
  font-size: 8px;
  color: #999;
  font-weight: 700;
  line-height: 1;
}

.diversity-metric-high-good .diversity-metric-indicator {
  color: #28a745;
}

.diversity-metric-high-bad .diversity-metric-indicator {
  color: #dc3545;
}

.diversity-metric-main {
  margin-left: auto;
}

.diversity-metric-main .diversity-metric-value {
  background: #1a1a1a;
  color: white;
  font-weight: 700;
}

.photo-filename {
  font-size: 10px;
  color: #999;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e5e5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: color 0.2s;
}

.photo-filename:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

@media (max-width: 1200px) {
  .top-layout {
    grid-template-columns: 1fr;
  }
  
  .selected-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1000px) {
  .selected-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .all-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 700px) {
  .selected-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .all-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 500px) {
  .selected-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .all-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
