@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(1.3); }
}

:root {
  --primary: #a9c638;
  --primary-dark: #8aaa1a;
  --primary-glow: rgba(169,198,56,.22);
  --secondary: #00b7e2;
  --secondary-dark: #0099bf;
  --bg: #f8f8f8;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #f4f4f4;
  --text: #111111;
  --muted: #777777;
  --border: #d0d0d0;
  --success: #a9c638;
  --error: #e03535;
  --radius: 12px;
}

/* DARK MODE */
body.dark {
  --bg: #1a1a1a;
  --bg2: #222222;
  --card: #242424;
  --card2: #2c2c2c;
  --text: #e0e0e0;
  --muted: #888888;
  --border: #3a3a3a;
}
body.dark nav { background: #1e1e1e; }
body.dark nav a { color: #cccccc; }
body.dark::before { opacity: .22; }
body.dark .sidebar { background: #1e1e1e; }
body.dark input[type=text], body.dark input[type=password], body.dark textarea { background: #2c2c2c; color: var(--text); border-color: var(--border); }
body.dark .btn-secondary { background: #2c2c2c; color: var(--text); border-color: var(--border); }
body.dark .btn-secondary:hover { background: #333; border-color: var(--primary); color: var(--primary); }
body.dark .btn-danger { background: #2c2c2c; }
body.dark tr:hover td { background: #2a2a22; }
body.dark .login-wrap { background: linear-gradient(135deg, rgba(169,198,56,.06) 0%, rgba(0,183,226,.04) 100%), var(--bg); }

/* THEME TOGGLE */
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: .2rem .4rem;
  border-radius: 50%;
  transition: background .2s;
  line-height: 1;
}
#theme-toggle:hover { background: rgba(128,128,128,.15); }

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

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/static/img/lion.svg') center center no-repeat;
  background-size: 65vmin;
  opacity: .06;
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--secondary); text-decoration: none; }
a:hover { color: var(--secondary-dark); text-decoration: underline; }

/* NAV */
nav {
  background: #ffffff;
  border-bottom: 2px solid var(--primary);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
nav a { color: #333; font-size: .93rem; font-weight: 600; transition: color .2s; }
nav a:hover { color: var(--primary-dark); text-decoration: none; }

/* CONTAINER */
.container { max-width: 1020px; margin: 0 auto; padding: 2rem 1.2rem; }

/* HERO */
.hero {
  text-align: center;
  padding: 4rem 1rem 2.5rem;
}
.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: .6rem;
  color: var(--text);
}
.hero p { color: var(--muted); font-size: 1.1rem; }

/* SECTION TITLE */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2.5rem 0 1.2rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--primary);
  margin-left: .8rem;
  border-radius: 2px;
}

/* CARDS */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(169,198,56,.2);
  transform: translateY(-2px);
}
.card h3 { font-size: 1.05rem; margin-bottom: .4rem; color: var(--text); }
.card .meta { font-size: .82rem; color: var(--muted); margin-bottom: .6rem; }
.card p { font-size: .93rem; color: var(--muted); }

/* NOTE DETAIL */
.note-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 1rem;
  white-space: pre-wrap;
  line-height: 1.8;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

/* GALLERY */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.gallery-item-wrap { display: flex; flex-direction: column; }
.gallery-item-date {
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
  padding: .35rem 0 .1rem;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--card2);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.gallery-item:hover {
  border-color: var(--primary);
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(169,198,56,.25);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-item:hover img { transform: scale(1.06); }

/* LIGHTBOX */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 999; align-items: center; justify-content: center; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); box-shadow: 0 0 60px rgba(0,0,0,.5); }
.lightbox-close { position: absolute; top: 1.2rem; right: 1.5rem; color: #ccc; font-size: 2rem; cursor: pointer; transition: color .2s; }
.lightbox-close:hover { color: #fff; }
.lightbox-caption { position: absolute; bottom: 1.5rem; color: #fff; font-size: .95rem; background: rgba(0,0,0,.6); padding: .4rem 1rem; border-radius: 99px; border: 1px solid rgba(255,255,255,.2); }

/* BUTTONS */
.btn {
  display: inline-block;
  padding: .5rem 1.4rem;
  border-radius: 50rem;
  font-size: .9rem;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .1s;
  font-family: inherit;
  letter-spacing: .01em;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(169,198,56,.35);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(169,198,56,.45);
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--card2);
  border-color: var(--primary);
  color: var(--primary-dark);
  text-decoration: none;
}

.btn-danger {
  background: #fff;
  color: var(--error);
  border-color: rgba(224,53,53,.35);
}
.btn-danger:hover {
  background: rgba(224,53,53,.08);
  border-color: var(--error);
  text-decoration: none;
}

.btn-sm { padding: .28rem .85rem; font-size: .82rem; }

/* FLASH MESSAGES */
.flash { padding: .8rem 1.2rem; border-radius: 8px; margin-bottom: 1rem; font-size: .93rem; border: 1px solid; }
.flash.success { background: rgba(169,198,56,.12); color: #5a7a00; border-color: rgba(169,198,56,.4); }
.flash.error { background: rgba(224,53,53,.08); color: var(--error); border-color: rgba(224,53,53,.3); }

/* FORMS */
.form-group { margin-bottom: 1.1rem; }
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .4rem; color: var(--text); }
input[type=text], input[type=password], textarea {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
select, input[type=date], input[type=datetime-local] {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23777' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}
select:focus, input[type=date]:focus, input[type=datetime-local]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
body.dark select, body.dark input[type=date], body.dark input[type=datetime-local] {
  background-color: #2c2c2c;
  color: var(--text);
  border-color: var(--border);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
textarea { min-height: 220px; resize: vertical; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-weight: 400; cursor: pointer; color: var(--text); }
input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* ADMIN LAYOUT */
.admin-layout { display: flex; min-height: calc(100vh - 62px); }
.sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .9rem;
  border-radius: 50rem;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: .25rem;
  transition: background .2s, color .2s;
}
.sidebar a:hover, .sidebar a.active {
  background: rgba(169,198,56,.15);
  color: var(--primary-dark);
  text-decoration: none;
}
.sidebar-group-label {
  padding: .55rem 1.2rem .3rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.sidebar-group a {
  padding-left: 2rem;
}
.admin-content { flex: 1; padding: 2rem; background: var(--bg); }

/* TABLE */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
th { background: var(--card2); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
td { padding: .8rem 1rem; border-top: 1px solid var(--border); font-size: .93rem; vertical-align: middle; color: var(--text); }
tr:hover td { background: #fafff0; }

/* STATS */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.stat-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(169,198,56,.2); }
.stat-card .number {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary-dark);
  word-break: break-all;
}
.stat-card .label { font-size: .85rem; color: var(--muted); margin-top: .2rem; }

/* LOGIN */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(169,198,56,.08) 0%, rgba(0,183,226,.06) 100%), var(--bg);
}
.login-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 16px;
  padding: 2.5rem;
  width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
}
.login-box h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text);
}

/* BADGE */
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 99px; }
.badge-green { background: rgba(169,198,56,.15); color: #5a7a00; border: 1px solid rgba(169,198,56,.4); }
.badge-gray { background: rgba(119,119,119,.1); color: var(--muted); border: 1px solid var(--border); }

/* UPLOAD AREA */
.upload-form {
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: border-color .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.upload-form:hover { border-color: var(--primary); }

/* ADMIN PHOTO GRID */
.admin-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.admin-photo-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.admin-photo-item:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(169,198,56,.2); }
.admin-photo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.admin-photo-item .photo-actions { padding: .5rem; display: flex; gap: .3rem; flex-wrap: wrap; }

/* ADMIN ACTIONS (inline on public pages) */
.admin-actions {
  margin-top: .7rem;
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
}

/* PAGE TITLE */
h1, h2 { color: var(--text); }

/* RESPONSIVE */
@media (max-width: 640px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: .8rem; display: flex; gap: .5rem; flex-wrap: wrap; }
  nav { gap: 1rem; padding: 0 1rem; }
  .hero h1 { font-size: 1.9rem; }
}
