/* ============================================================
   DataDNA Judging Portal - Netflix Dark Theme
   Phase 48-03
   ============================================================ */

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

body.ddna-judging-body {
  background: #0d0d0d;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}

/* ---- Header ---- */
.ddna-judging-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #222;
}
.ddna-judging-brand { font-size: 1.1rem; font-weight: 700; color: #e50914; flex-shrink: 0; }
.ddna-judging-meta { display: flex; gap: 16px; flex: 1; font-size: 0.9rem; color: #aaa; }
.ddna-judge-name::after { content: ' · '; }
.ddna-submit-btn {
  background: #e50914;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.ddna-submit-btn:hover:not(:disabled) { background: #f40612; }
.ddna-submit-btn:disabled { background: #444; cursor: not-allowed; }

/* ---- States ---- */
.ddna-judging-loading,
.ddna-judging-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  text-align: center;
  color: #aaa;
  padding: 40px 24px;
}
.ddna-judging-error { flex-direction: column; }
.ddna-error-content h2 { color: #e50914; margin-bottom: 12px; }

.ddna-judging-thanks {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  text-align: center;
}
.ddna-thanks-content { padding: 40px; }
.ddna-thanks-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: #27ae60;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 24px;
}
.ddna-thanks-content h2 { font-size: 2rem; margin-bottom: 12px; }
.ddna-thanks-msg { color: #aaa; font-size: 1.1rem; }

/* ---- Main layout ---- */
.ddna-judging-main {
  padding: 32px 24px;
  max-width: 1600px;
  margin: 0 auto;
  padding-right: 360px; /* room for sidebar */
}

/* ---- Shelf ---- */
.ddna-ai-shelf { margin-bottom: 48px; }
.ddna-shelf-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ddna-ai-shelf .ddna-shelf-title::before {
  content: '★';
  color: #f5c518;
  font-size: 1rem;
}
.ddna-shelf-swiper { width: 100%; overflow: hidden; position: relative; }
.ddna-shelf-swiper .swiper-slide { width: 240px !important; }
.ddna-shelf-swiper .swiper-button-next,
.ddna-shelf-swiper .swiper-button-prev {
  color: #fff;
}

/* ---- Cards ---- */
.ddna-judging-card {
  width: 240px;
  height: 320px;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a center/cover no-repeat;
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
  position: relative;
}
.ddna-judging-card:hover { transform: scale(1.03); z-index: 1; }
.ddna-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  padding: 12px;
}
.ddna-score-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.7);
  border: 1px solid #555;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}
.ddna-tier-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.ddna-tier-advanced { background: #b8860b; }
.ddna-tier-intermediate { background: #555; }
.ddna-tier-beginner { background: #1a5f96; }
.ddna-card-bottom {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

/* ---- Entries grid ---- */
.ddna-all-entries { margin-bottom: 48px; }
.ddna-entries-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ddna-tier-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.ddna-tier-btn {
  background: #222;
  color: #ccc;
  border: 1px solid #333;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.ddna-tier-btn:hover, .ddna-tier-btn.active {
  background: #e50914;
  color: #fff;
  border-color: #e50914;
}
.ddna-entries-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ddna-entries-grid .ddna-judging-card { width: 100%; height: 280px; }

/* ---- Sidebar ---- */
.ddna-selection-sidebar {
  position: fixed;
  right: 0;
  top: 60px;
  bottom: 0;
  width: 320px;
  background: #111;
  border-left: 1px solid #222;
  padding: 24px 16px;
  overflow-y: auto;
  z-index: 50;
}
.ddna-selection-sidebar h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ddna-slot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #222;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.ddna-slot-label { font-weight: 700; color: #aaa; flex-shrink: 0; min-width: 80px; }
.ddna-slot-value { flex: 1; color: #ccc; }
.ddna-slot-value em { color: #555; font-style: normal; }
.ddna-slot-clear {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  flex-shrink: 0;
}
.ddna-slot-clear:hover { color: #e50914; }

/* ---- Entry modal ---- */
.ddna-entry-modal {
  max-width: 900px;
  width: 95vw;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}
.ddna-entry-modal::backdrop { background: rgba(0,0,0,0.92); }
.ddna-entry-modal .ddna-modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: 85vh;
  overflow: auto;
  position: relative;
}
.ddna-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ddna-modal-image { background: #0d0d0d; }
.ddna-modal-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ddna-no-image { display: flex; align-items: center; justify-content: center; height: 300px; color: #555; }
.ddna-modal-details { padding: 24px; overflow-y: auto; }
.ddna-modal-title { font-size: 1.1rem; margin-bottom: 20px; }
.ddna-score-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.85rem; }
.ddna-score-dim { width: 90px; flex-shrink: 0; color: #aaa; }
.ddna-score-bar-track { flex: 1; height: 8px; background: #333; border-radius: 4px; overflow: hidden; }
.ddna-score-bar-fill { height: 100%; background: #e50914; border-radius: 4px; }
.ddna-score-val { width: 32px; text-align: right; color: #aaa; font-size: 0.8rem; }
.ddna-modal-feedback { margin-top: 20px; }
.ddna-modal-feedback h4 { color: #ccc; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.ddna-modal-feedback ul { list-style: disc; padding-left: 16px; margin-bottom: 16px; }
.ddna-modal-feedback li { font-size: 0.85rem; color: #bbb; margin-bottom: 4px; }
.ddna-modal-assign-row {
  grid-column: 1 / -1;
  padding: 16px 24px;
  border-top: 1px solid #222;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #111;
}
.ddna-assign-label { color: #aaa; font-size: 0.85rem; font-weight: 700; flex-shrink: 0; }
.ddna-assign-btn {
  background: #222;
  color: #ccc;
  border: 1px solid #444;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.ddna-assign-btn:hover { background: #e50914; color: #fff; border-color: #e50914; }
.ddna-assign-btn.active { background: #27ae60; color: #fff; border-color: #27ae60; }

/* ---- Confirm modal ---- */
.ddna-confirm-modal {
  max-width: 480px;
  width: 95vw;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 32px;
}
.ddna-confirm-modal::backdrop { background: rgba(0,0,0,0.85); }
.ddna-confirm-modal h3 { margin-bottom: 8px; }
.ddna-confirm-modal > p { color: #aaa; font-size: 0.9rem; margin-bottom: 20px; }
.ddna-confirm-row { padding: 8px 0; border-bottom: 1px solid #222; font-size: 0.9rem; }
.ddna-confirm-actions { display: flex; gap: 12px; margin-top: 24px; }
.ddna-confirm-submit-btn {
  background: #e50914;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
}
.ddna-confirm-submit-btn:hover { background: #f40612; }
.ddna-confirm-cancel-btn {
  background: #333;
  color: #ccc;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
}
.ddna-submit-error { color: #e50914; font-size: 0.85rem; margin-bottom: 12px; }

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .ddna-judging-main { padding-right: 340px; }
}
.ddna-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}
.ddna-sidebar-toggle:hover { background: #1558b8; }
.ddna-sidebar-toggle-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.ddna-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
}
.ddna-sidebar-backdrop.open { display: block; }

@media (max-width: 1024px) {
  .ddna-entries-grid { grid-template-columns: repeat(2, 1fr); }
  .ddna-judging-main { padding-right: 24px; }
  .ddna-selection-sidebar {
    position: fixed;
    right: -320px;
    transition: right 0.3s;
    z-index: 999;
  }
  .ddna-selection-sidebar.open { right: 0; }
  .ddna-sidebar-toggle { display: inline-flex; }
}
@media (max-width: 640px) {
  .ddna-entries-grid { grid-template-columns: 1fr; }
  .ddna-judging-main { padding: 16px; }
  .ddna-judging-header { padding: 8px 16px; }
  .ddna-entry-modal .ddna-modal-content { grid-template-columns: 1fr; }
}
