/* ==========================================================================
   BUILDX 2026 - JUDGING DASHBOARD MINIMAL TECH SYSTEM
   Ultra-clean, distraction-free, zero frame-in-frame wrapper.
   Typography: Urbanist everywhere
   Aesthetic: Minimalist, high contrast, clean inputs, zero random neon colors
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700;800;900&display=swap');

:root {
  --font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Surfaces */
  --bg-page: #FFFFFF;
  --bg-sidebar: #FBFBFC;
  --bg-subtle: #F6F7F9;
  --bg-input: #F8F9FA;
  --bg-hover: #F0F1F4;

  /* Text */
  --text-primary: #0D1322;
  --text-secondary: #4B5563;
  --text-muted: #8E9BAE;
  --text-light: #9CA3AF;

  /* Accents */
  --accent-blue: #0E44E6;
  --accent-blue-hover: #082FA7;
  
  /* Solid Minimal Hardware & Software Badges (Matching BuildX Dark Tech & Slate) */
  --hw-bg: #181D27;
  --hw-text: #FFFFFF;

  --sw-bg: #0E44E6;
  --sw-text: #FFFFFF;

  /* Status */
  --status-green: #059669;
  --status-green-bg: #ECFDF5;

  /* Borders & Dividers */
  --border-color: #E5E7EB;
  --border-subtle: #F0F2F5;

  /* Transitions */
  --transition: 0.15s ease;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Custom Minimal Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   FULL PAGE VIEW CONTAINER (ZERO OUTER GREY FRAME)
   ========================================================================== */
.app-viewport {
  width: 100vw;
  height: 100vh;
  display: flex;
  background: var(--bg-page);
  position: relative;
}

/* ==========================================================================
   1. MINIMAL LEFT SIDEBAR (ONLY TEAMS ASSIGNED TO THIS JUDGE)
   ========================================================================== */
.app-sidebar {
  width: 320px;
  min-width: 300px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1.25rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.buildx-svg-logo {
  height: 30px;
  width: auto;
  display: block;
}

.brand-text-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0D1322;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-blue);
  background: #EEF2FF;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.sidebar-search-wrap {
  position: relative;
  width: 100%;
}

.sidebar-search-wrap input {
  width: 100%;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.sidebar-search-wrap input:focus {
  border-color: var(--text-primary);
}

.sidebar-search-wrap svg {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem 0.25rem;
}

.sidebar-title-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.assigned-count-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary);
}

/* Projects List in Sidebar */
.sidebar-projects-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}

.project-item:hover {
  background: var(--bg-hover);
}

.project-item.active {
  background: #FFFFFF;
  border-color: var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.project-item-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.2rem;
}

.project-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-item-subtitle-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mini-track-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

.mini-track-badge.hardware {
  background: #111827;
  color: #FFFFFF;
}

.mini-track-badge.software {
  background: #0E44E6;
  color: #FFFFFF;
}

.project-item-team {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-item-status {
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.status-badge.completed {
  background: var(--status-green-bg);
  color: var(--status-green);
}

.status-badge.pending {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

/* ==========================================================================
   2. MAIN EVALUATION STAGE (CLEAN 2-COLUMN FULL HEIGHT LAYOUT)
   ========================================================================== */
.main-stage {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-page);
}

/* Stage Header */
.stage-header {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-project-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.header-tags-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Solid Minimal Hardware & Software Track Tag */
.track-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.track-tag.hardware {
  background: #111827;
  color: #FFFFFF;
}

.track-tag.software {
  background: #0E44E6;
  color: #FFFFFF;
}

.team-name-tag {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.team-name-tag strong {
  color: var(--text-primary);
}

.active-project-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Header Score Pill */
.header-score-indicator {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  background: var(--bg-subtle);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.score-num-live {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--accent-blue);
  line-height: 1;
}

.score-num-live.completed {
  color: var(--status-green);
}

.score-denom {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Stage Split Content (Left Presentation/Abstract, Right Scoring Inputs) */
.stage-content-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
}

/* Left Panel: Presentation Slide (if available) & Abstract */
.left-content-panel {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Presentation Embed Container (Only shown when presentation link exists!) */
.presentation-section-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.presentation-embed-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000000;
  border: 1px solid var(--border-color);
}

.presentation-embed-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.abstract-text-container {
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 1.25rem;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-line;
}

/* Right Panel: Clean Numeric Point Inputs & Remarks */
.right-scoring-panel {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  background: #FFFFFF;
}

.rubric-inputs-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Clean Minimal Input Card for Points (Zero AI brain-rot badge clutter) */
.rubric-input-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-page);
  transition: var(--transition);
}

.rubric-input-card:focus-within {
  border-color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.rubric-input-card.error-card {
  border-color: #EF4444 !important;
  background: #FEF2F2 !important;
}

.rubric-input-card.error-card .rubric-input-box {
  border-color: #EF4444 !important;
  background: #FFFFFF !important;
}

.rubric-input-card.error-card .point-number-input {
  color: #DC2626 !important;
}

.rubric-info-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.rubric-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.rubric-description {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.rubric-input-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
}

.point-number-input {
  width: 50px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: right;
  outline: none;
}

.point-max-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Benchmark Remarks Box */
.remarks-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.remarks-clean-input {
  width: 100%;
  min-height: 90px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: var(--transition);
}

.remarks-clean-input:focus {
  border-color: var(--text-primary);
  background: #FFFFFF;
}

/* Stage Bottom Actions */
.stage-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  gap: 1rem;
}

.btn-nav-arrow {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.btn-nav-arrow:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-nav-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-save-score {
  background: #0D1322;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.6rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-save-score:hover {
  background: var(--accent-blue);
}

/* Mobile Nav & Drawer Toggle Controls (Hidden on Desktop) */
.mobile-nav-bar {
  display: none;
}

.btn-close-drawer {
  display: none;
}

.mobile-drawer-backdrop {
  display: none;
}

/* ==========================================================================
   3. MOBILE & TABLET RESPONSIVENESS (PERFECT PHONE EXPERIENCE)
   ========================================================================== */
@media (max-width: 1024px) {
  .stage-content-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .left-content-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .app-viewport {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  /* Mobile Sticky Navigation Header */
  .mobile-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 80;
  }

  .btn-mobile-drawer {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.45rem 0.8rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
  }

  .mobile-score-chip {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
  }

  .mobile-score-chip span {
    color: var(--accent-blue);
    font-size: 1rem;
    font-weight: 900;
  }

  /* Off-canvas Slide-out Drawer for Projects Sidebar on Mobile */
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
    background: #FFFFFF;
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .btn-close-drawer {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
  }

  /* Backdrop Overlay */
  .mobile-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .mobile-drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Main Evaluation Stage on Mobile */
  .main-stage {
    height: auto;
    overflow: visible;
    flex: 1;
    padding-bottom: 2rem;
  }

  .stage-header {
    padding: 1rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .active-project-title {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .header-score-indicator {
    display: none; /* Already cleanly represented in sticky top bar */
  }

  .stage-content-body {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .left-content-panel {
    padding: 1.25rem;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    overflow: visible;
  }

  .abstract-text-container {
    font-size: 0.88rem;
    line-height: 1.6;
    padding: 1rem;
  }

  .right-scoring-panel {
    padding: 1.25rem;
    overflow: visible;
    gap: 1.5rem;
  }

  /* Touch-Optimized Numeric Rubric Cards */
  .rubric-input-card {
    padding: 0.95rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .rubric-input-card .rubric-info-left {
    width: 100%;
  }

  .rubric-input-box {
    width: 100%;
    justify-content: flex-end;
    padding: 0.5rem 0.85rem;
  }

  .point-number-input {
    font-size: 1.5rem;
    width: 70px;
  }

  .stage-actions-bar {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  .stage-actions-bar > div {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }

  .btn-nav-arrow {
    justify-content: center;
    padding: 0.85rem;
  }

  .btn-save-score {
    width: 100%;
    justify-content: center;
    padding: 0.95rem;
    font-size: 0.95rem;
  }
}
