
/* CSS Variables */
:root {
  --fg: #111;
  --bg: #fff;
  --muted: #666;
  --link: #0b79d0;
  --border: #e5e5e5;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
}

/* Layout */
header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header strong {
  background: #e8f4f8;
  color: #0b79d0;
  padding: 6px 12px;
  border-radius: 3px;
  border: 1px solid #cfe3ff;
}

header nav a,
header nav button {
  background: #0b79d0;
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
  margin-left: 8px;
  margin-bottom: 8px;
  vertical-align: middle;
}

header nav button {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

header nav a:hover,
header nav button:hover {
  opacity: 0.9;
}

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

/* Forms */
label {
  display: block;
  margin: 10px 0 4px;
  font-weight: 600;
}

input[type="text"],
input[type="datetime-local"],
textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

/* Buttons */
button {
  background: #0b79d0;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

button.secondary {
  background: #666;
}

button:hover {
  opacity: 0.9;
}

/* Notice */
.notice {
  background: #f0f7ff;
  border: 1px solid #cfe3ff;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 16px 0;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ddd;
  margin: 16px 0;
}

.table th,
.table td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}

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

.table tr:nth-child(even) {
  background: #f9f9f9;
}

.table tr:hover {
  background: #f5f5f5;
}

/* Action buttons in table */
.table td:last-child {
  white-space: nowrap;
}

.table td:last-child a {
  display: inline-block;
  padding: 3px 6px;
  margin: 0 2px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 11px;
  white-space: nowrap;
}

.table td:last-child a[href*="editor"] {
  background: #0b79d0;
  color: #fff;
}

.table td:last-child a[href*="index.php?id"] {
  background: #28a745;
  color: #fff;
}

.table td:last-child a.view-by-name {
  background: #20c997;
  color: #fff;
}

.table td:last-child a[href*="delete"] {
  background: #dc3545;
  color: #fff !important;
}

.table td:last-child a:hover {
  opacity: 0.85;
}

/* Login form styling */
.login-form {
  max-width: 300px;
  margin: 40px auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Delete Confirmation */
.delete-confirmation {
  max-width: 600px;
  margin: 40px auto;
  padding: 20px;
  border: 2px solid #dc3545;
  border-radius: 8px;
  background: #fff5f5;
}

.delete-confirmation h2 {
  color: #dc3545;
  margin-top: 0;
}

.delete-confirmation-text {
  font-size: 16px;
  margin: 20px 0;
}

.delete-post-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
}

.delete-warning {
  color: #dc3545;
  font-weight: bold;
}

.delete-actions {
  margin-top: 30px;
  display: flex;
  gap: 10px;
}

.delete-btn {
  background: #dc3545;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}

.cancel-btn {
  background: #6c757d;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}

/* Notice Messages */
.notice.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.notice.success a {
  color: #155724;
  font-weight: bold;
}

.notice.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 4px;
}

/* Settings Page */
.settings-filter {
  margin-bottom: 15px;
}

.settings-filter select,
.filter-select {
  padding: 5px;
}

.settings-fieldset {
  margin: 20px 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.settings-fieldset legend {
  font-weight: 600;
  padding: 0 10px;
}

.settings-field {
  margin: 15px 0;
}

/* Login Page */
.login-setup-hint {
  margin-top: 1.5rem;
}

/* Admin Table Links */
.post-id-link {
  text-decoration: none;
  font-weight: bold;
  color: #0b79d0;
}

.post-title-link {
  text-decoration: none;
  color: #333;
}

.post-date-link {
  text-decoration: none;
  color: #333;
  white-space: nowrap;
}

.post-status-link {
  text-decoration: none;
  color: #333;
}

.post-delete-link {
  color: #dc3545;
}

/* Hidden Content Textarea */
#content-textarea {
  display: none;
}

/* Backup Table */
.backup-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.backup-table th,
.backup-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.backup-table th {
  background: #f5f5f5;
  font-weight: 600;
}

.backup-table td form {
  display: inline;
  margin-left: 8px;
}

.button.small {
  padding: 4px 8px;
  font-size: 12px;
}
