* {
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
}

body {
  font-size: 120%;
  background: #F8F8FF;
  overflow-x: hidden;
}

/* --- Responsive base --- */
img, video, iframe, table {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
} 

/* --- Header / Form / Content (fluid for mobile) --- */
.header {
  width: 100%;
  max-width: 500px;
  margin: 40px auto 0px;
  color: white;
  background: #5F9EA0;
  text-align: center;
  border: 1px solid #B0C4DE;
  border-bottom: none;
  border-radius: 10px 10px 0px 0px;
  padding: 20px;
}

form, .content {
  width: 90%;
  max-width: 500px;
  margin: 0px auto;
  padding: 20px;
  border: 1px solid #B0C4DE;
  background: white;
  border-radius: 0px 0px 10px 10px;
}

.input-group {
  margin: 10px 0px 10px 0px;
}

.input-group label {
  display: block;
  text-align: left;
  margin: 3px;
}

.input-group input {
  height: 30px;
  width: 100%;
  padding: 5px 10px;
  font-size: 16px;
  border-radius: 5px;
  border: 1px solid gray;
}

.btn {
  padding: 10px;
  font-size: 15px;
  color: white;
  background: #5F9EA0;
  border: none;
  border-radius: 5px;
  width: 100%;
}

.error {
  width: 92%;
  margin: 0px auto;
  padding: 10px;
  border: 1px solid #a94442;
  color: #a94442;
  background: #f2dede;
  border-radius: 5px;
  text-align: left;
}

.success {
  color: #3c763d;
  background: #dff0d8;
  border: 1px solid #3c763d;
  margin-bottom: 20px;
}

/* --- Logout Modal --- */
.logout-box {
  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: 999;
}

.logout-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  width: 90%;
  max-width: 300px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.logout-card h3 {
  margin-top: 0;
}

.logout-card button {
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  margin: 8px;
  cursor: pointer;
}

.yes-btn {
  background: #dc3545;
  color: white;
}

.no-btn {
  background: #6c757d;
  color: white;
}

/* --- Login Success Notification --- */
.login-success-box {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #28a745;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  font-weight: 600;
  max-width: 90%;
  animation: slideDown 0.5s, fadeOut 0.5s 3s forwards;
}

@keyframes slideDown {
  0% { transform: translateX(-50%) translateY(-50px); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* --- Nav links as cards/buttons --- */
nav a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  background: #007BFF;
  transition: 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: inline-block;
}

nav a:hover {
  background: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* --- Back Card --- */
.back-card {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 20px;
  text-align: left;
}

.back-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.back-home {
  text-decoration: none;
  color: #4a90e2;
  font-weight: bold;
  font-size: 0.95rem;
}

.back-home:hover {
  color: #357ABD;
}

/* --- TABLES (mobile scroll) --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  min-width: 600px;
}

/* --- MOBILE NAVIGATION --- */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    color: white;
}

/* --- RESPONSIVE MEDIA QUERIES --- */

/* Tablet and below */
@media screen and (max-width: 768px) {
    .header {
        width: 95%;
        max-width: 100%;
        margin: 20px auto 0px;
        padding: 15px;
    }

    form, .content {
        width: 95%;
        max-width: 100%;
        padding: 15px;
    }

    .input-group input {
        font-size: 16px;
        height: 40px;
    }

    .btn {
        font-size: 16px;
        padding: 12px;
        min-height: 44px;
    }

    nav a {
        display: block;
        text-align: center;
        margin-bottom: 6px;
    }

    .logout-card {
        width: 85%;
        padding: 20px;
    }

    .login-success-box {
        left: 10px;
        right: 10px;
        transform: none;
        text-align: center;
    }

    .table-responsive {
        margin: 0 -10px;
    }

    /* Make sure touch targets are large enough */
    button, a, input, select, textarea {
        min-height: 44px;
    }
}

/* Small phones */
@media screen and (max-width: 480px) {
    .header {
        width: 100%;
        max-width: 100%;
        margin: 10px auto 0px;
        padding: 12px;
        border-radius: 0px;
    }

    form, .content {
        width: 100%;
        max-width: 100%;
        margin: 0px auto;
        padding: 12px;
        border-radius: 0px;
        border: none;
        border-bottom: 1px solid #B0C4DE;
    }

    .input-group input {
        font-size: 16px;
        padding: 8px;
    }

    .btn {
        font-size: 15px;
        padding: 12px 10px;
        width: 100%;
    }

    .error {
        width: 100%;
    }

    .logout-card {
        width: 90%;
        padding: 15px;
    }

    .login-success-box {
        left: 0;
        right: 0;
        transform: none;
        text-align: center;
        border-radius: 0;
        max-width: 100%;
    }

    nav a {
        padding: 12px 10px;
        font-size: 14px;
    }

    /* Stack cards/logins vertically */
    .header {
        width: 100%;
        max-width: 100%;
        margin: 0px auto;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

/* --- Prevent horizontal scroll on body --- */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}