/* CustomGPT Application Styles - Matching cub_scouts design */

/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  background: #f6f7fb;
  color: #1a1a1a;
}

/* Layout */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #111;
  color: #fff;
}

header h1 {
  font-size: 18px;
  margin: 0;
}

header h1 a {
  color: #fff;
  text-decoration: none;
}

header h1 a:hover,
header h1 a:focus,
header h1 a:active,
header h1 a:visited {
  color: #fff;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

nav a {
  color: #fff;
  text-decoration: none;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-right {
  margin-left: auto;
}

/* Top-right nav avatar */
.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e8e8ef;
  vertical-align: middle;
}

.nav-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f2f3f7;
  color: #555;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid #e8e8ef;
  vertical-align: middle;
}

.nav-avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-avatar-wrap,
.nav-admin-wrap {
  position: relative;
}

/* Avatar dropdown */
.avatar-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  color: #111;
  border: 1px solid #e8e8ef;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  min-width: 160px;
  padding: 6px;
  z-index: 1000;
}

.avatar-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #111;
  text-decoration: none;
}

.avatar-menu a:hover,
.avatar-menu a:focus {
  background: #f5f5f7;
}

/* Admin dropdown */
.admin-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  color: #111;
  border: 1px solid #e8e8ef;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  min-width: 160px;
  padding: 6px;
  z-index: 1000;
}

.admin-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #111;
  text-decoration: none;
}

.admin-menu a:hover,
.admin-menu a:focus {
  background: #f5f5f7;
}

.nav-admin-link {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

main {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 16px;
  margin-bottom: 6px;
}

/* Typography */
h2 {
  margin: 8px 0 16px;
}

h3 {
  margin: 6px 0 10px;
}

.small {
  font-size: 12px;
  color: #555;
}

/* Forms */
.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack label {
  display: block;
  margin: 8px 0;
}

.stack .actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 500;
}

label.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 8px;
  border: 1px solid #d9d9e3;
  border-radius: 8px;
  background: #fff;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  vertical-align: middle;
}

/* Buttons */
button,
.button {
  display: inline-block;
  background: #111;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
}

button.primary,
.button.primary {
  background: #2563eb;
}

button.danger {
  background: #b91c1c;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.inline {
  display: inline;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Messages */
.flash {
  background: #e8f6ee;
  color: #0f5d2f;
  padding: 10px;
  border-radius: 8px;
}

.error {
  background: #ffe8e8;
  color: #7a0000;
  padding: 10px;
  border-radius: 8px;
}

.announcement {
  background: #fff7e6;
  border: 1px solid #ffd699;
  color: #7a4a00;
  padding: 10px;
  border-radius: 8px;
}

/* Tables */
.list {
  width: 100%;
  border-collapse: collapse;
}

.list th,
.list td {
  padding: 8px;
  border-bottom: 1px solid #e8e8ef;
  vertical-align: top;
}

.list th {
  background: #f8f9fa;
  font-weight: 600;
}

.list tr:hover {
  background: #f8f9fa;
}

/* Status indicators */
.status-verified {
  color: #28a745;
  font-weight: 500;
}

.status-pending {
  color: #ffc107;
  font-weight: 500;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.success {
  background: #e6fbf0;
  color: #0b7042;
}

/* Auth pages */
.auth {
  display: grid;
  place-items: center;
  height: 100vh;
  background: #0f172a;
  color: #000;
}

.auth .card {
  width: 360px;
}

.auth .card .logo {
  display: block;
  max-width: 120px;
  height: auto;
  margin: 0 auto 16px auto;
}

.auth .card .subtitle {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin: 8px 0 24px 0;
  font-weight: 500;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  max-width: 520px;
  width: 100%;
  border-radius: 16px;
  padding: 16px;
  position: relative;
}

.modal .close {
  position: absolute;
  right: 8px;
  top: 8px;
  background: #eee;
  color: #333;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  line-height: 28px;
  font-size: 20px;
  border: 0;
  padding-top: 3px;
  padding-left: 10px;
}

/* Utility */
.hidden {
  display: none !important;
}

details summary {
  cursor: pointer;
  color: #2563eb;
}

.description {
  padding-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 12px;
    flex-direction: column;
    gap: 12px;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  main {
    padding: 16px;
  }

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

  .grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}
