/* Reset & base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: #f9fafb;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  background-color: lightgrey;
  color: black;
  position: relative;
  height: 5rem;
  flex-shrink: 0;
}
.header-container {
  width: 100%;
  margin: 0;
  padding: 0 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.header-title {
  font-size: 2rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 0.5rem;
  margin-right: 0;
  position: static;
  line-height: 5rem;
}

/* Desktop menu (button style) */
.desktop-menu {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  position: static;
  margin-right: 0.5rem;
}
.desktop-menu > .menu-link,
.desktop-menu > .user-dropdown > .menu-link {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  border-radius: 0.5rem;
  transition: transform 0.08s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  line-height: 1;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

/* Login button (desktop) */
.login-desktop {
  background-color: #888;
  color: #fff;
}
.login-desktop:hover {
  background-color: #111;
  box-shadow: 0 6px 10px rgba(51,51,51,0.12);
}

/* Register button (desktop) */
.register-desktop {
  background-color: #fff;
  color: black;
  border-color: rgba(37,99,235,0.15);
}
.register-desktop:hover {
  background-color: #000;
  color: #fff;
  box-shadow: 0 6px 10px rgba(255,204,204,0.12);
}

/* Calendars button (desktop) */
.calendars-desktop {
  background-color: #3498db;
  color: #fff;
}
.calendars-desktop:hover {
  background-color: #2980b9;
  box-shadow: 0 6px 10px rgba(52, 152, 219, 0.25);
}

/* Mobile menu button (hamburger) */
.menu-toggle {
  background: none;
  border: none;
  color: black;
  font-size: 1.5rem;
  display: none; /* hidden by default (shown only on mobile) */
  cursor: pointer;
  margin-left: auto;
}

/* MOBILE MENU (default hidden everywhere) */
.mobile-menu {
  display: none;
}

/* ---------------- MOBILE VIEW ---------------- */
@media (max-width: 767px) {
  /* Hide desktop buttons */
  .desktop-menu {
    display: none;
  }

  /* Show hamburger */
  .menu-toggle {
    display: block;
  }

  /* Mobile dropdown styles */
    .mobile-menu {
      display: flex;
      flex-direction: column;
      background-color: #374151; /* gray-700 backdrop */
      overflow: hidden;
      max-height: 0;
      opacity: 0;
      transition:
        max-height 0.3s cubic-bezier(.2,.9,.2,1),
        opacity 0.25s ease;
      padding: 0 1rem;
      position: absolute;
      top: 100%;
      right: 0;
      width: 200px;
      z-index: 100;
      border-radius: 0 0 0.75rem 0.75rem;
    }

  .mobile-menu.open {
    display: flex !important;
    max-height: 240px;
    opacity: 1;
    padding: 0.5rem 1rem 0.75rem 1rem;
  }

  /* Mobile menu links (grey text + hover effect) */
  .mobile-menu .mobile-link {
    color: #e5e7eb; /* gray-200 */
    text-decoration: none;
    padding: 0.75rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 600;
    border-radius: 0.5rem;
    transition:
      background-color 0.15s ease,
      color 0.15s ease,
      box-shadow 0.12s ease;
    cursor: pointer;
  }
  .mobile-menu .mobile-link:hover,
  .mobile-menu .mobile-link:focus {
    background-color: #4b5563; /* gray-600 highlight */
    color: #ffffff; /* white for contrast */
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  }

  /* Visible focus outline for keyboard users */
  .mobile-menu .mobile-link:focus-visible {
    outline: 2px solid rgba(255,255,255,0.12);
    outline-offset: 2px;
  }
}

/* Main Content Area */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Footer */
footer {
  background-color: #1f2937;
  color: #e5e7eb;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
  flex-shrink: 0;
}

/* Three Column Layout */
.three-column-layout {
  display: flex;
  gap: 1.5rem;
  padding: 2rem 1rem;
  width: 100%;
  flex: 1;
}

.left-column {
  flex: 0 0 calc(25% - 1rem);
  min-width: 0;
}

.center-column {
  flex: 0 0 calc(50% - 0.5rem);
  min-width: 0;
}

.right-column {
  flex: 0 0 calc(25% - 1rem);
  min-width: 0;
}

/* Admin Roles Section */
.admin-roles-section {
  background-color: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-roles-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.admin-roles-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 2px solid #9ca3af;
  border-radius: 0.5rem;
  overflow: hidden;
}

.admin-roles-table thead {
  background-color: #f3f4f6;
}

.admin-roles-table th {
  padding: 0.75rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-roles-table th:not(:last-child) {
  border-right: 1px solid #9ca3af;
}

.admin-role-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.admin-role-row:hover {
  background-color: #f9fafb;
}

.admin-role-row.active {
  background-color: #dbeafe;
}

.admin-role-row:not(:last-child) td {
  border-bottom: 1px solid #9ca3af;
}

.admin-roles-table td {
  padding: 0.75rem;
  font-size: 0.95rem;
}

.admin-roles-table td:not(:last-child) {
  border-right: 1px solid #9ca3af;
}

.role-type-cell {
  color: #6b7280;
  font-weight: 600;
}

.role-name-cell {
  color: #1f2937;
  font-weight: 500;
}

.no-roles {
  color: #6b7280;
  font-size: 0.95rem;
  font-style: italic;
  padding: 0.75rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  text-align: center;
}

/* Login Prompt */
.login-prompt {
  background-color: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-prompt h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.login-prompt p {
  color: #6b7280;
  font-size: 0.95rem;
}

.login-prompt a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.login-prompt a:hover {
  text-decoration: underline;
}

/* Welcome Message */
.welcome-message {
  background-color: white;
  border-radius: 0.75rem;
  padding: 2.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.welcome-message h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
}

.welcome-message p {
  color: #6b7280;
  font-size: 1.1rem;
  line-height: 1.6;
}

.welcome-message a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.welcome-message a:hover {
  text-decoration: underline;
}

/* Role Details Container */
.role-details-container {
  background-color: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 300px;
}

.select-role-message {
  color: #6b7280;
  font-size: 1rem;
  text-align: center;
  padding: 2rem;
  font-style: italic;
}

.role-details-card {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.role-details-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.role-details-type {
  display: inline-block;
  background-color: #2563eb;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.role-details-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 1rem;
  color: #1f2937;
  padding: 0.5rem;
  background-color: #f9fafb;
  border-radius: 0.375rem;
  border-left: 3px solid #2563eb;
}

/* Responsive adjustments for three-column layout */
@media (max-width: 1024px) {
  .three-column-layout {
    flex-direction: column;
  }
  
  .left-column,
  .center-column,
  .right-column {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* Authentication Pages */
.header-title-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 2rem 1rem;
}

.auth-card {
  background-color: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #1f2937;
  font-size: 1.5rem;
}

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

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
  font-size: 0.95rem;
}

.form-group input {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  flex: 1;
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: #2563eb;
}

.password-toggle:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.form-group small {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  margin-top: 0.5rem;
}

.btn-primary {
  background-color: #2563eb;
  color: white;
}

.btn-primary:hover {
  background-color: #1d4ed8;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

.btn-primary:active {
  background-color: #1e40af;
}

.btn-submit {
  background-color: #2563eb;
  color: white;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  margin-top: 0.5rem;
}

.btn-submit:hover {
  background-color: #1d4ed8;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

.btn-submit-large {
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
}

.btn-cancel {
  background-color: #6b7280;
  color: white;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  margin-top: 0.5rem;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.btn-cancel:hover {
  background-color: #4b5563;
  box-shadow: 0 4px 8px rgba(107, 114, 128, 0.2);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}

.form-actions .btn {
  width: auto;
  margin-top: 0;
  flex: 1 1 0;
}

.error-message {
  color: #dc2626;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: #fee2e2;
  border-left: 3px solid #dc2626;
  border-radius: 0.25rem;
}

.messages {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: #6b7280;
}

.auth-footer a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.username {
  color: #1f2937;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
}

/* User dropdown */
.user-dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  background-color: #888;
  color: #fff;
  border: 1px solid transparent;
}

.dropdown-toggle:hover {
  background-color: #111;
  box-shadow: 0 6px 10px rgba(51,51,51,0.12);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  z-index: 1000;
  display: none !important;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.dropdown-menu.show {
  display: flex !important;
}

.dropdown-item {
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.15s ease;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  display: block;
}

.dropdown-item:hover {
  background-color: #f3f4f6;
}

.dropdown-item.logout-item {
  color: #ef4444;
  border-top: 1px solid #e5e7eb;
}

.dropdown-item.logout-item:hover {
  background-color: #fee2e2;
}

/* Edit Account button (desktop) */
.edit-account-desktop {
  background-color: #2563eb;
  color: #fff;
}
.edit-account-desktop:hover {
  background-color: #1d4ed8;
  box-shadow: 0 6px 10px rgba(37, 99, 235, 0.2);
}

.logout-desktop {
  background-color: #ef4444;
  color: #fff;
}

.logout-desktop:hover {
  background-color: #991b1b;
  box-shadow: 0 6px 10px rgba(239, 68, 68, 0.2);
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  z-index: 1000;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  min-height: 50px;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
  margin-top: 0.25rem;
  display: none;
  box-sizing: border-box;
}

.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: white;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  color: #1f2937;
  display: block;
  transition: background-color 0.15s ease;
}

.search-result-item:hover {
  background-color: #f9fafb;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item.no-results {
  cursor: default;
  color: #6b7280;
  font-style: italic;
}

.search-result-item.no-results:hover {
  background-color: white;
}

.search-result-item strong {
  color: #1f2937;
  font-weight: 600;
}

.search-result-item small {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Admin Assignment Form */
.admin-assignment-form {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
}

.admin-assignment-form h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

/* Two-column layout for group search and add button */
.group-assignment-container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.group-search-column {
  min-width: 0; /* Prevents overflow issues */
}

.group-add-column {
  display: flex;
  align-items: flex-start;
  padding-top: 1.8rem; /* Aligns with the input field */
}

#add-group-btn {
  white-space: nowrap;
  padding: 0.75rem 1.25rem;
  background-color: #059669;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

#add-group-btn:hover {
  background-color: #047857;
  transform: translateY(-1px);
}

#add-group-btn:active {
  transform: translateY(0);
}

#assign-admin-btn {
  width: 50%;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.admin-assignment-form .form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.admin-assignment-form .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
  font-size: 0.95rem;
}

.admin-assignment-form .form-group input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-assignment-form .form-group input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.selected-group {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background-color: #dbeafe;
  border-radius: 0.5rem;
  border-left: 3px solid #2563eb;
  font-size: 0.95rem;
  color: #1f2937;
}

.selected-group strong {
  color: #1e40af;
}

/* Place Edit Form */
.place-edit-form {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
}

.place-edit-form h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.place-assignment-container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center; /* vertically center search field and button */
  margin-bottom: 1.5rem;
}

.place-search-column {
  min-width: 0;
}

.place-add-column {
  display: flex;
  align-items: center;
  padding-top: 0; /* remove manual offset so centering works */
}

#add-place-btn {
  white-space: nowrap;
  padding: 0.75rem 1.25rem;
  background-color: #059669;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

#add-place-btn:hover {
  background-color: #047857;
  transform: translateY(-1px);
}

#add-place-btn:active {
  transform: translateY(0);
}

.place-messages {
  margin-bottom: 1rem;
  display: none;
}

.form-messages {
  margin-bottom: 1rem;
  display: none;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

.message-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.message-success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Resign Admin Section */
.resign-admin-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.resign-admin-link {
  color: #dc2626;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.resign-admin-link:hover {
  color: #991b1b;
  text-decoration: underline;
}

/* Resign Modal */
.resign-modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.resign-modal.show {
  opacity: 1;
}

.resign-modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.resign-modal.show .resign-modal-content {
  transform: scale(1);
}

.resign-modal-content h3 {
  font-size: 1.25rem;
  color: #1f2937;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.resign-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.resign-modal-buttons-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: stretch;
}

.btn-resign {
  background-color: #16a34a;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: auto;
}

.btn-resign:hover {
  background-color: #15803d;
  box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
}

.btn-resign:active {
  background-color: #166534;
}

.btn-resign-delete {
  background-color: #b91c1c;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: auto;
}

.btn-resign-delete:hover {
  background-color: #7f1d1d;
  box-shadow: 0 4px 8px rgba(185, 28, 28, 0.3);
}

.btn-resign-delete:active {
  background-color: #450a0a;
}

.btn-cancel {
  background-color: #6b7280;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: auto;
}

.btn-cancel:hover {
  background-color: #4b5563;
  box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.btn-cancel:active {
  background-color: #374151;
}

.btn-delete {
  background-color: #dc2626;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: auto;
}

.btn-delete:hover {
  background-color: #b91c1c;
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.btn-delete:active {
  background-color: #991b1b;
}

/* Add Group Modal */
.add-group-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.add-group-modal.show {
  opacity: 1;
}

.add-group-modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.add-group-modal.show .add-group-modal-content {
  transform: scale(1);
}

.add-group-modal-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-form-group {
  margin-bottom: 1.5rem;
}

.modal-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
  font-size: 0.95rem;
}

.modal-form-group input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-form-group input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.add-group-form-messages {
  margin-bottom: 1rem;
  display: none;
}

.add-group-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-create {
  background-color: #059669;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: auto;
}

.btn-create:hover {
  background-color: #047857;
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

.btn-create:active {
  background-color: #065f46;
}

/* Edit Group Section */
.edit-group-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
}

.edit-group-btn {
  background-color: #2563eb;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  width: 50%;
}

.edit-group-btn:hover {
  background-color: #1d4ed8;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.edit-group-btn:active {
  background-color: #1e40af;
}

/* Add Group Admin Section */
.add-group-admin-section {
  margin-top: 0;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.add-group-admin-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
  text-align: center;
}

.add-group-admin-section .form-group {
  margin-bottom: 1rem;
}

.add-group-admin-section .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
  font-size: 0.95rem;
}

.add-group-admin-section .form-group input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.add-group-admin-section .form-group input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#add-group-admin-btn {
  width: 50%;
  margin-left: auto;
  margin-right: auto;
  display: block;
  background-color: #2563eb;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

#add-group-admin-btn:hover {
  background-color: #1d4ed8;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

#add-group-admin-btn:active {
  background-color: #1e40af;
}

.group-admin-messages {
  margin-bottom: 1rem;
}

.group-admin-messages .message {
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.group-admin-messages .message-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.group-admin-messages .message-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.edit-calendar-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
}

.edit-calendar-btn {
  background-color: #2563eb;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  width: 50%;
}

.edit-calendar-btn:hover {
  background-color: #1d4ed8;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.edit-calendar-btn:active {
  background-color: #1e40af;
}

.create-event-section {
  margin-top: 0;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
}

.create-event-btn {
  background-color: #16a34a;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  width: 50%;
}

.create-event-btn:hover {
  background-color: #15803d;
  box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
}

.create-event-btn:active {
  background-color: #166534;
}

/* Edit Group Modal */
.edit-group-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.edit-group-modal.show {
  opacity: 1;
}

.edit-group-modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.edit-group-modal.show .edit-group-modal-content {
  transform: scale(1);
}

.edit-group-modal-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-form-group select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-form-group input[type="url"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-form-group input[type="url"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-form-group small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
}

.edit-group-form-messages {
  margin-bottom: 1rem;
  display: none;
}

.edit-group-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.edit-group-modal-buttons .btn-create,
.edit-group-modal-buttons .btn-cancel {
  flex: 1;
  max-width: 150px;
}

/* Edit Calendar Modal */
.edit-calendar-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.edit-calendar-modal.show {
  opacity: 1;
}

.edit-calendar-modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.edit-calendar-modal.show .edit-calendar-modal-content {
  transform: scale(1);
}

.edit-calendar-modal-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  text-align: center;
}

.edit-calendar-form-messages {
  margin-bottom: 1rem;
  display: none;
}

.edit-calendar-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.edit-calendar-modal-buttons .btn-create,
.edit-calendar-modal-buttons .btn-cancel {
  flex: 1;
  max-width: 150px;
}

/* Calendar Groups Management Section */
.calendar-groups-management {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.groups-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.calendar-groups-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 2rem;
}

.calendar-groups-table thead {
  background-color: #f3f4f6;
}

.calendar-groups-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

.calendar-groups-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.calendar-groups-table tbody tr:hover {
  background-color: #f9fafb;
}

.btn-remove-calendar-group {
  padding: 0.375rem 0.75rem;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
}

.btn-remove-calendar-group:hover {
  background-color: #dc2626;
}

.no-groups-message {
  text-align: center;
  color: #9ca3af;
  padding: 2rem;
  font-style: italic;
}

.add-group-to-calendar-section {
  background-color: white;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.add-group-to-calendar-section h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.add-group-search-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.add-group-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.add-group-search-results {
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  max-height: 250px;
  overflow-y: auto;
  background-color: white;
  margin-top: 0.5rem;
}

.search-result-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background-color: #f3f4f6;
}

.search-result-item.selected {
  background-color: #e0f2fe;
  border-left: 4px solid #0ea5e9;
  padding-left: calc(1rem - 4px);
}

.search-result-item:last-child {
  border-bottom: none;
}

.selected-group-display {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.selected-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 0.375rem;
}

.selected-group-name {
  font-weight: 600;
  color: #166534;
  flex-grow: 1;
}

.btn-add-group {
  padding: 0.5rem 1rem;
  background-color: #22c55e;
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.2s ease;
  margin-left: 1rem;
}

.btn-add-group:hover {
  background-color: #16a34a;
}

.no-results,
.error {
  padding: 1rem;
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

.error {
  color: #ef4444;
}

/* Calendar Groups Styles - Old modal styles (deprecated) */
.calendar-groups-list {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  background-color: #f9fafb;
  margin-bottom: 1.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.calendar-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

.calendar-group-item .group-name {
  font-weight: 500;
  color: #374151;
  flex-grow: 1;
}

.calendar-group-item .btn-remove-group {
  padding: 0.375rem 0.75rem;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
}

.calendar-group-item .btn-remove-group:hover {
  background-color: #dc2626;
}

.no-groups {
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

.add-group-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.add-group-section label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

#add-group-search {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

#group-search-results {
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  max-height: 200px;
  overflow-y: auto;
  background-color: white;
}

.search-result-item {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background-color: #f3f4f6;
}

.search-result-item:last-child {
  border-bottom: none;
}

.no-results,
.error {
  padding: 1rem;
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

.error {
  color: #ef4444;
}

/* Events Table */
.group-events-container {
  margin-top: 2rem;
}

.events-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.loading-message,
.no-events-message {
  color: #6b7280;
  font-style: italic;
  padding: 1rem;
  text-align: center;
}

.events-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
}

.events-table thead {
  background-color: #f9fafb;
}

.events-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
}

.events-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.875rem;
  color: #1f2937;
}

.events-table tbody tr:last-child td {
  border-bottom: none;
}

.events-table tbody tr:hover {
  background-color: #f9fafb;
}

.event-title-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.event-title-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Edit Event Modal */
.edit-event-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.edit-event-modal.show {
  opacity: 1;
}

.edit-event-modal-content {
  background-color: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  position: relative;
}

.edit-event-modal-content .modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.edit-event-modal-content .modal-close-btn:hover {
  background-color: #f3f4f6;
  color: #1f2937;
}

.edit-event-modal.show .edit-event-modal-content {
  transform: scale(1);
}

.edit-event-modal-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  text-align: center;
}

.edit-event-form-messages {
  margin-bottom: 1rem;
  display: none;
}

.edit-event-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.edit-event-button-group-left {
  display: flex;
  gap: 1rem;
}

.edit-event-button-group-right {
  display: flex;
  gap: 1rem;
}

.edit-event-modal-buttons .btn-create,
.edit-event-modal-buttons .btn-cancel,
.edit-event-modal-buttons .btn-delete {
  flex: 1;
  min-width: 120px;
  white-space: nowrap;
}

.modal-form-group input[type="date"],
.modal-form-group input[type="time"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Date picker wrapper with visible UK-format text plus native date input trigger */
.date-picker-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.date-picker-wrapper input[type="text"] {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.calendar-trigger {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.calendar-trigger:hover {
  background: #e9eef7;
}

/* Position the native date input over the calendar trigger so the popup opens nearby */
.date-picker-wrapper {
  position: relative;
}

.date-picker-wrapper input[type="date"] {
  position: absolute;
  right: 0.6rem; /* aligns roughly under the trigger button */
  top: 0.25rem;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: none;
  opacity: 0;
  background: transparent;
}

.modal-form-group input[type="date"]:focus,
.modal-form-group input[type="time"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.required {
  color: #dc2626;
  font-weight: bold;
}

/* Add Place Modal */
.add-place-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.add-place-modal.show {
  opacity: 1;
}

.add-place-modal-content {
  background-color: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  position: relative;
}

.add-place-modal-content .modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.add-place-modal-content .modal-close-btn:hover {
  background-color: #f3f4f6;
  color: #1f2937;
}

.add-place-modal.show .add-place-modal-content {
  transform: scale(1);
}

.add-place-modal-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  text-align: center;
}

.add-place-form-messages {
  margin-bottom: 1rem;
  display: none;
}

.add-place-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.add-place-modal-buttons .btn-create,
.add-place-modal-buttons .btn-cancel {
  flex: 1;
  max-width: 200px;
  white-space: nowrap;
}

/* Edit Place Modal */
.edit-place-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.edit-place-modal.show {
  opacity: 1;
}

.edit-place-modal-content {
  background-color: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  position: relative;
}

.edit-place-modal-content .modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.edit-place-modal-content .modal-close-btn:hover {
  background-color: #f3f4f6;
  color: #1f2937;
}

.edit-place-modal.show .edit-place-modal-content {
  transform: scale(1);
}

.edit-place-modal-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  text-align: center;
}

.edit-place-form-messages {
  margin-bottom: 1rem;
  display: none;
}

.edit-place-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.edit-place-modal-buttons .btn-create,
.edit-place-modal-buttons .btn-cancel {
  flex: 1;
  max-width: 200px;
  white-space: nowrap;
}

.modal-form-group input[type="url"],
.modal-form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.modal-form-group input[type="url"]:focus,
.modal-form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-form-group input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}

.modal-form-group label input[type="checkbox"] {
  display: inline-block;
}
/* Poster Upload Modal */
/* Poster controls layout */
.poster-controls {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.poster-preview {
  flex: 0 0 auto;
  min-height: 50px;
}

.poster-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.poster-buttons .btn {
  width: auto;
  min-width: 100px;
  max-width: 150px;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Logo controls layout (mirrors poster controls) */
.logo-controls {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.logo-preview {
  flex: 0 0 auto;
  min-height: 50px;
}

.logo-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.logo-buttons .btn {
  width: auto;
  min-width: 100px;
  max-width: 150px;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.poster-upload-modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.poster-upload-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.poster-upload-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.poster-upload-modal-content {
  position: relative;
  z-index: 2;
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  width: auto;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.poster-upload-modal.show .poster-upload-modal-content {
  transform: scale(1);
}

#poster-upload-form-container {
  width: 100%;
  overflow-y: auto;
  max-height: 90vh;
}

#poster-upload-form-container .modal-container {
  max-height: none;
  overflow: visible;
}

/* Postcode input with Locate button */
.postcode-group .postcode-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.postcode-group .postcode-input-row input {
  flex: 1;
}

.btn-locate {
  padding: 0.75rem 1rem;
  background-color: #059669;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.btn-locate:hover {
  background-color: #047857;
}

.btn-locate:active {
  background-color: #065f46;
}

/* Readonly inputs styling */
.modal-form-group input[readonly] {
  background-color: #f3f4f6;
  cursor: not-allowed;
  color: #6b7280;
}

/* Locate Modal - similar to poster upload modal */
.locate-modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.locate-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.locate-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.locate-modal-content {
  position: relative;
  z-index: 2;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 700px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.locate-modal.show .locate-modal-content {
  transform: scale(1);
}

#locate-form-container {
  width: 100%;
}

#locate-form-container .modal-container {
  min-height: auto;
  max-height: none;
  overflow: visible;
  border-radius: 8px;
}

#locate-form-container .map-container {
  min-height: 280px;
  height: 280px;
  max-height: 320px;
}

/* Place modal - coordinates display and location section */
.coords-display-group .coords-display-row {
  display: flex;
  gap: 2rem;
  padding: 0.5rem 0;
}

.coords-display-group .coord-text {
  font-size: 0.95rem;
  color: #374151;
}

.coords-display-group .coord-text span {
  font-family: monospace;
  font-weight: 600;
  color: #1f2937;
}

.location-section {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  align-items: flex-start;
}

.location-map-container {
  flex: 1;
  min-height: 150px;
  height: 150px;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #f9fafb;
}

.location-map-container .map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9ca3af;
  font-size: 0.875rem;
  text-align: center;
  padding: 1rem;
}

.location-button-container {
  display: flex;
  align-items: flex-start;
}

.btn-locate-large {
  padding: 0.75rem 1.5rem;
  background-color: #059669;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.btn-locate-large:hover {
  background-color: #047857;
}

.btn-locate-large:active {
  background-color: #065f46;
}

/* ===================== Invite Modal Styles ===================== */

.invite-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.invite-modal.show {
  opacity: 1;
}

.invite-modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  position: relative;
}

.invite-modal.show .invite-modal-content {
  transform: scale(1);
}

.invite-modal-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  text-align: center;
}

.invite-modal-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
}

.invite-form-messages {
  margin-bottom: 1rem;
  display: none;
}

.invite-group-display {
  padding: 0.75rem;
  background-color: #f3f4f6;
  border-radius: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.invite-methods {
  margin-top: 1.5rem;
}

.invite-method {
  padding: 1.5rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.invite-method-desc {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.invite-method-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
}

.invite-method-divider span {
  background-color: white;
  padding: 0 1rem;
  color: #9ca3af;
  font-weight: 600;
  font-size: 0.875rem;
}

.invite-method-divider::before,
.invite-method-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: #e5e7eb;
}

.qr-code-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background-color: white;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border: 1px dashed #d1d5db;
}

.qr-placeholder, .qr-not-available {
  color: #9ca3af;
  text-align: center;
  padding: 2rem;
}

.qr-code-image {
  max-width: 200px;
  height: auto;
}

.invite-url-container {
  margin-bottom: 1rem;
}

.invite-url-container label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
  font-size: 0.9rem;
}

.invite-url-row {
  display: flex;
  gap: 0.5rem;
}

.invite-url-row input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: #f9fafb;
}

.btn-small {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background-color: #6b7280;
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-small:hover {
  background-color: #4b5563;
}

.invite-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* User input row with invite button */
.user-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.user-input-narrow {
  /* Make the text input take the majority of the row while remaining responsive */
  flex: 1 1 70%;
  min-width: 0;
  max-width: calc(100% - 120px);
}

.btn-invite {
  /* Keep the button a fixed, narrower width so it doesn't dominate the row */
  flex: 0 0 120px;
  white-space: nowrap;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}

/* Modal close button */
.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: #374151;
}

/* Email input styling in invite modal */
.invite-method input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.invite-method input[type="email"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}