/* Index Page — Judging Criteria styles
   Dedicated to the Judging section, matching Themes color scheme.
   Uses brand variables with safe fallbacks and 3D icon treatment. */

.judging {
  padding: 40px 0;
}

.judging .section-title {
  text-align: center;
  margin-bottom: 24px;
}

.judging .section-title h2 {
  display: inline-block;
  margin: 0 0 8px 0;
  color: var(--primary, #1c2633);
}

.judging .section-title .subtitle {
  margin: 0;
  color: var(--secondary, #1f2937);
  font-weight: 500;
}

/* Gentle header accent */
.judging .header-accent {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary, #0d6efd), var(--secondary, #00c2ff));
  margin: 12px auto 0;
  max-width: 160px;
}

/* Layout */
.judging .criteria-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 778px) {
  .judging .criteria-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1200px) {
  .judging .criteria-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Card styling */
.judging .criteria-card {
  border: 1px solid #e6e8eb;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary, #0c2340) 0%, var(--secondary, #008273) 55%, var(--light, #f8fafc) 100%);
  box-shadow:
    0 10px 28px rgba(0,0,0,0.22),
    0 4px 10px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.35);
  padding: 18px;
}

.judging .card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

/* 3D Icon treatment */
.judging .criteria-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  position: relative;
  background: radial-gradient(120% 120% at 30% 30%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 35%, rgba(255,255,255,0.2) 100%),
              linear-gradient(135deg, var(--primary, #0d6efd), var(--secondary, #00c2ff));
  box-shadow:
    0 10px 18px rgba(13, 110, 253, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.8);
  display: grid;
  place-items: center;
}

.judging .criteria-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -6px;
  height: 10px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.0));
  filter: blur(2px);
}

.judging .criteria-icon i {
  color: #ffffff;
  font-size: 22px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.judging .criteria-title h3 {
  margin: 0;
  font-size: 1.05rem;
}

.judging .criteria-title p {
  margin: 2px 0 0 0;
  color: #556172;
  font-size: 0.95rem;
}

/* Progress bar */
.judging .progress {
  position: relative;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #edf2f7, #e6ebf2);
  overflow: hidden;
}

.judging .progress .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--primary, #0d6efd), var(--secondary, #00c2ff));
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.6);
  border-radius: 8px;
  animation: judging-fill 1100ms ease-out forwards;
}

@keyframes judging-fill {
  from { width: 0%; }
  to { width: calc(var(--weight, 20) * 1%); }
}

.judging .progress .value {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: #2a3340;
}

/* Evaluation Points */
.judging .evaluation-points {
  margin-top: 28px;
  border: 1px solid #e6e8eb;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 8px 24px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.6);
  padding: 18px;
}

.judging .evaluation-points .list-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px 0;
}

.judging .evaluation-points .list-title i {
  color: var(--secondary, #00c2ff);
}

.judging .points-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 778px) {
  .judging .points-list { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1200px) {
  .judging .points-list { grid-template-columns: repeat(3, 1fr); }
}

.judging .points-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  padding: 6px 0;
  background: transparent;
}

.judging .point-icon {
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: inherit;
  box-shadow: none;
  font-size: 1.1rem;
}

/* Colorful 3D-style icons for each evaluation point */
.judging .point-item:nth-child(1) .point-icon i {
  color: #fbbf24;
  text-shadow: 0 2px 6px rgba(251, 191, 36, 0.6);
}

.judging .point-item:nth-child(2) .point-icon i {
  color: #38bdf8;
  text-shadow: 0 2px 6px rgba(56, 189, 248, 0.6);
}

.judging .point-item:nth-child(3) .point-icon i {
  color: #34d399;
  text-shadow: 0 2px 6px rgba(52, 211, 153, 0.6);
}

.judging .point-item:nth-child(4) .point-icon i {
  color: #a855f7;
  text-shadow: 0 2px 6px rgba(168, 85, 247, 0.6);
}

.judging .point-item:nth-child(5) .point-icon i {
  color: #f97316;
  text-shadow: 0 2px 6px rgba(249, 115, 22, 0.6);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .judging .progress .fill { animation: none; width: calc(var(--weight, 20) * 1%); }
}

/* --- Two-panel layout matching provided structure --- */
.judging .judging-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 778px) {
  .judging .judging-panels { grid-template-columns: 1fr 1fr; }
}

/* Prevent horizontal overflow on mobile */
@media (max-width: 777.98px) {
  .judging .judging-panels { overflow: hidden; }
  .judging .panel-card { width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden; }
  /* Allow weightage rows to wrap so badge+bar never exceed card width */
  .judging .weightage-item { flex-wrap: wrap; }
  .judging .weightage-item .label { flex: 1 1 100%; min-width: 0; }
  .judging .weightage-item .metric { flex: 1 1 100%; min-width: 0; }
  .judging .bar { width: 100%; max-width: 100%; }
}

/* Prevent horizontal overflow on small tablets (778–970px) */
@media (min-width: 778px) and (max-width: 970px) {
  .judging .judging-panels { overflow: hidden; }
  .judging .panel-card { width: 100%; max-width: 100%; box-sizing: border-box; }
  .judging .weightage-item { flex-wrap: wrap; }
  .judging .weightage-item .label { flex: 1 1 100%; min-width: 0; }
  .judging .weightage-item .metric { flex: 1 1 100%; min-width: 0; }
  /* Make progress bar fill available line width when wrapped */
  .judging .bar { width: 100%; max-width: 100%; }
  /* Ensure long text cannot create overflow */
  .judging .points-card .point-item p { overflow-wrap: anywhere; }
}

.judging .panel-card {
  border: 1px solid #e6e8eb;
  border-radius: 20px;
  background: linear-gradient(
338deg, #f59e0ba1 0%, #f7fafc 100%);
  box-shadow: 0 10px 24px rgba(0,0,0,0.09), inset 0 1px 0 rgba(255,255,255,0.7);
  padding: 24px;
}

.judging .panel-card h3 {
  text-align: center;
  margin: 0 0 18px 0;
  color: #28334a;
}

/* Left: Weightage list */
.judging .weightage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.judging .weightage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.judging .weightage-item .label {
  font-size: 1rem;
  color: #1f2937;
}

.judging .weightage-item .metric {
  display: flex;
  align-items: center;
  gap: 12px;
}

.judging .badge {
  min-width: 44px;
  height: 30px;
  padding: 0 10px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  background: var(--color, var(--primary, #0d6efd));
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.judging .bar {
  width: clamp(120px, 30vw, 220px);
  height: 14px;
  border-radius: 8px;
  background: #0a1a3b;
  position: relative;
  overflow: hidden;
}

.judging .bar .bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--color, #0d6efd), rgba(255,255,255,0.9));
  animation: judging-bar-fill 1200ms ease-out forwards;
}

@keyframes judging-bar-fill {
  from { width: 0%; }
  to { width: calc(var(--weight, 20) * 1%); }
}

/* Right: Points card */
.judging .points-card .points-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.judging .points-card .point-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.judging .points-card .point-item .icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary, #0d6efd), var(--secondary, #00c2ff));
  box-shadow: 0 8px 16px rgba(13,110,253,0.25);
}

.judging .points-card .point-item p {
  margin: 0;
  color: #1f2937;
}
/* Prevent container overflow for mid-large screens */
@media (min-width: 970px) and (max-width: 1441px) {
  .judging .judging-panels { overflow: hidden; }
  .judging .panel-card { width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden; }
  .judging .weightage-item { flex-wrap: wrap; }
  .judging .weightage-item .label { flex: 1 1 100%; min-width: 0; }
  .judging .weightage-item .metric { flex: 1 1 100%; min-width: 0; }
  .judging .bar { width: 100%; max-width: 220px; }
  .judging .points-card .point-item p { overflow-wrap: anywhere; }
}
