/* -------------------------------------------------------------------------
   CocoDB — light theme
   White page background, #cdbaba top bar.
   ------------------------------------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #ffffff;
  --surface: #f5f0f0;
  --border: #ddd0d0;
  --text: #1a1a1a;
  --text-muted: #6a6a7a;
  --accent: #531882;
  --accent-hover: #421568;
  --header-bg: #cdbaba;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Header --- */
.site-header {
  background: var(--header-bg);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #b8a3a3;
}

.logo-link {
  display: inline-flex;
}

.site-logo {
  height: 56px;
  width: auto;
}

/* --- Manage nav --- */
.manage-nav {
  display: flex;
  gap: 24px;
}

.manage-nav a {
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.manage-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* --- Main content --- */
.main-content {
  max-width: 720px;
  margin: 48px auto;
  padding: 0 24px;
}

/* --- Search page --- */
.search-container h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  color: var(--text);
}

.search-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.search-input-wrap {
  flex: 1;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* --- Button --- */
.coco-button {
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.coco-button:hover {
  background: var(--accent-hover);
}

/* --- Dropdown --- */
.search-dropdown {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 280px;
  overflow-y: auto;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
}

.search-dropdown li {
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
}

.search-dropdown li:hover,
.search-dropdown li.highlighted {
  background: var(--border);
}

/* --- No-JS results list --- */
.results-list {
  list-style: none;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.results-list li a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.results-list li:last-child a {
  border-bottom: none;
}

.results-list li a:hover {
  background: var(--surface);
  text-decoration: none;
}

/* --- Player detail box --- */
.player-detail {
  margin-top: 28px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.player-detail h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table th,
.detail-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.detail-table th {
  color: var(--text-muted);
  font-weight: 500;
  width: 40%;
}

.detail-table tr:last-child th,
.detail-table tr:last-child td {
  border-bottom: none;
}

/* --- Manage / admin pages --- */
.manage-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.manage-table th,
.manage-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.manage-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.manage-table tr:hover td {
  background: var(--surface);
}

.manage-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.manage-actions h1 {
  font-size: 22px;
  font-weight: 600;
  flex: 1;
}

/* --- Forms (manage) --- */
.manage-form label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.manage-form input[type="text"],
.manage-form input[type="number"],
.manage-form input[type="date"],
.manage-form input[type="file"],
.manage-form select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  margin-bottom: 16px;
  outline: none;
}

.manage-form input:focus,
.manage-form select:focus {
  border-color: var(--accent);
}

/* --- Login page --- */
.login-container {
  max-width: 360px;
  margin: 0 auto;
}

.login-container h1 {
  font-size: 24px;
  margin-bottom: 24px;
}

.login-container p {
  margin-bottom: 12px;
}

.login-container input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 16px;
  outline: none;
}

.login-container input:focus {
  border-color: var(--accent);
}

/* --- Messages --- */
.messages {
  list-style: none;
  margin-bottom: 20px;
}

.message {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 14px;
}

.message-success { background: #edf7ed; border: 1px solid #a3d4a3; color: #2d6b2d; }
.message-error   { background: #fdf0f0; border: 1px solid #e0a0a0; color: #8b2020; }
.message-warning { background: #fdf7ed; border: 1px solid #e0c87a; color: #7a5500; }
.message-info    { background: #edf3fd; border: 1px solid #a0bce0; color: #1a3a6b; }

/* --- Import summary --- */
.import-summary {
  margin-top: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
}

.import-summary h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.import-errors {
  margin-top: 10px;
  color: #8b2020;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  align-items: center;
  font-size: 14px;
}

.pagination a {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

.pagination a:hover {
  background: var(--surface);
  text-decoration: none;
}

.pagination .current {
  padding: 6px 12px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  font-weight: 600;
}
