:root {
  --bg-primary: #0f172a;
  --text-primary: #f8fafc;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --shadow-subtle: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1e2433 100%);

}

.page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 60vh;
  width: 100%;
}

.title {
  color: #f8fafc;
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center;
  margin: 2rem 0 1rem;
}

.divider {
  width: 2px;
  height: 300px;
  height: 60%;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 1px;
  margin-top: 72px;

}

.camera-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 2;
}

.section-label {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}

.control-container {
  margin-top: 40px;
  display: flex;
  gap: 40px;
  border-radius: 16px;
  padding: 40px;
  max-width: 1200px;
  height: 550px;
  width: 100%;
  transform: scale(1.12);

}

.projector-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-height: 400px;
  transform: scale(1.30);
  margin-left: 20px;
  margin-top: 20px;
}

.projector-toggle {
  padding: 15px 25px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  box-shadow: var(--shadow-subtle);
  width: 115px;
  height: 115px;

}
.camera-toggle {
  padding: 15px 25px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  box-shadow: var(--shadow-subtle);
  width: 115px;
  height: 115px;

}

.projector-toggle.inactive {
  background-color: var(--accent-green);
  color: white;
}

.projector-toggle.inactive:hover {
  background-color: #059669;
}

.projector-toggle.active {
  background-color: var(--accent-red);
  color: white;
}

.projector-toggle.active:hover {
  background-color: #dc2626;
}

.projector-toggle:disabled {
  background-color: gray;
}

.projector-toggle.inactive:disabled {
  background-color: gray;
}

.projector-toggle.active:disabled {
  background-color: gray;
}

.camera-toggle.inactive {
  background-color: var(--accent-green);
  color: white;
}

.camera-toggle.inactive:hover {
  background-color: #059669;
}

.camera-toggle.active {
  background-color: var(--accent-red);
  color: white;
}

.camera-toggle.active:hover {
  background-color: #dc2626;
}

.camera-toggle:disabled {
  background-color: gray;
}

.camera-toggle.inactive:disabled {
  background-color: gray;
}

.camera-toggle.active:disabled {
  background-color: gray;
}



.camera-control {
  display: grid;
  justify-content: center;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  flex: 2;
  aspect-ratio: 1/1;
  /* Ensure square shape */
  height: 400px;
  /* Limit maximum height */
  transform: scale(0.80);
  transform-origin: center;

}

.camera-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.3s ease;
}

.camera-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.camera-btn.home {
  grid-column: 2;
  grid-row: 2;
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.camera-btn.active {
  /* a green highlight */
  background-color: rgba(16, 185, 129, 0.3);
  transform: scale(0.95);
}

.up-left {
  grid-column: 1;
  grid-row: 1;
}

.up {
  grid-column: 2;
  grid-row: 1;
}

.up-right {
  grid-column: 3;
  grid-row: 1;
}

.left {
  grid-column: 1;
  grid-row: 2;
}

.right {
  grid-column: 3;
  grid-row: 2;
}

.down-left {
  grid-column: 1;
  grid-row: 3;
}

.down {
  grid-column: 2;
  grid-row: 3;
}

.down-right {
  grid-column: 3;
  grid-row: 3;
}

.in {
  grid-column: 1;
  grid-row: 4;
}

.out {
  grid-column: 3;
  grid-row: 4;
}

.camera-btn,
.preset-btn {
  /* Safari */
  -webkit-user-select: none;
  /* IE10+/Edge */
  -ms-user-select: none;
  user-select: none;
  /* iOS Safari: disables the "copy" menu */
  -webkit-touch-callout: none;
  /* Prevents zoom/double-tap */
  touch-action: manipulation;
}

.presets {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  margin-right: 25px;
}

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

.preset-btn {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  padding: 15px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.preset-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.preset-btn.active {
  /* subtle green tint */
  background-color: rgba(16, 185, 129, 0.3);
  /* press-down effect */
  transform: scale(0.95);
}

#cameraFeed {
  width: 100%;
  height: 100%;
  max-height: 298px;
  border-radius: 12px;
  object-fit: cover;
  margin-top: 62px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-subtle);
  background-color: white;
}
