/* ════════════════════════════════════════════════════════════════════
   RBU PYQ Portal – style.css
   Google Material You 3 System + Branch Popup Modal & Guided Direct Page Flow
   College: Ramdeobaba University, Nagpur
   ════════════════════════════════════════════════════════════════════ */

/* ── Google Material Design 3 Color Tokens ───────────────────────────── */
:root {
  /* Dark Theme (Google Dark Mode #121212) */
  --bg-base:           #121212;
  --bg-surface:        #1e1e1e;
  --bg-elevated:       #28292c;
  --bg-hover:          #323337;
  --bg-chip:           #2d2e31;
  --bg-chip-active:    #3c4043;

  --border-color:      rgba(255, 255, 255, 0.12);
  --border-hover:      rgba(138, 180, 248, 0.5);

  /* Google Material Palette */
  --g-blue:            #8ab4f8;
  --g-blue-hover:      #a8c7fa;
  --g-blue-container:  #004a77;
  --g-green:           #c4eed0;
  --g-green-container: #0f5223;
  --g-yellow:          #fde293;
  --g-yellow-container:#5c4300;
  --g-red:             #f28b82;
  --g-red-container:   #8c1d18;

  --text-primary:      #e3e2e6;
  --text-secondary:    #c4c6d0;
  --text-muted:        #909094;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Google Sans', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Google Sans', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;

  /* Shapes & Layout */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 9999px;

  --header-h: 64px;
  --max-w: 1400px;
  --px: 24px;
}

/* Light Theme (Google Material Light #ffffff) */
body.light-theme {
  --bg-base:           #f8f9fa;
  --bg-surface:        #ffffff;
  --bg-elevated:       #f1f3f4;
  --bg-hover:          #e8eaed;
  --bg-chip:           #f1f3f4;
  --bg-chip-active:    #e8f0fe;

  --border-color:      #dadce0;
  --border-hover:      #1a73e8;

  --g-blue:            #1a73e8;
  --g-blue-hover:      #1557b0;
  --g-blue-container:  #e8f0fe;
  --g-green:           #137333;
  --g-green-container: #e6f4ea;
  --g-yellow:          #b06000;
  --g-yellow-container:#fef7e0;
  --g-red:             #c5221f;
  --g-red-container:   #fce8e6;

  --text-primary:      #202124;
  --text-secondary:    #5f6368;
  --text-muted:        #80868b;
}

/* Base Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }

:focus-visible { outline: 2px solid var(--g-blue); outline-offset: 2px; }

.skip-link {
  position: absolute; top: -100px; left: 16px;
  background: var(--g-blue); color: #000;
  padding: 10px 20px; border-radius: var(--r-sm);
  z-index: 1000; font-weight: 700; transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }

/* ════════════════════════════════════════════════════════
   FIRST VISIT BRANCH POPUP MODAL (MIDDLE OF SCREEN)
════════════════════════════════════════════════════════ */
.branch-welcome-box {
  width: 100%; max-width: 860px; max-height: 90vh;
  background: var(--bg-surface); border: 1px solid var(--border-hover);
  border-radius: var(--r-xl); padding: 32px; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.welcome-header { text-align: center; margin-bottom: 24px; }
.welcome-badge {
  display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--g-blue);
  background: var(--g-blue-container); padding: 4px 14px; border-radius: var(--r-pill); margin-bottom: 10px;
}
.welcome-title { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; color: var(--text-primary); }
.welcome-sub { font-size: 0.88rem; color: var(--text-muted); margin-top: 4px; }

.welcome-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px;
}
.branch-modal-card {
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  border-radius: var(--r-lg); padding: 16px; cursor: pointer;
  display: flex; align-items: center; gap: 12px; transition: all 0.2s ease;
}
.branch-modal-card:hover {
  background: var(--bg-hover); border-color: var(--g-blue);
  transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.branch-modal-icon {
  width: 38px; height: 38px; border-radius: var(--r-md);
  background: var(--g-blue-container); color: var(--g-blue);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0;
}
.branch-modal-name { font-family: var(--font-heading); font-size: 0.95rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; }

/* ════════════════════════════════════════════════════════
   HEADER BAR & GOOGLE AUTOCOMPLETE SEARCH
════════════════════════════════════════════════════════ */
.drive-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h); background: var(--bg-base);
  border-bottom: 1px solid var(--border-color);
}
.header-container {
  max-width: var(--max-w); height: 100%; margin: 0 auto; padding: 0 var(--px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand-box { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--g-blue-container); color: var(--g-blue);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 1.2rem;
}
.brand-title { font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem; }
.brand-sub { font-size: 0.72rem; color: var(--text-muted); display: block; margin-top: -3px; }

/* Search Omnibar */
.drive-search-bar { flex: 1; max-width: 620px; position: relative; }
.search-pill-box {
  display: flex; align-items: center; width: 100%; height: 46px;
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  border-radius: var(--r-pill); padding: 0 16px; transition: all 0.2s ease;
}
.search-pill-box:focus-within {
  background: var(--bg-surface); border-color: var(--g-blue);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}
.search-icon-svg { color: var(--text-muted); margin-right: 12px; flex-shrink: 0; }
.search-input-field {
  width: 100%; background: transparent; border: none; color: var(--text-primary);
  font-size: 0.95rem; outline: none;
}
.search-clear-btn {
  color: var(--text-muted); font-size: 1.1rem; cursor: pointer; padding: 4px;
  display: none; transition: color 0.2s ease;
}
.search-clear-btn:hover { color: var(--text-primary); }

/* FLOATING GOOGLE-STYLE AUTOCOMPLETE DROPDOWN */
.search-suggestions-dropdown {
  position: absolute; top: 52px; left: 0; right: 0; z-index: 200;
  background: var(--bg-surface); border: 1px solid var(--border-hover);
  border-radius: var(--r-lg); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-height: 380px; overflow-y: auto; padding: 8px 0;
}
.sug-item {
  padding: 10px 18px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: background 0.15s ease; font-size: 0.9rem;
}
.sug-item:hover, .sug-item.selected {
  background: var(--bg-hover); color: var(--g-blue);
}
.sug-title { font-weight: 600; color: var(--text-primary); }
.sug-sub { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.sug-badge {
  font-size: 0.72rem; font-weight: 700; color: var(--g-blue);
  background: var(--g-blue-container); padding: 2px 8px; border-radius: var(--r-pill);
}

/* Header Controls */
.header-controls { display: flex; align-items: center; gap: 8px; }
.drive-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--r-pill);
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  color: var(--text-primary); font-size: 0.85rem; font-weight: 600;
  transition: background 0.2s ease;
}
.drive-btn:hover { background: var(--bg-hover); }
.badge-count {
  background: var(--g-yellow-container); color: var(--g-yellow);
  font-weight: 800; font-size: 0.72rem; padding: 2px 8px; border-radius: var(--r-pill);
}

/* ════════════════════════════════════════════════════════
   MAIN WRAPPER & CATEGORY TABS
════════════════════════════════════════════════════════ */
.main-wrapper { max-width: var(--max-w); margin: 0 auto; padding: 24px var(--px) 80px; }

.category-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tab-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: var(--r-pill);
  background: var(--bg-chip); border: 1px solid var(--border-color);
  color: var(--text-secondary); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
}
.tab-chip:hover { background: var(--bg-hover); color: var(--text-primary); }
.tab-chip.active {
  background: var(--g-blue-container); color: var(--g-blue);
  border-color: var(--g-blue); font-weight: 700;
}

/* RECENT PAPERS WIDGET */
.recent-widget {
  margin-bottom: 28px; padding: 16px 20px; background: var(--bg-surface);
  border: 1px solid var(--border-color); border-radius: var(--r-xl);
}
.recent-title-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.recent-title { font-family: var(--font-heading); font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.recent-scroll-box {
  display: flex; align-items: center; gap: 12px; overflow-x: auto; padding-bottom: 4px;
}
.recent-item-chip {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 8px 14px; border-radius: var(--r-lg); background: var(--bg-elevated);
  border: 1px solid var(--border-color); color: var(--text-primary); font-size: 0.83rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s ease; max-width: 240px;
}
.recent-item-chip:hover { background: var(--bg-hover); border-color: var(--g-blue); }

/* BREADCRUMBS & SECTION HEADER */
.nav-action-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-pill);
  background: var(--g-blue-container); color: var(--g-blue);
  font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.2s ease;
}
.btn-back:hover { background: var(--g-blue); color: #000; }

.bc-list { display: flex; align-items: center; gap: 6px; list-style: none; flex-wrap: wrap; }
.bc-item { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--text-muted); }
.bc-item button { color: var(--g-blue); font-weight: 600; }
.bc-item span { color: var(--text-primary); font-weight: 700; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color);
}
.head-title { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; }
.head-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.head-controls-right { display: flex; align-items: center; gap: 10px; }
.head-badge {
  font-size: 0.8rem; font-weight: 700; color: var(--g-blue);
  background: var(--g-blue-container); padding: 4px 12px; border-radius: var(--r-pill);
}

.view-toggle-btn {
  padding: 6px 12px; border-radius: var(--r-md); background: var(--bg-elevated);
  border: 1px solid var(--border-color); color: var(--text-secondary);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.view-toggle-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

/* FILTERS BAR */
.filters-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 24px;
  padding: 12px 16px; background: var(--bg-surface);
  border: 1px solid var(--border-color); border-radius: var(--r-lg);
}
.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-lbl { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

.m3-select {
  height: 36px; padding: 0 28px 0 12px;
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  border-radius: var(--r-md); color: var(--text-primary); font-size: 0.83rem; font-weight: 600;
  outline: none; cursor: pointer;
}
.m3-input {
  height: 36px; padding: 0 12px; min-width: 160px;
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  border-radius: var(--r-md); color: var(--text-primary); font-size: 0.83rem; outline: none;
}
.btn-reset-m3 {
  padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--g-red-container); color: var(--g-red);
  font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s ease;
}

/* DRIVE GRID / LIST VIEWS */
.drive-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.drive-grid.list-view-mode { grid-template-columns: 1fr; }

.drive-card {
  background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: var(--r-lg); padding: 20px; cursor: pointer;
  transition: all 0.2s ease; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 150px;
}
.drive-card:hover {
  background: var(--bg-elevated); border-color: var(--border-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.folder-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.folder-icon-box {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--g-blue-container); color: var(--g-blue);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.folder-title { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.folder-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.folder-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border-color); font-size: 0.78rem; color: var(--text-muted);
}

.file-card-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.pdf-icon-badge {
  width: 38px; height: 38px; border-radius: var(--r-md);
  background: var(--g-red-container); color: var(--g-red);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.85rem; flex-shrink: 0;
}
.file-title { font-family: var(--font-heading); font-weight: 700; font-size: 1rem; line-height: 1.35; color: var(--text-primary); }
.file-crumb { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.chip { padding: 3px 8px; border-radius: var(--r-sm); font-size: 0.72rem; font-weight: 700; }
.chip-year { background: var(--g-yellow-container); color: var(--g-yellow); }
.chip-regular { background: var(--g-green-container); color: var(--g-green); }
.chip-makeup { background: var(--g-red-container); color: var(--g-red); }
.chip-sem { background: var(--g-blue-container); color: var(--g-blue); }
.chip-branch { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border-color); }

.file-card-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border-color);
}
.action-view-btn { color: var(--g-blue); font-weight: 700; font-size: 0.82rem; }
.star-icon-btn { font-size: 1.1rem; color: var(--text-muted); cursor: pointer; }
.star-icon-btn.active { color: var(--g-yellow); }

/* MODAL & VIEWER */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  width: 100%; max-width: 1100px; height: 90vh;
  background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: var(--r-xl); display: flex; flex-direction: column; overflow: hidden;
}
.modal-header { padding: 14px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; }
.modal-body { flex: 1; background: #000; }
.modal-body iframe { width: 100%; height: 100%; border: none; }

/* LOADER & TOAST */
.loader-overlay { position: fixed; inset: 0; z-index: 999; background: var(--bg-base); display: flex; align-items: center; justify-content: center; transition: opacity 0.3s ease; }
.spinner { width: 44px; height: 44px; margin: 0 auto 16px; border: 3px solid var(--border-color); border-top-color: var(--g-blue); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1000; background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-pill); padding: 8px 20px; font-weight: 600; font-size: 0.85rem; }

/* FOOTER */
.site-footer { border-top: 1px solid var(--border-color); padding: 32px var(--px); background: var(--bg-base); text-align: center; font-size: 0.82rem; color: var(--text-muted); }

@media (max-width: 768px) {
  .drive-grid { grid-template-columns: 1fr; }
  .drive-search-bar { display: none; }
}
