/* Styling for the loading message and spinner */
#loading-message {
  display: none;
  text-align: center;
  font-size: 18px;
  color: #6d309b;
  margin-top: 10px;
}

/* General Styles */
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  color: #fff;
}

/* Login Page Styles */
body.login-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #6d309b, #341e5f);
}

/* Header for Login Page */
body.login-page header {
  position: absolute;
  top: 0;
  width: 100%;
  text-align: center;
  padding: 10px 20px;
  background-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.login-page header .left-header h1 {
  margin: 0;
  font-size: 24px;
  color: #fff;
}

/* Login Container */
#login-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  width: 350px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#login-container img {
  width: 200px;
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
}

#login-container h1 {
  margin: 0;
  margin-bottom: 20px;
  font-size: 24px;
  color: #6d309b;
}

#login-container input,
#login-container button {
  width: 75%;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  font-size: 16px;
  box-sizing: border-box;
}

#login-container input {
  border: 1px solid #341e5f;
}

#login-container button {
  border: none;
  background: #189053;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
}

#login-container button:hover {
  background: #341e5f;
}

#error-msg {
  color: red;
  margin-top: 10px;
  font-size: 14px;
}

#loading-msg {
  color: #ff0000;
  margin-top: 10px;
  display: none;
  font-size: 16px;
  font-weight: bold;
}

/* Header Logo Styling */
.header-logo {
  max-width: 130px;
  height: auto;
  display: block;
}

/* General Header Styles */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background-color: #6d309b;
  color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .left-header h1 {
  margin: 0;
  font-size: 24px;
}

header .right-header button {
  background-color: #ffffff;
  color: #6d309b;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

header .right-header button:hover {
  background-color: #ff0000;
}

/* Dashboard Page Layout */
body.dashboard-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #f5f5f5;
}

/* Main Container Layout */
body.dashboard-page #main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Menu Sidebar */
body.dashboard-page #menu {
  width: 160px;
  background-color: #341e5f;
  color: #fff;
  padding: 0px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

/* Menu Styles */
body.dashboard-page #menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

body.dashboard-page #menu ul li {
  padding: 4px;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

body.dashboard-page #menu ul li a {
  display: block;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  padding: 10px 20px;
  transition: color 0.3s;
  border-radius: 10px;
  box-sizing: border-box;
}

body.dashboard-page #menu ul li a:hover {
  color: #24ef8a;
}

body.dashboard-page #menu ul li.active {
  background-color: #189053;
}

body.dashboard-page #menu ul li.active a {
  color: white;
}

/* Dashboard Content */
body.dashboard-page #dashboard-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #fff;
  color: #333333;
  border-radius: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin: 12px;
}

/* Doctor table */
#doctor-table {
  width: 100%;
  max-width: 600px;
  border-collapse: collapse;
  margin-top: 20px;
  margin-right: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  table-layout: auto;
}

#doctor-table th,
#doctor-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
  word-wrap: break-word;
}

#doctor-table th {
  background-color: #6d309b;
  color: #fff;
  font-weight: bold;
}

#doctor-table tbody {
  display: block;
  max-height: calc(10 * 40px);
  overflow-y: auto;
  overflow-x: hidden;
}

#doctor-table thead,
#doctor-table tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

#doctor-table tbody::-webkit-scrollbar {
  width: 6px;
}

#doctor-table tbody::-webkit-scrollbar-thumb {
  background-color: #6d309b;
  border-radius: 4px;
}

#schedule-url {
  display: none;
}

/* Label styling */
.form-row .label {
  font-size: 24px;
  color: #6d309b;
  margin-bottom: 8px;
  font-weight: bold;
}

/* Styling for the container of the two input fields */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Styling for each input field inside the .form-row */
.form-row .input {
  padding: 12px;
  border-radius: 5px;
  border: 1px solid #189053;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
}

.form-row .input:focus {
  border-color: #6d309b;
  outline: none;
  box-shadow: 0 0 3px rgba(69, 22, 106, 0.3);
}

/* Radio button styling */
.form-row .control {
  display: flex;
  gap: 50px;
  margin-top: 10px;
}

/* Radio button label styling */
.form-row .radio {
  font-size: 18px;
  color: #6d309b;
}

@media (min-width: 768px) {
  .form-row {
    flex-wrap: nowrap;
  }

  .form-row .input {
    width: 68%;
  }

  .dob-control {
    width: 48%;
  }
}

@media (min-width: 1024px) {
  .form-row .input {
    width: 30%;
  }

  .dob-control {
    width: 30%;
  }
}

.dob-control .input {
  width: 100%;
}

/* Style for the hint text */
.hint {
  font-size: 15px;
  color: #6d309b;
  margin-top: 4%;
}

/* Style for the button container */
.form-group {
  display: flex;
  justify-content: flex-start;
  gap: 15px;
  margin-top: 20px;
}

/* General button styles */
.button {
  padding: 12px 55px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Roboto', sans-serif;
  font-weight: bold;
}

/* Primary button styles */
.button.is-primary {
  background-color: #189053;
  color: #fff;
}

.button.is-primary:hover {
  background-color: #23d47c;
}

/* Danger button styles */
.button.is-danger {
  background-color: #d61610;
  color: #fff;
}

.button.is-danger:hover {
  background-color: #e55853;
}

/* Disabled state */
.button:disabled {
  background-color: #ddd;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

.divider {
  border-top: 1px solid #ddd;
  margin: 10px 0;
}

.box {
  padding: 10px;
}

.colored-heading2 {
  color: #189053;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
}

.colored-heading2 {
  position: relative;
  background-color: #6d309b;
  color: white;
  padding: 10px 20px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 20px;
  display: inline-block;
  margin-right: 10px;
  border: 2px solid #6d309b;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.colored-heading3 {
  color: #6d309b;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}

/* Loading Messages */
.message {
  display: none;
  padding: 10px;
  margin-top: 10px;
  border-radius: 5px;
  color: white;
  text-align: center;
  font-weight: bold;
  transition: opacity 0.5s ease;
}

.loading {
  background-color: #aa4df2;
  font-size: 16px;
}

.success {
  background-color: green;
  color: beige;
}

.error {
  background-color: red;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #189053;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Logout */
.logout-btn {
  font-size: 28px;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  position: relative;
  transition: color 0.3s;
  cursor: pointer;
}

.logout-btn i {
  margin-right: 8px;
  transition: color 0.3s;
}

.popup-text {
  visibility: hidden;
  position: absolute;
  top: 0px;
  left: 180%;
  transform: translateX(-50%);
  color: #ff0000;
  background-color: #f5eff9;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  white-space: nowrap;
}

.logout-btn:hover i {
  color: #ff0000;
}

.logout-btn:hover .popup-text {
  visibility: visible;
  opacity: 1;
}

/* Table columns width */
.col-1 { width: 175px; }
.col-2 { width: 100px; }
.col-3 { width: 100px; }
.col-4 { width: 20px; }

/* Appointment status */
.status {
  padding: 5px 10px;
  text-align: center;
  border-radius: 5px;
  color: white;
}

.confirmed {
  background-color: #189053;
}

.waiting {
  background-color: #e59e35;
}

.default {
  background-color: #cccccc;
}

.flex-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 110px;
}

.table-hint {
  color: #02592e;
  margin-top: 15px;
  margin-right: 20px;
  font-size: larger;
  border: 2px solid #6d309b;
  border-radius: 15px;
  padding: 10px 15px;
  display: inline-block;
}

.lastUpdate-hint {
  color: #e59e35;
  margin-top: 15px;
  margin-right: 20px;
  font-size: large;
  border: 2px solid #6d309b;
  border-radius: 15px;
  padding: 10px 15px;
  display: inline-block;
  max-width: 150px;
}

/* =========================================================
   HEADER / MOBILE MENU
   ========================================================= */

.header-right {
  order: 1;
  display: flex;
  align-items: center;
}

.header-center {
  order: 2;
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.header-center h3 {
  margin: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-left,
.header-actions {
  order: 3;
  display: flex;
  align-items: center;
  gap: 14px;
}

.left-header {
  display: flex;
  align-items: center;
}

.mobile-menu-btn {
  display: none;
  font-size: 22px;
  cursor: pointer;
  color: #fff;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  transition: background .2s ease;
}

.mobile-menu-btn:hover {
  background: rgba(255,255,255,.12);
}

.mobile-only {
  display: none !important;
}

.menu-divider {
  height: 1px;
  background: rgba(255,255,255,.18);
  margin: 10px 0;
  border-radius: 2px;
}

.menu-action-btn {
  width: 100%;
  border: none;
  background: #6d309b;
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  transition: opacity .2s ease;
}

.menu-action-btn:hover {
  opacity: .95;
}

.logout-menu-btn {
  background: #b91c1c;
}

/* =========================================================
   MOBILE LAYOUT
   ========================================================= */
@media (max-width: 768px) {
  body.dashboard-page {
    height: auto;
    min-height: 100vh;
  }

  header {
    padding: 10px 14px;
    gap: 10px;
  }

  .header-actions,
  .header-left {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex;
    order: 3;
  }

  .header-right {
    order: 1;
  }

  .header-center {
    order: 2;
  }

  .header-center h3 {
    font-size: 16px;
  }

  .header-logo {
    max-width: 105px;
  }

  body.dashboard-page #main-container {
    display: block;
    overflow: visible;
  }

  body.dashboard-page #menu {
    position: fixed;
    top: -100%;
    right: 0;
    width: 100%;
    max-height: 85vh;
    height: auto;
    z-index: 2000;
    padding: 0;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    transition: top .3s ease;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
  }

  body.dashboard-page #menu.show {
    top: 0;
  }

  body.dashboard-page #menu ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 12px 14px;
  }

  body.dashboard-page #menu ul li {
    padding: 0;
    width: 100%;
  }

  body.dashboard-page #menu ul li a {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
  }

  .mobile-only {
    display: block !important;
  }

  body.dashboard-page #dashboard-content {
    margin: 10px;
    padding: 14px;
    border-radius: 14px;
    overflow: visible;
  }

  .form-row {
    gap: 12px;
  }

  .form-row .input {
    width: 100% !important;
  }

  .form-group {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
  }

  .colored-heading2 {
    font-size: 18px;
    line-height: 1.4;
    text-align: center;
  }

  #doctor-table {
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    display: block;
    overflow-x: auto;
  }

  .table-hint,
  .lastUpdate-hint {
    margin-right: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .flex-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}