/* ========== GLOBAL STYLES ========== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  color: #eee;
  position: relative;
  z-index: 0;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ========== BACKGROUND IMAGE ========== */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url("background.jpg");
  background-repeat: repeat-x;
  background-size: calc(100vw / 3) 100vh;
  background-position: top left;
  filter: brightness(1.4);
  z-index: -2;
}

/* ========== OVERLAY ========== */
.overlay {
  background-color: rgba(0, 0, 0, 0.85);
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1;
}

/* ========== FORM BOX (All Screens) ========== */
.form-box {
  background-color: rgba(20, 20, 20, 0.9);
  padding: 2rem;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  width: 90%;
  max-width: 500px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}

.form-box h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 1rem;
  color: #fff;
}

.form-box form {
  display: flex;
  flex-direction: column;
}

.form-box label {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #ccc;
}

.form-box input,
.form-box select {
  width: 100%;
  padding: 0.8rem;
  margin-top: 0.3rem;
  border: none;
  border-radius: 8px;
  background-color: rgba(30, 30, 30, 0.9);
  color: #fff;
}

.form-box input::placeholder,
.form-box select:invalid {
  color: #aaa;
}

.form-box select option {
  color: #fff;
  background-color: #111;
}

.form-box button {
  margin-top: 1.5rem;
  padding: 0.8rem;
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.form-box button:hover {
  background-color: #005fa3;
}

/* ========== LINKS ========== */
.form-box .form-links {
  text-align: center;
  margin-top: 1rem;
}

.form-box .form-links a {
  color: #4db8ff;
  text-decoration: none;
  font-size: 0.9rem;
}

.form-box .form-links a:hover {
  text-decoration: underline;
}

/* ========== PASSWORD RULES ========== */
.password-rules {
  font-size: 0.85rem;
  color: #ccc;
  margin-top: 1rem;
  line-height: 1.4;
}

.password-rules ul {
  padding-left: 1rem;
}

.password-rules li::marker {
  color: #4db8ff;
}

/* ========== SUCCESS BOX ========== */
.success-box {
  background-color: rgba(20, 20, 20, 0.9);
  padding: 2rem;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  width: 90%;
  max-width: 400px;
  text-align: center;
  color: white;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}

.success-box h2 {
  margin-bottom: 1rem;
}

.success-box p {
  margin-bottom: 2rem;
}

.success-box button,
.styled-button {
  padding: 0.8rem 2rem;
  background-color: #0077cc;
  border: none;
  color: white;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.success-box button:hover,
.styled-button:hover {
  background-color: #005fa3;
}

/* ========== PROFILE PAGE EXTENSION ========== */
.profile-picture {
  text-align: center;
  margin-bottom: 1rem;
}

.profile-picture img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
}

.logout-btn {
  background-color: #cc0000;
}

.logout-btn:hover {
  background-color: #990000;
}

/* ========== DASHBOARD-SPECIFIC ONLY ========== */
.top-nav {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 1rem;
  z-index: 2;
}

.top-nav button {
  background-color: rgba(30, 30, 30, 0.8);
  border: 1px solid #555;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.top-nav button:hover {
  background-color: rgba(50, 50, 50, 0.8);
}

header {
  text-align: center;
  margin-top: 4rem;
  margin-bottom: 2rem;
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
  color: #fff;
}

.tagline {
  font-size: 1.2rem;
  color: #bbb;
}

/* Emergency Call Buttons */
.emergency-call-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.emergency-call {
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-weight: bold;
}

.emergency-call.saps {
  background-color: #cc0000;
}
.emergency-call.saps:hover {
  background-color: #990000;
}

.emergency-call.health {
  background-color: #009900;
}
.emergency-call.health:hover {
  background-color: #006600;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  width: 100%;
  max-width: 1200px;
}

.card {
  background-color: rgba(30, 30, 30, 0.9);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  backdrop-filter: blur(5px);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card h2 {
  margin-top: 0;
  color: #fff;
}

.card button {
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  border: none;
  background-color: #0077cc;
  color: white;
  border-radius: 8px;
  cursor: pointer;
}

.card button:hover {
  background-color: #005fa3;
}

/* ========== RESPONSIVE ========== */
@media screen and (max-width: 600px) {
  .form-box,
  .success-box {
    padding: 1.5rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .top-nav {
    flex-direction: column;
    align-items: flex-end;
    top: 0.5rem;
    right: 0.5rem;
  }

  .emergency-call-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
}
