body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background-color: #111412;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(76, 175, 80, 0.12) 0%, transparent 80%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(46, 125, 50, 0.09) 0%, transparent 70%),
    url("floral-bg.svg");
  background-repeat: repeat;
  background-size: auto, auto, 240px 240px;
  background-attachment: fixed;
  color: #f0f0f0;
  margin: 0;
  padding: 24px;
  min-height: 100vh;
}

#app {
  max-width: 1400px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  color: #4caf50;
  margin-bottom: 20px;
  font-size: 28px;
}

h2 {
  font-size: 22px;
  margin-top: 28px;
  text-align: center;
}

hr {
  border: none;
  border-top: 1px solid #444;
  margin: 24px 0;
}

/* --- NEW TWO-ROW HEADER --- */
.header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background-color: #2a2a2a;
  border-radius: 8px;
  border: 1px solid #333;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.header p {
  margin: 0;
  color: #aaa;
}

.event-clock-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background-color: #333;
  border: 1px solid #444;
  color: #e0e0e0;
  transition: all 0.3s ease;
}

.event-clock-badge.live {
  background-color: rgba(76, 175, 80, 0.15);
  border-color: #4caf50;
  color: #81c784;
}

.event-clock-badge.upcoming {
  background-color: rgba(255, 193, 7, 0.15);
  border-color: #ffc107;
  color: #ffd54f;
}

.event-clock-badge.ended {
  background-color: rgba(244, 67, 54, 0.15);
  border-color: #f44336;
  color: #e57373;
}

.clock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #aaa;
}

.event-clock-badge.live .clock-dot {
  background-color: #4caf50;
  box-shadow: 0 0 8px #4caf50;
}

.event-clock-badge.upcoming .clock-dot {
  background-color: #ffc107;
}

.event-clock-badge.ended .clock-dot {
  background-color: #f44336;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

/* --- THE TOGGLE SWITCH --- */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #4caf50;
}
input:checked + .slider:before {
  transform: translateX(26px);
}

/* --- BEAUTIFUL BUTTONS --- */
.beautiful-btn {
  width: auto;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  color: #e0e0e0;
  background-color: #424242; /* Neutral grey */
  border: 1px solid #555;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.beautiful-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#logout-btn:hover {
  background-color: #f44336; /* Red on hover */
  border-color: #f44336;
}

#save-times-btn {
  background-color: #1976d2; /* Blue */
  border-color: #1976d2;
}

#save-times-btn:hover {
  background-color: #2196f3; /* Lighter blue on hover */
  border-color: #2196f3;
}

/* --- DATE/TIME INPUT --- */
input[type="datetime-local"] {
  background-color: #333;
  color: #f0f0f0;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 8px;
  color-scheme: dark;
}

/* --- GRID & CARD STYLES --- */
#submissions-list,
#team-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.submission-card,
.team-card {
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.team-card h3 {
  margin-top: 0;
  color: #4caf50;
}

.submission-card p,
.team-card p {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.image-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
  cursor: pointer;
  background-color: #1e221f;
  border: 1px solid #383e39;
  border-radius: 8px;
  padding: 10px;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  position: relative;
}

.image-comparison:hover {
  background-color: #262c28;
  border-color: #4caf50;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(76, 175, 80, 0.3);
}

.image-container {
  display: flex;
  flex-direction: column;
}

.image-container h4 {
  margin-top: 0;
  margin-bottom: 6px;
  font-weight: 500;
  color: #bbb;
  text-align: center;
  font-size: 13px;
}

.image-container img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  border-radius: 4px;
  background-color: #141614;
  display: block;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.actions button,
.advance-btn,
#login-btn {
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
}

.approve-btn {
  background-color: #4caf50;
}
.reject-btn {
  background-color: #f44336;
}
.advance-btn {
  background-color: #2196f3;
  margin-top: 10px;
}

button:disabled,
.approve-btn:disabled,
.reject-btn:disabled,
.advance-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
  pointer-events: none;
  transform: none !important;
}

#login-container {
  max-width: 400px;
  margin: 60px auto;
  padding: 24px 28px 28px 28px;
  background-color: #2a2a2a;
  border-radius: 12px;
  border: 1px solid #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#login-container h2 {
  margin-top: 0;
  margin-bottom: 24px;
}

#login-container input,
#login-container select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 6px;
  border: 1px solid #555;
  background-color: #333;
  color: #f0f0f0;
  font-size: 16px;
}

#login-btn {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  background-color: #4caf50;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#login-btn:hover {
  background-color: #5cb85c;
}

.error-message {
  color: #f44336;
  text-align: center;
  margin-top: 10px;
  min-height: 1.2em;
}

.error-message {
  color: #f44336;
}

/* --- COLLAPSIBLE SECTION --- */
.collapsible-header {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  gap: 10px;
}
.collapsible-header h2 {
  margin: 0;
}
.collapsible-icon {
  font-size: 16px;
  transition: transform 0.3s ease;
}
.collapsible-header.open .collapsible-icon {
  transform: rotate(180deg);
}
.collapsible-content.hidden {
  display: none;
}

/* --- MODERN ANIMATED LOADER --- */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 0;
  color: #888;
  font-size: 14px;
  grid-column: 1 / -1;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(255, 255, 255, 0.12);
  border-top-color: #4caf50;
  border-radius: 50%;
  animation: spinnerRotate 0.75s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

@keyframes spinnerRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* --- LIGHTBOX MODAL --- */
#lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

#lightbox-modal.active {
  display: flex !important;
}

#lightbox-modal.hidden {
  display: none !important;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.lightbox-content {
  position: relative;
  z-index: 1001;
  background: #242424;
  border: 1px solid #444;
  border-radius: 12px;
  max-width: 1100px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  padding: 20px;
  box-sizing: border-box;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #3a3a3a;
}

#lightbox-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lightbox-team {
  font-size: 20px;
  font-weight: bold;
  color: #4caf50;
}

.lightbox-mystery {
  font-size: 16px;
  color: #ccc;
}

.lightbox-close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 0 8px;
  transition: color 0.2s;
}

.lightbox-close-btn:hover {
  color: white;
}

.lightbox-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  flex: 1;
  overflow: hidden;
  min-height: 350px;
}

.lightbox-img-card {
  display: flex;
  flex-direction: column;
  background: #181818;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #333;
}

.lightbox-label {
  font-size: 14px;
  font-weight: 600;
  color: #aaa;
  text-align: center;
  margin-bottom: 10px;
}

.lightbox-img-card img {
  width: 100%;
  height: 100%;
  max-height: 55vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-actions {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #3a3a3a;
}

.lightbox-actions button {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

.lightbox-actions button:hover {
  opacity: 0.9;
}
