/* ============================================
   BTECH PDF VAULT - MAIN STYLES
   Aesthetic: Dark academic / utilitarian bold
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:ital,wght@0,400;0,500;1,400&family=Nunito:wght@400;600;700&display=swap');

:root {
  --bg: #0d0f14;
  --bg2: #13161e;
  --bg3: #1a1e2a;
  --border: #252a38;
  --accent: #f0c040;
  --accent2: #e8734a;
  --text: #e8eaf0;
  --text2: #8892a4;
  --text3: #4a5568;
  --success: #4ade80;
  --danger: #f87171;
  --card-hover: #1e2330;
}

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

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

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

/* ---- NAVBAR ---- */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--text2);
  font-weight: 400;
}

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

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--text2);
}

.nav-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

/* ---- BUTTONS ---- */
.btn {
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary {
  background: var(--accent);
  color: #0d0f14;
}

.btn-primary:hover {
  background: #f5d060;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-google {
  background: white;
  color: #333;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.btn-google:hover {
  background: #f5f5f5;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.btn-google img {
  width: 20px;
}

/* ---- TAGS ---- */
.tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  transition: all 0.15s;
}

.tag:hover, .tag.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240,192,64,0.08);
}

.tag-subject {
  background: rgba(232,115,74,0.12);
  border-color: rgba(232,115,74,0.3);
  color: var(--accent2);
}

/* ---- PDF CARD ---- */
.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  padding: 2rem;
}

.pdf-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.pdf-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.2s;
}

.pdf-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.pdf-card:hover::before {
  opacity: 1;
}

.pdf-icon {
  width: 48px;
  height: 48px;
  background: rgba(240,192,64,0.1);
  border: 1px solid rgba(240,192,64,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.pdf-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--text);
  line-height: 1.3;
}

.pdf-subject {
  font-size: 0.8rem;
  color: var(--accent2);
  font-family: 'DM Mono', monospace;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.pdf-meta {
  font-size: 0.75rem;
  color: var(--text3);
  margin-bottom: 0.75rem;
}

.pdf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.pdf-actions {
  display: flex;
  gap: 0.5rem;
}

/* ---- FILTERS ---- */
.filter-bar {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg2);
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-box .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 0.9rem;
}

.filter-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ---- HERO ---- */
.hero {
  padding: 3rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero h1 .highlight {
  color: var(--accent);
}

.hero p {
  color: var(--text2);
  max-width: 500px;
  font-size: 0.95rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--accent);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  transform: translateY(20px);
  transition: transform 0.2s;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

/* ---- FORMS ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 0.4rem;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group select option {
  background: var(--bg3);
}

/* ---- UPLOAD ZONE ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(240,192,64,0.04);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.upload-zone p {
  color: var(--text2);
  font-size: 0.9rem;
}

.upload-zone small {
  color: var(--text3);
  font-size: 0.78rem;
  margin-top: 0.3rem;
  display: block;
}

/* ---- PROGRESS BAR ---- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.75rem;
  display: none;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text3);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.empty-state h3 {
  font-family: 'Syne', sans-serif;
  color: var(--text2);
  margin-bottom: 0.5rem;
}

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  z-index: 999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

/* ---- SECTIONS ---- */
.section-header {
  padding: 1.5rem 2rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--accent);
  border-radius: 2px;
}

/* ---- TABS ---- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  gap: 0;
}

.tab {
  padding: 1rem 1.5rem;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}

.tab:hover { color: var(--text2); }

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(240,192,64,0.06) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(232,115,74,0.05) 0%, transparent 70%);
  bottom: -50px;
  left: -50px;
  pointer-events: none;
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-card .logo-big {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}

.login-card .tagline {
  color: var(--text3);
  font-size: 0.875rem;
  margin-bottom: 2.5rem;
  font-family: 'DM Mono', monospace;
}

.login-divider {
  text-align: center;
  color: var(--text3);
  font-size: 0.8rem;
  margin: 1.5rem 0;
  position: relative;
}

.login-divider::before,
.login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.login-divider::before { left: 0; }
.login-divider::after { right: 0; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .pdf-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .hero h1 { font-size: 1.75rem; }
  .hero-stats { gap: 1rem; }
  .navbar { padding: 0 1rem; }
  .filter-bar { padding: 1rem; }
}

/* ---- LOADING ---- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  gap: 0.5rem;
  color: var(--text3);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- BADGE ---- */
.badge {
  background: var(--accent);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-family: 'DM Mono', monospace;
}

/* ---- VIEWER ---- */
.viewer-header {
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
}

.viewer-frame {
  width: 100%;
  height: calc(100vh - 120px);
  border: none;
  background: #fff;
}

/* Card saved indicator */
.saved-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  margin-left: 0.3rem;
}
