/* ========== CSS RESET & ROOT VARIABLES ========== */
:root {
  --primary: #0073b1;
  --secondary: #3498db;
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #d32f2f;
  --text: #333;
  --text-light: #666;
  --bg: #e2ded6;
  --bg-light: #e7e4e4;
  --border: #ddd;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --radius: 6px;
  --spacing: 1rem;
}

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

html, body {
  width: 100%;
  height: 100%;
  font-family: Arial, sans-serif;
  font-size: 14px;
  background-color: #e0e0de;
  color: var(--text);
}

/* ========== TYPOGRAPHY ========== */
h1 {
  font-size: clamp(1.2rem, 10vw, 3rem); /* Larger for h1 */
 font-weight: 600;
  margin-bottom: 0.5rem;
}

h2 {
  font, size: clamp(1.2rem, 8vw, 2.5rem); /* Slightly smaller than h1 */
 font-weight: 600;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: clamp(1.2rem, 6vw, 2rem); /* Even smaller */
 font-weight: 600;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: clamp(1.2rem, 5vw, 1.8rem);
 font-weight: 600;
  margin-bottom: 0.5rem;
}

h5 {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
 font-weight: 600;
  margin-bottom: 0.5rem;
}

h6 {
  font-size: clamp(1.2rem, 3vw, 1.4rem);
 font-weight: 600;
  margin-bottom: 0.5rem;
}

 
a {
  text-decoration: none;
  color: #550000;
  transition: color 0.3s ease;
}

a:hover, a:focus, a:active {
  color: #000ee5;
}

li {
  list-style-type: none;
}
p {
  margin-bottom: 1em; /* Adds space below each paragraph */
}
/* ========== LAYOUT UTILITIES ========== */
:root {
  --spacing: 1rem;
}

/* ========== LAYOUT CONTAINERS ========== */
.container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing);
  font-size: 14px;
  justify-content: center;
  align-items: center;
}

/* ========== FLEX CONTAINERS ========== */
.flex {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-center {
  justify-content: center;
  align-items: center;
}

.flex-between {
  justify-content: space-between;
  align-items: center;
}

/* ========== GRID LAYOUT ========== */
.grid {
  display: grid;
}

.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing);
}

/* ========== SPACING UTILITY ========== */
.p {
  padding: var(--spacing);
}

.p-sm {
  padding: 0.5rem;
}

.p-lg {
  padding: 1.5rem;
}

.m {
  margin: var(--spacing);
}

.m-b {
  margin-bottom: var(--spacing);
}

.m-t {
  margin-top: var(--spacing);
}

/* ========== RESPONSIVE UTILITY ========== */
@media (max-width: 768px) {
  .flex-item {
    flex: 1 1 calc(50% - 10px);
  }
}

/* ========== COMPONENT CONTAINERS ========== */
.error-box {
    color: #c62828;
    border: 2px solid #c62828;
    padding: 15px;
    margin: 15px auto;
    background-color: #ffebee;
    border-radius: 5px;
    max-width: 95%;
}

.alert-info {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.pwa-banner {
    background: #e7f1ff;
    border: 2px solid #0d6efd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

#installBtn {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    margin-bottom: 10px;
}

#installInstructions {
    display: none;
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
}

.wrapper {
  min-height: 100vh;
  background: #e0e0de;
  display: flex;
  flex-direction: column;
}

.wrap {
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: auto;
  background: #e0e0de;
}

/* ========== CONTENT ITEMS ========== */
.box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0e0de;
}

.row {
  display: flex;
  justify-content: center;
  background-color: #e0e0de;
  font-size: 12px;
  max-width: 1200px;
  text-align: center;
  margin: auto;
}
. {
  display: flex;
  justify-content: center;
  background-color: #e0e0de;
  font-size: 12px;
  max-width: 1200px;
  text-align: center;
  margin: auto;
}
/* ========== FLEX ITEMS ========== */
.flex-item {
  flex: 1 1 calc(33.33% - 10px);
  margin: 5px;
  box-sizing: border-box;
}

/* ========== GAP UTILITY ========== */
.gap-sm { gap: 0.5rem; }
.gap { gap: var(--spacing); }
.gap-lg { gap: 1.5rem; }

/* ========== RESPONSIVE FLEX ITEMS ========== */
@media (max-width: 768px) {
  .flex-item {
    flex: 1 1 calc(50% - 10px);
  }
}

/* ========== CONTENT CONTAINERS ========== */
.content-container {
  background-color: #e0e0de;
  padding: var(--spacing);
}

/* ========== CUSTOM CLASSES ========== */
/* Add any custom classes here */
```

/* ========== COMPONENTS ========== */

/* Card/Box */
.card, .box {
  background: e0e0de;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--spacing);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

/* Button */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  touch-action: manipulation;
  text-decoration: none;
  text-align: center;
}

.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  transform: scale(0.98);
}

.btn.disabled, .btn:disabled {
  background: var(--border);
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-block {
  width: 100%;
  display: block;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1em;
  transition: border-color 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 115, 177, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

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

.form-group label {
  font-weight: 600;
  font-size: 0.9em;
}

.form-group-inline {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  font-size: 0.85em;
  font-weight: 600;
}

.badge-primary { background: rgba(0, 115, 177, 0.2); color: var(--primary); }
.badge-success { background: rgba(76, 175, 80, 0.2); color: var(--success); }
.badge-warning { background: rgba(255, 152, 0, 0.2); color: var(--warning); }

.msg-badge {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  min-width: 16px;
  text-align: center;
  line-height: 14px;
  margin-left: 4px;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table th {
  padding: 0.8rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.table tr:hover {
  background: var(--bg-light);
}

/* ========== SPECIFIC COMPONENTS ========== */

/* Header/Navbar */
.header, .footer {
  background-color: var(--bg);
  padding: 1.5rem;
  text-align: center;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background: #b1e0de;
  color: black;
  padding: 0.6rem;
  border: none;
  font-size: 0.9em;
  cursor: pointer;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: #dfedec;
  min-width: 85px;
  box-shadow: 0px 8px 16px 0px rgba(109, 51, 51, 0.2);
  z-index: 1000;
}

.dropdown-content a {
  color: black;
  padding: 0.8rem;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background: #c2bc77;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown:hover .dropbtn {
  background: #ce8e41;


/* Browse Timeline Styles */
.browse-filter-form {
  width: 100%;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.filter-group {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-input, .filter-select {
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1em;
}

.filter-button {
  padding: 0.6rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}

.members-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.member-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}

.member-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.member-name {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--primary);
}

.member-stats {
  font-size: 0.9em;
  line-height: 1.6;
  color: var(--text-light);
}

.member-action {
  padding-top: 0.5rem;
  border-top: 1px solid var(--bg-light);
}

.action-button {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: var(--success);
  color: white;
  text-align: center;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.action-button:hover {
  background: #45a049;
}

.action-button.disabled {
  background: var(--border);
  color: var(--text-light);
  opacity: 0.6;
}

/* Timeline Member Styles */
.timeline-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #005a8f 100%);
  color: white;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.timeline-entry {
  margin-bottom: 1rem;
  padding: 1.2rem;
  background: white;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.entry-date {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}

.entry-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

.entry-body {
  margin: 1rem 0;
  line-height: 1.6;
}

/* Image Gallery */
.image-gallery {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: var(--radius);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.image-item {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
}

.image-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  padding: 1rem;
  border-radius: var(--radius);
  border-left: 4px solid;
  background: var(--bg-light);
}

.stat-card--entries { border-left-color: #1976d2; }
.stat-card--images { border-left-color: #7b1fa2; }
.stat-card--years { border-left-color: #388e3c; }
.stat-card--span { border-left-color: var(--warning); }

.stat-label {
  font-size: 0.85em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.8em;
  font-weight: bold;
}

/* Timeline Notes Styles */
.notes-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.notes-section h4 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.note-card {
  padding: 1rem;
  background: white;
  border-radius: var(--radius);
  border-left: 3px solid var(--secondary);
  box-shadow: var(--shadow-sm);
}

.note-header {
  font-size: 0.9em;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.note-date {
  color: #888;
  font-size: 0.85em;
}

.note-subject {
  font-weight: 600;
  color: var(--primary);
}

.note-text {
  line-height: 1.5;
  color: var(--text);
}

.no-notes {
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 1rem;
}

.note-form {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.note-form h5 {
  margin-bottom: 0.75rem;
}

.note-form .form-group {
  margin-bottom: 0.75rem;
}

.note-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.note-form input,
.note-form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
}

.note-form textarea {
  resize: vertical;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
  :root {
    --spacing: 0.75rem;
  }

  .filter-controls {
    gap: 0.5rem;
  }

  .members-container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .member-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .filter-controls {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }

  .table {
    font-size: 0.9em;
  }

  .table th, .table td {
    padding: 0.6rem;
  }

  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .image-item img {
    height: 100px;
  }
}

@media (max-width: 480px) {
  :root {
    --spacing: 0.5rem;
  }

  body {
    font-size: 13px;
  }

  .filter-controls {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filter-input, .filter-select, .filter-button {
    width: 100%;
  }

  .members-container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .member-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .action-button {
    padding: 0.6rem;
    font-size: 0.85em;
  }

  .form-group-inline {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .stat-value {
    font-size: 1.3em;
  }

  .btn {
    width: 100%;
    display: block;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px;
    padding: 0.75rem;
  }

  button {
    min-height: 44px;
    min-width: 44px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn, button, input[type="submit"], a.action-button {
    min-height: 48px;
    min-width: 48px;
    padding: 0.75rem 1rem;
  }
}

/* ========== MESSAGES SIMPLE STYLES ========== */
.msg-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.msg-header {
  width: 100%;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.msg-header h1 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.msg-header a {
  font-size: 0.9rem;
  color: var(--primary);
}

.msg-badge {
  background: var(--danger);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  margin-left: 8px;
}

.msg-tabs {
  width: 100%;
  margin-bottom: 1rem;
}

.msg-tabs a {
  display: block;
  width: 100%;
  padding: 14px;
  margin-bottom: 8px;
  background: white;
  border: 1px solid var(--border);
  text-align: center;
  text-decoration: none;
  color: var(--primary);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: bold;
}

.msg-tabs a.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.msg-card {
  background: white;
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  width: 100%;
  border: 1px solid var(--border);
}

.msg-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

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

.msg-item.unread {
  background: #e8f4ff;
  margin: -0.75rem -0.75rem 0.75rem -0.75rem;
  padding: 0.75rem;
}

.msg-from {
  font-weight: bold;
  color: var(--primary);
}

.msg-date {
  color: var(--text-light);
  font-size: 0.8rem;
  display: block;
  margin-top: 4px;
}

.msg-subject {
  font-weight: 600;
  margin: 8px 0 5px 0;
}

.msg-body {
  color: var(--text);
  word-wrap: break-word;
  margin-bottom: 10px;
}

.msg-actions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.msg-actions a,
.msg-actions form {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 5px;
}

.msg-actions .btn {
  font-size: 0.85rem;
  padding: 8px 16px;
}

.msg-empty {
  color: var(--text-light);
  text-align: center;
  padding: 20px;
}

.msg-success {
  background: #d4edda;
  color: #155724;
  padding: 10px;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* ========== CRUD STYLES ========== */
.crud-container { max-width: 900px; margin: 0 auto; padding: 20px; }
.crud-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.crud-btn { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; }
.crud-btn-primary { background: #4CAF50; color: white; }
.crud-btn-secondary { background: #6c757d; color: white; }
.crud-btn-danger { background: #dc3545; color: white; }
.crud-btn-warning { background: #ffc107; color: #212529; }
.crud-form { background: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
.crud-form .form-row { display: flex; gap: 15px; margin-bottom: 15px; }
.crud-form .form-group { flex: 1; }
.crud-form label { display: block; font-weight: bold; margin-bottom: 5px; color: #333; }
.crud-form input[type="text"],
.crud-form input[type="date"],
.crud-form textarea,
.crud-form select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
.crud-form textarea { resize: vertical; min-height: 100px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 5px; border: 1px solid #ddd; padding: 10px; border-radius: 4px; max-height: 200px; overflow-y: auto; background: white; }
.people-grid label { padding: 4px; cursor: pointer; }
.people-grid label:hover { background: #e3f2fd; }
.entries-table { width: 100%; border-collapse: collapse; background: white; }
.entries-table th, .entries-table td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }
.entries-table th { background: #0073b1; color: white; }
.entries-table tr:hover { background: #f5f5f5; }
.entry-view { background: white; padding: 20px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.entry-meta { color: #666; font-size: 14px; margin-bottom: 15px; }
.entry-actions { display: flex; gap: 10px; margin-top: 15px; }
.search-box { padding: 15px; background: white; border-radius: 8px; margin-bottom: 20px; }
.search-box input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }

.filter-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-row label { display: flex; flex-direction: column; font-size: 0.9em; }
.filter-row select, .filter-row input { margin-top: 4px; }
.entries-list { max-height: 300px; overflow-y: auto; border: 1px solid #ccc; padding: 10px; }
.entry-item { padding: 5px; border-bottom: 1px solid #eee; }
.entry-item:hover { background: #f9f9f9; }
.chapter-block { background: #f9f9f9; padding: 15px; margin-bottom: 15px; border-radius: 4px; }
fieldset { border: 1px solid #ccc; padding: 15px; margin-bottom: 15px; }
legend { font-weight: bold; padding: 0 5px; }
.btn-small { padding: 4px 8px; font-size: 0.85em; }
