/* ================================================
   EduFlip — Global Stylesheet
   Design: Dark academic / editorial with amber accents
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

:root {
  --bg:        #0b1214;
  --surface:   #111a1d;
  --card:      #162025;
  --border:    rgba(4,103,122,0.18);
  --accent:    #04677a;
  --accent-lt: #0899b3;
  --warm:      #746f6b;
  --warm-lt:   #9c9793;
  --accent2:   #055f70;
  --text:      #e8eeef;
  --muted:     #746f6b;
  --danger:    #d94f4f;
  --success:   #2fa882;
  --radius:    6px;
  --shadow:    0 4px 32px rgba(0,0,0,0.5);
  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; }
a { color: var(--accent); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; }

/* ── Layout ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* ── NAV ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,18,20,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: .9rem; font-weight: 500; color: var(--muted); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); opacity: 1; }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.hamburger { display: none; background: none; border: none; cursor: pointer; color: var(--text); font-size: 1.4rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .9rem; font-weight: 600;
  cursor: pointer; border: none; transition: all .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #0f0e0b; }
.btn-primary:hover { background: #0899b3; opacity: 1; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 16px; font-size: .82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(4,103,122,.3); }
.card-body { padding: 24px; }
.card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 3rem; }

/* ── Grid ── */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.badge-free { background: rgba(76,175,130,.15); color: var(--success); }
.badge-premium { background: rgba(4,103,122,.18); color: var(--accent); }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .05em; }
.form-control {
  width: 100%; padding: 11px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font-body); font-size: .95rem;
  transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-control::placeholder { color: var(--muted); }
.form-error { font-size: .82rem; color: var(--danger); margin-top: 5px; }
.form-hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }

/* ── Alerts ── */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: .9rem; }
.alert-success { background: rgba(76,175,130,.1); border: 1px solid rgba(76,175,130,.3); color: var(--success); }
.alert-error   { background: rgba(217,79,79,.1); border: 1px solid rgba(217,79,79,.3); color: var(--danger); }
.alert-info    { background: rgba(4,103,122,.08); border: 1px solid rgba(4,103,122,.3); color: var(--accent); }

/* ── Hero ── */
.hero { padding: 100px 0 80px; position: relative; overflow: hidden; }
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 60% 40%, rgba(4,103,122,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow { font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 16px; }
.hero-title { font-size: clamp(2.4rem, 5vw, 4rem); color: var(--text); margin-bottom: 20px; }
.hero-title em { color: var(--accent); font-style: italic; }
.hero-desc { font-size: 1.05rem; color: var(--muted); max-width: 520px; margin-bottom: 36px; line-height: 1.8; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-split { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
@media (max-width: 768px) { .hero-split { grid-template-columns: 1fr; } .hero { padding: 60px 0 50px; } }

/* ── Section heading ── */
.section-heading { text-align: center; margin-bottom: 56px; }
.section-heading .overline { font-size: .8rem; text-transform: uppercase; letter-spacing: .15em; color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.section-heading h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
.section-heading p { color: var(--muted); max-width: 520px; margin: 14px auto 0; }

/* ── PDF Card ── */
.pdf-card { display: flex; flex-direction: column; }
.pdf-card .cover {
  height: 160px; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem; position: relative;
  border-bottom: 1px solid var(--border);
}
.pdf-card .cover .badge { position: absolute; top: 10px; right: 10px; }
.pdf-card .info { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.pdf-card .pdf-title { font-family: var(--font-head); font-size: 1rem; line-height: 1.3; }
.pdf-card .pdf-desc { font-size: .82rem; color: var(--muted); flex: 1; }
.pdf-card .pdf-meta { font-size: .78rem; color: var(--muted); display: flex; gap: 14px; margin-top: 4px; }
.pdf-card .pdf-actions { padding: 0 20px 18px; display: flex; gap: 8px; }

/* ── Auth pages ── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-box {
  width: 100%; max-width: 440px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 44px 40px;
}
.auth-box h1 { font-size: 1.8rem; margin-bottom: 6px; }
.auth-box .subtitle { color: var(--muted); font-size: .9rem; margin-bottom: 32px; }
.auth-divider { text-align: center; margin: 20px 0; position: relative; color: var(--muted); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--border); }
.auth-divider::before { left: 0; } .auth-divider::after { right: 0; }

/* ── Dashboard ── */
.dash-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.dash-sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 32px 0; }
.dash-sidebar .sidebar-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 0 20px; margin-bottom: 8px; margin-top: 24px; }
.dash-sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--muted); font-size: .9rem; font-weight: 500; transition: all .2s; }
.dash-sidebar a:hover, .dash-sidebar a.active { color: var(--text); background: rgba(255,255,255,.04); opacity: 1; }
.dash-sidebar a.active { border-left: 3px solid var(--accent); padding-left: 17px; color: var(--accent); }
.dash-main { padding: 40px; overflow-y: auto; }
.dash-header { margin-bottom: 36px; }
.dash-header h1 { font-size: 1.8rem; }
.dash-header p { color: var(--muted); }
.stat-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.stat-card .stat-val { font-family: var(--font-head); font-size: 2rem; color: var(--accent); line-height: 1; }
.stat-card .stat-label { font-size: .82rem; color: var(--muted); margin-top: 6px; }
@media (max-width: 900px) { .dash-layout { grid-template-columns: 1fr; } .dash-sidebar { display: none; } .stat-bar { grid-template-columns: repeat(2, 1fr); } }

/* ── Flip Viewer ── */
.viewer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.viewer-toolbar { position: absolute; top: 0; left: 0; right: 0; height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 12px; z-index: 1; }
.viewer-toolbar .title { flex: 1; font-family: var(--font-head); font-size: 1rem; }
.viewer-close { background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; padding: 8px; }
.book-container { position: relative; margin-top: 56px; height: calc(100vh - 56px); display: flex; align-items: center; justify-content: center; }
.book-spread { display: flex; gap: 0; box-shadow: 0 20px 80px rgba(0,0,0,.7); }
.book-page {
  width: min(42vw, 380px); height: min(56vw, 520px);
  background: #fff; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.book-page iframe { width: 100%; height: 100%; border: none; }
.book-page.left { border-right: 2px solid rgba(0,0,0,.15); transform-origin: right center; }
.book-page.right { transform-origin: left center; }
.book-page.turning-left { animation: flipLeft .5s ease-in-out forwards; }
.book-page.turning-right { animation: flipRight .5s ease-in-out forwards; }
@keyframes flipLeft { 0%{transform:rotateY(0)} 100%{transform:rotateY(-180deg)} }
@keyframes flipRight { 0%{transform:rotateY(0)} 100%{transform:rotateY(180deg)} }
.book-nav { position: absolute; bottom: 24px; display: flex; gap: 16px; align-items: center; }
.book-nav button { background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: 4px; padding: 8px 20px; cursor: pointer; font-family: var(--font-body); font-size: .9rem; transition: all .2s; }
.book-nav button:hover { border-color: var(--accent); color: var(--accent); }
.book-nav .page-info { font-size: .85rem; color: var(--muted); min-width: 90px; text-align: center; }

/* ── Services section ── */
.service-card { padding: 32px; }
.service-icon { font-size: 2.2rem; margin-bottom: 16px; display: block; }
.service-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.service-card p { font-size: .88rem; color: var(--muted); line-height: 1.7; }

/* ── Footer ── */
footer { background: var(--surface); border-top: 1px solid var(--border); padding: 60px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-brand p { color: var(--muted); font-size: .88rem; max-width: 280px; margin-top: 10px; line-height: 1.8; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 16px; }
.footer-col a { display: block; color: var(--muted); font-size: .88rem; margin-bottom: 8px; transition: color .2s; }
.footer-col a:hover { color: var(--text); opacity: 1; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; justify-content: space-between; color: var(--muted); font-size: .82rem; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } .footer-bottom { flex-direction: column; gap: 8px; } }

/* ── Misc ── */
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.divider { height: 1px; background: var(--border); margin: 40px 0; }
.lock-overlay { position: absolute; inset: 0; background: rgba(11,18,20,.75); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; backdrop-filter: blur(2px); }
.lock-overlay .lock-icon { font-size: 2rem; }
.lock-overlay p { font-size: .82rem; color: var(--muted); }

/* ── Page header strip ── */
.page-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 48px 0 40px; }
.page-header h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.page-header p { color: var(--muted); margin-top: 8px; }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: 12px 16px; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: var(--bg); } ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
