* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  min-height: 100vh;
  background: #eef4ff;
  color: #111827;
}

/* MAIN 3 COLUMN LAYOUT */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr 220px;
  gap: 24px;
  padding: 24px;
}

/* LEFT */
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

#roadPanel,
#drivePanel {
  background: #1e3a8a;
  color: white;
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(30, 58, 138, 0.25);
  text-align: left;
}

#roadPanel h3,
#drivePanel h3 {
  font-size: 21px;
  margin-bottom: 18px;
}

#roadPanel p,
#drivePanel p {
  font-size: 17px;
  font-weight: 600;
  margin: 14px 0;
}

/* CENTER */
.center-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  font-size: 58px;
  color: #1e3a8a;
  margin: 25px 0 35px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 18px;
  text-shadow: 0 5px 12px rgba(30, 58, 138, 0.25);
}

h1 .icon {
  width: 55px;
  height: 55px;
}

.camera-box {
  position: relative;
  width: 760px;
  max-width: 100%;
  height: 520px;
  background: white;
  border: 3px solid #1e3a8a;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(30, 58, 138, 0.25);
}

video,
#overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#status {
  margin: 22px 0 15px;
  font-size: 22px;
  font-weight: 600;
}

/* BUTTON COMMON */
button {
  border: none;
  border-radius: 12px;
  background: #1e3a8a;
  color: white;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  height: 52px;
  padding: 0 22px;
}

button:hover {
  background: #3b82f6;
  transform: translateY(-2px);
}

/* CENTER BUTTONS PERFECT ALIGNMENT */
.main-controls,
.extra-controls,
.safety-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.main-controls button,
.extra-controls button,
.safety-controls button {
  width: 210px;
}

.language-box {
  width: 210px;
  height: 52px;
  background: #1e3a8a;
  color: white;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.language-box select {
  padding: 6px;
  border-radius: 6px;
  border: none;
}

#emergencyDisplay {
  margin-top: 15px;
  color: red;
  font-size: 18px;
  font-weight: bold;
}

#locationStatus {
  margin-top: 12px;
  font-weight: bold;
}

/* RIGHT */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 25px;
}

#topRightButtons {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#topRightButtons button {
  width: 100%;
}

#result {
  text-align: center;
  font-size: 17px;
  font-weight: bold;
}

/* STATUS ALERT */
#status.alert {
  animation: blinkRed 0.5s infinite alternate;
}

@keyframes blinkRed {
  from {
    color: red;
  }
  to {
    color: darkred;
  }
}

/* DARK MODE */
body.dark {
  background: #0f172a;
  color: white;
}

body.dark .camera-box {
  background: #111827;
}

/* MOBILE */
@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 42px;
  }

  h1 .icon {
    width: 40px;
    height: 40px;
  }

  .camera-box {
    height: 430px;
  }

  .right-panel {
    padding-top: 0;
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding: 14px;
  }

  h1 {
    font-size: 32px;
  }

  .camera-box {
    height: 300px;
  }

  .main-controls button,
  .extra-controls button,
  .safety-controls button,
  .language-box {
    width: 100%;
  }
}
h1 {
  display: flex;
  justify-content: center;   /* CENTER */
  align-items: center;
  gap: 15px;

  text-align: center;
  width: 100%;

  font-size: 48px;
  font-weight: 900;
  color: #1e3a8a;

  margin: 25px auto;
}

h1 .icon {
  width: 45px;
  height: 45px;
}