/* styles.css
   Clean, student-friendly design with a Facebook-like post card feel.
*/

:root {
  --bg: #f7f7f2;
  --card: #ffffff;
  --text: #102a43;
  --muted: #52606d;
  /* Accent updated to match NOTE logo (orange) while keeping a light, student-friendly base. */
  --accent: #f59e0b;
  --accent2: #fff3dc;
  --border: rgba(16, 42, 67, 0.12);
  --shadow: 0 10px 30px rgba(16, 42, 67, 0.08);
  --shadowHover: 0 14px 40px rgba(16, 42, 67, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Animated background (CSS-only)
   - Keeps the base background color
   - Adds a very light moving gradient overlay
*/
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% 12%, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.0) 60%),
    radial-gradient(760px 520px at 88% 18%, rgba(245, 158, 11, 0.10), rgba(245, 158, 11, 0.0) 58%),
    radial-gradient(840px 520px at 70% 86%, rgba(16, 42, 67, 0.08), rgba(16, 42, 67, 0.0) 62%);
  transform: translate3d(0, 0, 0);
  animation: bgFloat 14s ease-in-out infinite;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px 36px;
}

/* Home hero (big title + logo) */
.hero {
  margin-top: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: linear-gradient(
    180deg,
    rgba(255, 248, 230, 0.92),
    rgba(255, 255, 255, 0.55)
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(16, 42, 67, 0.08);
  animation: heroIn 360ms ease both;
  position: relative;
  overflow: hidden;
}

/* Soft amber glass shimmer (CSS-only) */
.hero::before {
  content: "";
  position: absolute;
  inset: -60% -70%;
  background: radial-gradient(
    520px 320px at 18% 18%,
    rgba(245, 158, 11, 0.22),
    rgba(245, 158, 11, 0.0) 60%
  );
  transform: translateX(-18%) translateY(-6%);
  animation: heroGlow 7s ease-in-out infinite;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0.0),
    rgba(255, 240, 200, 0.35),
    rgba(255, 255, 255, 0.0)
  );
  transform: translateX(-55%) rotate(10deg);
  animation: heroSheen 9s ease-in-out infinite;
  pointer-events: none;
}

.hero-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-logo {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(16, 42, 67, 0.12);
  animation: logoFloat 3.6s ease-in-out infinite;
}

.hero-title {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0.3px;
  font-weight: 850;
  line-height: 1.05;
}

.hero-subtitle {
  margin: 4px 0 0;
  color: rgba(16, 42, 67, 0.55);
  font-size: 13px;
  line-height: 1.25;
}

.hero-search {
  margin-top: 16px;
}

.chips {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.chip {
  appearance: none;
  border: 1px solid rgba(16, 42, 67, 0.12);
  background: rgba(255, 255, 255, 0.60);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(16, 42, 67, 0.82);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease, border-color 120ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.chip.is-active {
  background: var(--accent2);
  border-color: rgba(245, 158, 11, 0.34);
  color: #8a4b00;
}

.hero-input {
  padding: 14px 16px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(16, 42, 67, 0.10);
  border-color: rgba(16, 42, 67, 0.10);
  font-size: 15px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: transparent;
  border-bottom: none;
}

/* Subtle animated accent line (CSS-only) */
.topbar::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, rgba(245,158,11,0.0), rgba(245,158,11,0.95), rgba(245,158,11,0.0));
  background-size: 200% 100%;
  animation: accentMove 6s ease-in-out infinite;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  border-radius: 18px;
  border: 1px solid rgba(16, 42, 67, 0.10);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(16, 42, 67, 0.06);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-mark {
  display: flex;
  align-items: center;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(16, 42, 67, 0.12);
  transform-origin: center;
  animation: logoFloat 3.6s ease-in-out infinite;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: 0.2px;
}

.brand small {
  color: var(--muted);
}

.search {
  flex: 1;
  max-width: 520px;
  display: flex;
  gap: 10px;
}

.input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  background: var(--card);
}

.input:focus {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

.btn {
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: var(--accent);
  color: #fff;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 120ms ease, filter 120ms ease;
}

/* Light shimmer on hover (CSS-only). */
.btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 55%;
  height: 200%;
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(20deg);
  transition: left 260ms ease;
}

.btn:hover::after {
  left: 120%;
}

.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--card);
  color: var(--text);
}

.btn-secondary:hover { filter: none; background: var(--accent2); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.card {
  grid-column: span 12;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  animation: cardIn 260ms ease both;
  position: relative;
}

/* Subtle hover sheen on cards (CSS-only) */
.card::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.0), rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.0));
  transform: translateX(-45%) rotate(8deg);
  transition: transform 280ms ease;
  pointer-events: none;
}

.card:hover::after {
  transform: translateX(45%) rotate(8deg);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 46px rgba(16, 42, 67, 0.14);
}

.card-img {
  width: 100%;
  height: 190px;
  background: linear-gradient(135deg, rgba(245,158,11,0.20), rgba(245,158,11,0.04));
  display: block;
  object-fit: cover;
}

.card-body {
  padding: 16px 16px 18px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent2);
  color: #8a4b00;
  border: 1px solid rgba(245, 158, 11, 0.28);
  margin-bottom: 12px;
  font-weight: 750;
}

.card-title {
  margin: 0 0 6px;
  font-size: 16px;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px dashed rgba(16, 42, 67, 0.25);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

/* Post detail */
.post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-hero {
  width: 100%;
  height: 320px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(245,158,11,0.20), rgba(245,158,11,0.04));
  display: block;
}

.post-body { padding: 16px; }

.post-body h2 {
  margin: 0 0 8px;
}

.post-body p {
  color: var(--muted);
  line-height: 1.45;
}

.link-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.link-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  transition: transform 120ms ease;
}

.link-item:hover { transform: translateY(-1px); }

/* Drive link button (hide raw URL, show only the name) */
.drive-btn {
  display: block;
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: var(--accent2);
  color: #8a4b00;
  font-weight: 650;
  text-decoration: none;
  transition: transform 120ms ease, filter 120ms ease;
}

.drive-btn:hover { filter: brightness(1.02); }
.drive-btn:active { transform: scale(0.99); }

/* Non-clickable headings inside the links list */
.link-header {
  background: rgba(255, 255, 255, 0.55);
  border-style: dashed;
  color: var(--muted);
  font-weight: 650;
}

.link-header:hover { transform: none; }

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-2px); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroGlow {
  0%, 100% {
    transform: translateX(-18%) translateY(-6%);
    opacity: 0.85;
  }
  50% {
    transform: translateX(10%) translateY(2%);
    opacity: 1;
  }
}

@keyframes heroSheen {
  0%, 100% {
    transform: translateX(-55%) rotate(10deg);
    opacity: 0.55;
  }
  50% {
    transform: translateX(55%) rotate(10deg);
    opacity: 0.75;
  }
}

@keyframes accentMove {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 0%; }
  100% { background-position: 0% 0%; }
}

@keyframes bgFloat {
  0%, 100% {
    filter: saturate(1);
    transform: translate3d(0, 0, 0);
  }
  50% {
    filter: saturate(1.05);
    transform: translate3d(0, -10px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none !important;
  }
  .brand-logo,
  .card,
  .topbar::before {
    animation: none !important;
  }
  .hero::before,
  .hero::after {
    animation: none !important;
  }
  .btn,
  .card {
    transition: none !important;
  }
  .btn::after {
    display: none;
  }
  .card::after {
    display: none;
  }
}

/* Admin */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

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

.label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

textarea.input { min-height: 120px; resize: vertical; }

.helper {
  font-size: 12px;
  color: var(--muted);
}

.error {
  background: rgba(255, 0, 0, 0.06);
  border: 1px solid rgba(255, 0, 0, 0.18);
  padding: 10px 12px;
  border-radius: 12px;
  color: #8a1f1f;
}

.success {
  background: rgba(0, 160, 80, 0.08);
  border: 1px solid rgba(0, 160, 80, 0.18);
  padding: 10px 12px;
  border-radius: 12px;
  color: #0f5132;
}

/* Admin post management list */
.admin-list {
  display: grid;
  gap: 10px;
}

.admin-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
}

.admin-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(16, 42, 67, 0.10);
  object-fit: cover;
  background: linear-gradient(135deg, rgba(245,158,11,0.20), rgba(245,158,11,0.04));
}

.admin-meta {
  min-width: 0;
}

.admin-title {
  font-weight: 700;
  line-height: 1.2;
}

.admin-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.admin-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
}

@media (min-width: 720px) {
  .admin-item {
    grid-template-columns: 64px 1fr auto;
  }
  .admin-actions {
    grid-column: auto;
  }
}

@media (min-width: 640px) {
  .card { grid-column: span 6; }
  .hero-title { font-size: 36px; }
  .hero-logo { width: 88px; height: 88px; }
}

@media (min-width: 960px) {
  .card { grid-column: span 4; }
  .post-hero { height: 380px; }
  .hero { padding: 22px; }
  .hero-title { font-size: 42px; }
}
