:root{
  --max-width: 1100px;
  --accent: #0a7a5c;
  --accent-2: #16a085;
  --bg: #f3f6f7;
  --card: #ffffff;
  --muted: #5b6572;
  --border: #e2e8ee;
  --shadow: 0 18px 45px rgba(15,23,36,0.12);
  --glass: rgba(255,255,255,0.6);
  --radius: 14px;
  --ring: rgba(10,122,92,0.2);
  --ink: #0b1220;
  --surface: #ffffff;
  --surface-2: #f7fafb;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Segoe UI Mono", "Noto Mono", monospace;
  --ui: "IBM Plex Sans", "Segoe UI", "Trebuchet MS", sans-serif;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

/* Global reset & base */
* { box-sizing: border-box; }
html,body { height: 100%; }
body{
  margin:0;
  font-family: var(--ui);
  background: var(--bg);
  min-height: 100vh;
  color: var(--ink);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(1200px 600px at 8% -10%, rgba(10,122,92,0.08), transparent 60%),
    radial-gradient(900px 500px at 92% 0%, rgba(22,160,133,0.08), transparent 55%);
  opacity: 0.6;
  z-index: 0;
}
body > *{
  position: relative;
  z-index: 1;
}

/* Container */
.container{
  max-width: var(--max-width);
  margin: 36px auto;
  padding: 0 24px;
}

/* Header */
.site-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:20px 22px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  backdrop-filter: blur(10px);
  animation: rise-in 420ms ease both;
}
.site-header h1{
  margin:0;
  font-size:1.3rem;
  letter-spacing: -0.3px;
  font-family: var(--display);
}
.site-header h1 a{ color:var(--accent); text-decoration:none; font-weight:600; }
.site-header nav{
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
  background: var(--nav-bg);
  border:1px solid var(--nav-border);
  padding:6px;
  border-radius:999px;
}
.site-header nav a{
  color:var(--ink);
  text-decoration:none;
  padding:8px 12px;
  border-radius:999px;
  transition:all 160ms ease;
  font-size:0.95rem;
  border:1px solid transparent;
}
.site-header nav a:hover{
  color:var(--accent);
  background: rgba(10,122,92,0.08);
  transform: translateY(-1px);
  border-color: rgba(10,122,92,0.18);
}
.site-header nav a.current{
  color:#ffffff;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 8px 20px rgba(10,122,92,0.25);
}

/* Utility */
h1,h2,h3{ margin:0 0 12px 0; }
h1{ font-family: var(--display); font-size:2rem; letter-spacing:-0.4px; }
h2{ font-size:1.1rem; color:var(--ink); margin-top:8px; }
h3{ font-family: var(--display); font-size:1.1rem; }
small{ color:var(--muted); font-size:0.85rem; }

/* Buttons & Inputs */
button{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 16px;
  font-size:0.95rem;
  border:1px solid rgba(11,18,32,0.08);
  border-radius:12px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color:white;
  box-shadow: 0 10px 24px rgba(10,122,92,0.18);
  cursor:pointer;
  transition:transform 150ms ease, box-shadow 150ms ease, opacity 120ms ease;
}
button:hover{ transform: translateY(-2px); }
button:active{ transform: translateY(0); }
button[disabled]{ opacity:.6; transform:none; cursor:not-allowed; box-shadow:none; }

input[type="text"], input[type="password"], select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: linear-gradient(180deg, #fff, #f7fafb);
  outline:none;
  transition: box-shadow 120ms ease, border-color 120ms ease;
  font-size:0.95rem;
}
input[type="text"]:focus, input[type="password"]:focus, select:focus, textarea:focus{
  box-shadow: 0 10px 24px rgba(10,122,92,0.12);
  border-color: var(--accent);
}

/* Form labels */
label{ display:block; margin:10px 0; color:#162029; font-size:0.95rem; }
textarea{ min-height:110px; resize:vertical; }

/* Admin layout tweaks */
.admin-page .container{ max-width:100%; margin-top:20px; }

/* Admin dashboard layout (sidebar + main) */
.admin-layout{
  display:grid;
  grid-template-columns: 260px 1fr;
  gap:20px;
  align-items:start;
}

/* Sticky sidebar */
.admin-sidebar{
  position:sticky;
  top:22px;
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px;
  box-shadow: var(--shadow);
  height: fit-content;
}
.admin-sidebar .profile{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:10px;
}
.admin-sidebar .avatar{
  width:44px;
  height:44px;
  border-radius:10px;
  background: linear-gradient(135deg,var(--accent),var(--accent-2));
  display:inline-grid;
  place-items:center;
  color:#fff;
  font-weight:700;
  box-shadow: 0 10px 26px rgba(10,122,92,0.18);
}
.admin-sidebar h4{ margin:0; font-size:0.98rem; }
.admin-sidebar p{ margin:4px 0 8px 0; color:var(--muted); font-size:0.9rem; }

.admin-nav{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:12px;
  background: var(--nav-bg);
  border:1px solid var(--nav-border);
  padding:8px;
  border-radius:12px;
}
.admin-nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  color:var(--ink);
  text-decoration:none;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border:1px solid rgba(11,18,32,0.06);
  transition: all 150ms ease;
  font-weight:600;
}
.admin-nav a:hover{
  background: linear-gradient(90deg, rgba(10,122,92,0.08), rgba(22,160,133,0.04));
  transform: translateY(-2px);
  border-color: rgba(10,122,92,0.18);
}
.admin-nav a.active{
  color:#ffffff;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 10px 24px rgba(10,122,92,0.25);
}

/* Main admin content */
.admin-main .top-row{
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
}
.dashboard-cards{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
}
.card-stat{
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
  padding:14px;
  border-radius:14px;
  min-width:180px;
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  gap:6px;
}
.stat-number{ font-size:1.4rem; font-weight:700; color:var(--ink); }
.stat-label{ color:var(--muted); font-size:0.9rem; }

/* Upload form card */
.card.upload{
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
  border-radius:14px;
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
}
.card{
  border-radius:14px;
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
}
.field-row{ display:flex; gap:12px; }
.field-row > * { flex:1; }

/* Custom file input */
.file-input-wrapper{
  position:relative;
  display:flex;
  gap:12px;
  align-items:center;
  padding:10px;
  border-radius:12px;
  border:1px dashed var(--border);
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
}
.file-input-wrapper .file-label{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  background: linear-gradient(90deg, rgba(10,122,92,0.12), rgba(22,160,133,0.08));
  border-radius:8px;
  cursor:pointer;
  color:var(--accent);
  font-weight:600;
}
.file-input-wrapper input[type="file"]{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}
.image-preview{
  margin-top:10px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:8px;
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
  box-shadow: var(--shadow);
  max-width:520px;
}
.image-preview img{
  display:block;
  width:100%;
  height:auto;
  border-radius:10px;
}

/* Form helpers */
.form-note{ color:var(--muted); font-size:0.9rem; margin-top:-6px; }

/* Slideshows listing (admin) */
.slideshow-block{
  margin-bottom:12px;
  padding:12px;
  border-radius:14px;
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
}
.slideshow-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.slideshow-meta h3{ margin:0; font-size:1rem; }
.slideshow-actions{ display:flex; gap:8px; align-items:center; }

.slideshow-items{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:12px;
}
.slideshow-items li{
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
  border-radius:12px;
  padding:8px;
  border:1px solid var(--border);
  display:flex;
  gap:10px;
  align-items:center;
  box-shadow: 0 10px 24px rgba(12,22,40,0.06);
}
.slideshow-items img{ width:100px; height:64px; object-fit:cover; border-radius:8px; }

/* item controls */
.item-meta{ display:flex; flex-direction:column; gap:6px; flex:1; }
.item-meta .title{ font-weight:600; color:var(--ink); font-size:0.95rem; }
.item-controls{ display:flex; gap:8px; align-items:center; }

/* Logout area */
.admin-logout{
  margin-top:14px;
  display:flex;
  gap:8px;
  align-items:center;
}

/* Alerts & messages */
.notice{ background: linear-gradient(90deg, rgba(10,122,92,0.12), rgba(22,160,133,0.06)); padding:12px 14px; border-radius:10px; border:1px solid rgba(10,122,92,0.16); color:var(--accent); }
.error{ color:#c53030; background: rgba(255,230,230,0.6); padding:8px; border-radius:8px; }

/* Carousel */
.carousel{
  position:relative;
  overflow:hidden;
  border-radius:18px;
  background: linear-gradient(180deg, #0b1220, #081021);
  color:#fff;
  box-shadow: 0 18px 50px rgba(6,18,46,0.18);
  animation: rise-in 500ms ease both;
}
.carousel .slides{
  display:flex;
  transition: transform .5s cubic-bezier(.2,.9,.2,1);
  will-change: transform;
}
.carousel .slide{
  min-width:100%;
  position:relative;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}
.carousel img{
  display:block;
  width:100%;
  height:460px;
  object-fit:cover;
  filter: contrast(1.02) saturate(1.06);
  border-radius:18px 18px 0 0;
}
.carousel .caption{
  padding:12px 14px;
  margin:12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.65));
  border-radius:10px;
  backdrop-filter: blur(6px);
  font-size:0.95rem;
}

/* controls */
.carousel .prev, .carousel .next{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  min-width:72px;
  height:40px;
  display:inline-grid;
  place-items:center;
  border-radius:999px;
  background: rgba(255,255,255,0.12);
  border:1px solid rgba(255,255,255,0.12);
  color:white;
  font-size:0.9rem;
  box-shadow: 0 10px 24px rgba(2,6,23,0.32);
  cursor:pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.carousel .prev:hover, .carousel .next:hover{ transform: translateY(-50%) scale(1.03); background: rgba(255,255,255,0.12); }
.carousel .prev{ left:12px; }
.carousel .next{ right:12px; }

/* Scrolling strip */
.scroll-wrap{
  overflow:hidden;
  border-radius:14px;
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
  padding:10px;
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  animation: rise-in 520ms ease both;
}
.scroll-track{
  display:flex;
  gap:12px;
  align-items:center;
  animation: scroll-left 22s linear infinite;
  will-change: transform;
}
.scroll-item{
  flex:0 0 auto;
  width:180px;
  border-radius:10px;
  overflow:hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(6,18,46,0.06);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.scroll-item img{ width:100%; height:120px; object-fit:cover; display:block; }

/* pause on hover for usability */
.scroll-wrap:hover .scroll-track{ animation-play-state: paused; }

/* posts grid */
#posts{ display:grid; gap:18px; grid-template-columns: repeat(2, minmax(0,1fr)); align-items:start; }
.post{
  display:flex;
  gap:16px;
  align-items:flex-start;
  padding:16px;
  border-radius:14px;
  border:1px solid var(--border);
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
  box-shadow: 0 12px 32px rgba(15,23,36,0.08);
  animation: rise-in 520ms ease both;
}
.post-thumb{ width:160px; height:100px; object-fit:cover; border-radius:10px; flex-shrink:0; }
.post-content{ color:var(--muted); font-size:0.96rem; }

/* responsive */
@media (max-width:980px){
  .container{ padding:0 14px; }
  .carousel img{ height:320px; }
  #posts{ grid-template-columns: 1fr; }
  .post-thumb{ width:120px; height:80px; }
  .scroll-item{ width:140px; }
  .admin-layout{ grid-template-columns: 1fr; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  .scroll-track{ animation: none; }
  .carousel .slides{ transition: none; }
  .site-header, .carousel, .scroll-wrap, .post{ animation: none; }
}

/* helper: subtle focus ring for keyboard users */
:focus{ outline: none; box-shadow: 0 0 0 4px var(--ring); border-radius:8px; }

/* Scroll animation keyframes */
@keyframes scroll-left {
  0%{ transform: translateX(0); }
  100%{ transform: translateX(-50%); }
}
@keyframes rise-in {
  0%{ opacity:0; transform: translateY(10px); }
  100%{ opacity:1; transform: translateY(0); }
}
