/* Advania Bibliotek - Prototype CSS
   Brand: Advania Brand Book v1.2 (July 2023)
   Primary colours: Orange #d54328, Pink #cb0084, Purple #98139c, Indigo #4f0077, Green #45b649, Blue #2abad9
   Neutrals: Dark Grey #30302f, Light Grey #eceff0
   Gradients: Orange+Pink, Purple+Indigo, Pink+Purple, Green+Blue
   Typography: Adelle (display) / Adelle Sans (body) — fallback: Georgia / Inter
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}
.ms-sm { font-size: 18px; }
.ms-lg { font-size: 32px; }
.ms-xl { font-size: 48px; }

/* ==============================
   DESIGN TOKENS — Advania Brand
   ============================== */
:root {
  /* Advania primary colours */
  --adv-orange: #d54328;
  --adv-pink: #cb0084;
  --adv-purple: #98139c;
  --adv-indigo: #4f0077;
  --adv-green: #45b649;
  --adv-blue: #2abad9;
  --adv-dark: #30302f;
  --adv-light: #eceff0;

  /* Semantic mapping */
  --primary: #30302f;
  --primary-light: #4a4a49;
  --accent: #d54328;
  --accent-hover: #bf3b22;
  --accent-soft: rgba(213,67,40,.08);
  --bg: #f7f7f6;
  --white: #ffffff;
  --text: #30302f;
  --text-light: #6b6b6a;
  --border: #dcdcda;
  --border-light: #eceff0;
  --success: #2e8b57;
  --success-bg: #edf7f1;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --card-shadow: 0 1px 3px rgba(48,48,47,.05), 0 4px 14px rgba(48,48,47,.04);
  --card-shadow-hover: 0 4px 12px rgba(48,48,47,.08), 0 16px 40px rgba(48,48,47,.07);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --transition: .25s cubic-bezier(.4,0,.2,1);
  --font-display: 'Bitter', Georgia, 'Times New Roman', serif;
  --font: 'Inter', Arial, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:not(.btn):not(.login-btn):hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

::selection { background: rgba(213,67,40,.12); }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
h4 { letter-spacing: -0.01em; }

/* ==============================
   NAVIGATION
   ============================== */
nav {
  background: var(--primary);
  color: var(--white);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .logo {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -0.01em;
}

nav .logo span:not(.material-symbols-outlined) {
  font-weight: 400;
  opacity: .45;
  font-size: .9rem;
}

nav .logo .material-symbols-outlined {
  color: var(--adv-orange);
  opacity: 1;
  font-size: 22px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: .2rem;
}

nav ul a {
  color: var(--white);
  opacity: .65;
  font-size: .85rem;
  font-weight: 500;
  transition: all var(--transition);
  padding: .4rem .8rem;
  border-radius: var(--radius-sm);
}

nav ul a:hover {
  color: var(--white);
  opacity: 1;
  text-decoration: none;
  background: rgba(255,255,255,.08);
}

nav ul a.active {
  opacity: 1;
  background: rgba(255,255,255,.1);
}

nav .nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

nav .login-btn {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: .45rem 1.15rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  font-family: var(--font);
  transition: all var(--transition);
  letter-spacing: -0.01em;
}

nav .login-btn:hover {
  background: var(--accent-hover);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(213,67,40,.35);
}

/* ==============================
   HERO — Advania Gradient 1 (Orange → Pink)
   ============================== */
.hero {
  background:
    radial-gradient(ellipse at 20% 80%, rgba(203,0,132,.2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(213,67,40,.3) 0%, transparent 40%),
    linear-gradient(135deg, var(--adv-orange) 0%, #c0341f 30%, #b51a52 70%, var(--adv-pink) 100%);
  color: var(--white);
  padding: 5rem 2rem 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 350px;
  height: 350px;
  background: rgba(255,255,255,.04);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transform: rotate(15deg);
}

.hero::after {
  content: '';
  position: absolute;
  left: -40px;
  bottom: -60px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,.03);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transform: rotate(-10deg);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.75rem;
  margin-bottom: .75rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  position: relative;
}

.hero h1 strong { font-weight: 800; }

.hero p {
  font-size: 1.05rem;
  opacity: .8;
  max-width: 540px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  font-weight: 400;
  position: relative;
}

/* ==============================
   SEARCH BAR
   ============================== */
.search-bar {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  background: var(--white);
  border-radius: 60px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  position: relative;
}

.search-bar input {
  flex: 1;
  padding: 1rem 1.75rem;
  border: none;
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  background: transparent;
  color: var(--text);
}

.search-bar input::placeholder { color: #9a9a99; }

.search-bar button {
  background: var(--adv-dark);
  color: var(--white);
  border: none;
  padding: 1rem 2rem;
  font-size: .95rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.search-bar button:hover { background: #1a1a19; }

/* ==============================
   LAYOUT
   ============================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.01em;
}

.section-title a {
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .3rem;
}

.section-title a:hover { color: var(--accent-hover); }

/* ==============================
   CARDS
   ============================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: all var(--transition);
  border: 1px solid var(--border-light);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--border);
}

.card-img {
  height: 160px;
  background: linear-gradient(135deg, var(--adv-purple), var(--adv-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 3rem;
  position: relative;
}

.card-body { padding: 1.25rem 1.4rem; }
.card-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .35rem; }
.card-body p { font-size: .88rem; color: var(--text-light); line-height: 1.55; }

.card-meta {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
  font-size: .8rem;
  color: var(--text-light);
  flex-wrap: wrap;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  background: var(--border-light);
  color: var(--primary);
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tag.available { background: var(--success-bg); color: var(--success); }
.tag.event { background: var(--warning-bg); color: var(--warning); }

/* ==============================
   BUTTONS
   ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: .875rem;
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(213,67,40,.3);
}

.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
  background: var(--white);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

/* ==============================
   SEARCH RESULTS
   ============================== */
.results-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
}

.filters {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  align-self: start;
  border: 1px solid var(--border-light);
  position: sticky;
  top: 80px;
}
.filters h3 { font-family: var(--font-display); font-size: .95rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); }

.filter-group { margin-bottom: 1.2rem; }
.filter-group label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filter-group select, .filter-group input[type=text] {
  width: 100%;
  padding: .5rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-family: var(--font);
  transition: border-color var(--transition);
  background: var(--white);
}
.filter-group select:focus, .filter-group input[type=text]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(213,67,40,.08);
}

.filter-check { display: flex; align-items: center; gap: .5rem; margin: .4rem 0; font-size: .85rem; }

.result-item {
  display: flex;
  gap: 1.25rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  margin-bottom: .75rem;
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}

.result-item:hover {
  border-color: var(--border);
  box-shadow: var(--card-shadow-hover);
}

.result-cover {
  width: 80px;
  height: 110px;
  background: linear-gradient(160deg, var(--border-light), #d4d8dc);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  color: var(--text-light);
}

.result-info { flex: 1; }
.result-info h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .15rem; }
.result-info .author { color: var(--text-light); font-size: .88rem; margin-bottom: .5rem; }
.result-info .avail { font-size: .82rem; color: var(--success); font-weight: 600; margin-bottom: .75rem; }

/* ==============================
   DASHBOARD / MIN SIDE
   ============================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.dash-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-light);
}

.dash-card h3 {
  font-family: var(--font);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: .5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: .78rem;
}

.dash-card h3 .material-symbols-outlined { color: var(--accent); }

.loan-item, .res-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .88rem;
}

.loan-item:last-child, .res-item:last-child { border-bottom: none; }

.due-soon { color: var(--warning); font-weight: 600; }
.overdue { color: var(--accent); font-weight: 600; }

.user-header {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.avatar {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--adv-orange), var(--adv-pink));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ==============================
   EVENT CARDS
   ============================== */
.event-card { position: relative; }

.event-card .card-img {
  height: 140px;
  background: linear-gradient(135deg, var(--adv-orange), var(--adv-pink));
}

.event-date {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .35rem .65rem;
  font-size: .7rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* ==============================
   CMS SECONDARY NAV
   ============================== */
.cms-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.cms-nav ul {
  list-style: none;
  display: flex;
  gap: .25rem;
}

.cms-nav a {
  display: block;
  padding: .85rem .75rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.cms-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.cms-nav a.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ==============================
   STATS
   ============================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-light);
  text-align: center;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border);
  box-shadow: var(--card-shadow-hover);
}

.stat-card .number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-card .label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-light);
  margin-top: .4rem;
}

/* ==============================
   TABLES
   ============================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-light);
}

th, td { padding: .75rem 1rem; text-align: left; font-size: .85rem; }

th {
  background: var(--border-light);
  font-weight: 650;
  color: var(--text);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:not(:last-child) td { border-bottom: 1px solid var(--border-light); }

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: #f9f9f8; }

/* ==============================
   FOOTER
   ============================== */
footer {
  background: var(--primary);
  color: var(--white);
  padding: 3.5rem 2rem;
  margin-top: 4rem;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--adv-orange), var(--adv-pink), var(--adv-purple));
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

footer h4 { margin-bottom: .85rem; font-size: .82rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
footer ul { list-style: none; }
footer ul li { margin-bottom: .45rem; font-size: .85rem; opacity: .6; }
footer a { color: var(--white); transition: opacity var(--transition); }
footer a:hover { color: var(--white); opacity: 1; text-decoration: underline; text-underline-offset: 3px; }

.footer-bottom {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .78rem;
  opacity: .4;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ==============================
   ALERT BANNER
   ============================== */
.alert-banner {
  background: var(--warning-bg);
  border-bottom: 1px solid #fde68a;
  padding: .6rem 2rem;
  font-size: .83rem;
  font-weight: 500;
  text-align: center;
  color: #92400e;
}

/* ==============================
   FORM ELEMENTS
   ============================== */
select, input[type=text], input[type=month], input[type=email], input[type=tel], textarea {
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  font-size: .88rem;
  transition: all var(--transition);
  background: var(--white);
  color: var(--text);
}

select:focus, input:focus, textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(213,67,40,.08);
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  nav ul { display: none; }
  .hero { padding: 3rem 1.5rem 2.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .container { padding: 1.5rem 1rem; }
  .results-layout { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .search-bar { border-radius: var(--radius-lg); }
}
