/* ===== Common Body Styles ===== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f4f7fb;
  scroll-behavior: smooth;
}

/* ===== Header Styles ===== */
header {
  background: linear-gradient(90deg, #0b66c3, #6c144a);
  color: #fff;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
}
header .left {
  display: flex;
  align-items: center;
  gap: 15px;
}
header img {
  height: 60px;
  width: 60px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(255,255,255,0.6);
}
header span {
  font-size: 1.3rem;
  font-weight: 600;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}
header .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
header button {
  background: #fff;
  color: #0b66c3;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}
header button:hover {
  background: #6c144a;
  color: #fff;
}

/* ===== Container and Cards ===== */
.container {
  max-width: 850px;
  margin: 25px auto;
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}
.button-card {
  width: 100%;
  background: linear-gradient(145deg, #e9f1fb, #ffffff);
  border: 2px solid #0b66c3;
  padding: 15px 20px;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: 0.3s;
  margin-top: 10px;
  text-align: left;
}
.button-card:hover {
  background: #0b66c3;
  color: #fff;
  transform: translateY(-2px);
}
.expand-box {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s ease;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  margin-top: 10px;
  padding: 0 10px;
}
.expand-box.active {
  max-height: 700px;
  opacity: 1;
  padding: 20px;
}

/* ===== Preview and Map ===== */
.preview {
  border: 4px solid #0b66c3;
  border-radius: 12px;
  background: #000;
  padding: 5px;
  box-shadow: 0 4px 12px rgba(157,129,129,0.3);
  text-align: center;
}
.preview img, .preview video {
  width: 100%;
  max-height: 500px;
  border-radius: 8px;
  border: none;
  display: block;
}
.map-box iframe {
  width: 100%;
  height: 400px;
  border: none;
  border-radius: 8px;
}

/* ===== Status & Footer ===== */
.status {
  margin-top: 15px;
  font-weight: bold;
  color: #d32f2f;
}
.status.connected { color: #2e7d32; }

footer {
  margin-top: 40px;
  text-align: center;
  color: #333;
  font-size: 14px;
  border-top: 1px solid #ccc;
  padding-top: 15px;
}

/* ===== Go Top Button ===== */
#goTopBtn {
  display: none;
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #0b66c3;
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: background 0.3s;
}
#goTopBtn:hover { background: #6c144a; }

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 25px;
  width: 360px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
  text-align: center;
}
.modal-content h3 { margin-top: 0; color: #0b66c3; }
.modal-content input {
  width: 100%;
  padding: 10px;
  margin: 10px 0 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
}
.modal-content button {
  margin: 5px;
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}
.save-btn { background: #0b66c3; color: #fff; }
.close-btn { background: #6c144a; color: #fff; }

/* ===== Login Page ===== */
body.login-page {
  background: linear-gradient(135deg, #0b66c3, #6c144a);
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #333;
}
.login-box {
  background: #fff;
  padding: 40px 30px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  width: 350px;
  text-align: center;
}
.login-box img {
  width: 80px;
  margin-bottom: 15px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
h2 { color: #0b66c3; margin-bottom: 10px; }
input {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 15px;
}
button {
  width: 100%;
  padding: 12px;
  background: #0b66c3;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
}
button:hover { background: #6c144a; }
footer {
  margin-top: 20px;
  font-size: 13px;
  color: #555;
}

.footer-banner {
  text-align: center;
  margin-bottom: 10px;
}
.footer-banner img {
  max-width: 300px;
  height: auto;
  display: inline-block;
}

/* Fix Stark Industries logo appearance on login page */
.login-box .footer-banner {
  margin-top: 25px;
}

.login-box .footer-banner img {
  width: 90%;
  max-width: 300px;
  border-radius: 0;
  box-shadow: none;
  display: block;
  margin: 0 auto;
}

/* === Dark Mode Theme === */
body, .container, .login-box {
  background-color: #0e0e0e !important;
  color: #e0e0e0 !important;
}

header {
  background: linear-gradient(90deg, #111d2c, #2a0a1f) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(255,255,255,0.1);
}

.button-card {
  background: linear-gradient(145deg, #1a1a1a, #2b2b2b) !important;
  color: #e0e0e0 !important;
  border: 1px solid #3a3a3a !important;
}

.button-card:hover {
  background: #0b66c3 !important;
  color: #fff !important;
}

.preview {
  background: #000 !important;
  border: 2px solid #0b66c3 !important;
}

.expand-box {
  background: #181818 !important;
  box-shadow: 0 0 10px rgba(255,255,255,0.1) !important;
}

footer {
  border-top: 1px solid #333 !important;
  color: #aaa !important;
  background: transparent !important;
}

#goTopBtn {
  background: #0b66c3 !important;
  color: #fff !important;
}

#goTopBtn:hover {
  background: #6c144a !important;
}

input, button {
  background: #1f1f1f !important;
  color: #f0f0f0 !important;
  border: 1px solid #444 !important;
}

.modal-content {
  background: #141414 !important;
  color: #eee !important;
  box-shadow: 0 4px 12px rgba(255,255,255,0.15);
}

.status {
  color: #f06292 !important;
}
.status.connected {
  color: #81c784 !important;
}

.footer-banner img {
  filter: brightness(1.2);
}
