/* ==============================================
   PAST PAPERS PAGE - COMPLETE CSS
   MediBrain | 2026
   ============================================== */

:root {
  --primary-green: #10b981;
  --dark-green: #065f46;
  --light-green: #ecfdf5;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --white: #ffffff;
  --transition: all 0.3s ease;
}

/* Ensure Bootstrap Icons work */
.bi::before {
  font-family: 'bootstrap-icons' !important;
  font-style: normal;
  font-weight: normal !important;
  display: inline-block;
}

/* ==============================================
   HERO SECTION
   ============================================== */

.papers-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 120px 0 80px;
}

/* Hero Background */
.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top left, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
              radial-gradient(ellipse at bottom right, rgba(16, 185, 129, 0.12) 0%, transparent 50%),
              linear-gradient(135deg, #eff6ff 0%, #ffffff 50%, #f0fdf4 100%);
}

/* Floating Papers Animation */
.floating-papers {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.paper-icon {
  position: absolute;
  font-size: 4rem;
  color: rgba(59, 130, 246, 0.08);
  animation: floatPaper 20s ease-in-out infinite;
}

.paper-1 {
  top: 15%;
  left: 5%;
  animation-delay: 0s;
}

.paper-2 {
  top: 60%;
  right: 10%;
  animation-delay: 7s;
  color: rgba(16, 185, 129, 0.08);
}

.paper-3 {
  bottom: 20%;
  left: 15%;
  animation-delay: 14s;
  color: rgba(139, 92, 246, 0.08);
}

@keyframes floatPaper {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, -20px) rotate(5deg);
  }
  50% {
    transform: translate(-10px, 10px) rotate(-3deg);
  }
  75% {
    transform: translate(15px, -15px) rotate(4deg);
  }
}

/* Hero Content */
.papers-hero .container {
  position: relative;
  z-index: 2;
}

.breadcrumb-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb-custom a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb-custom a:hover {
  color: var(--primary-green);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #1e40af;
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease;
}

.hero-badge i {
  font-size: 1.3rem;
  color: var(--blue);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease 0.2s backwards;
}

.gradient-text {
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 50%, var(--primary-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;
  animation: gradientShift 4s ease infinite;
  background-size: 200% 200%;
}

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

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 600px;
  animation: fadeInUp 0.8s ease 0.4s backwards;
}

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

/* Hero Stats */
.hero-stats-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.6s backwards;
}

.stat-box {
  display: flex;
  flex-direction: column;
  padding: 15px 25px;
  background: white;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.stat-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Hero Actions */
.hero-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.8s backwards;
}

.hero-actions .btn {
  padding: 14px 30px;
  font-weight: 700;
  border-radius: 12px;
  transition: var(--transition);
}

/* Hero Visual */
.hero-visual {
  animation: fadeInRight 1s ease 0.5s backwards;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.paper-stack {
  position: relative;
  height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.paper-sheet {
  position: absolute;
  width: 280px;
  padding: 30px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  transition: var(--transition);
}

.paper-sheet:hover {
  transform: translateY(-20px) scale(1.05);
  box-shadow: 0 30px 80px rgba(59, 130, 246, 0.25);
  z-index: 10;
}

.paper-sheet i {
  font-size: 3rem;
  margin-bottom: 15px;
  display: block;
}

.paper-sheet h6 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-main);
}

.paper-sheet p {
  color: var(--text-muted);
  margin: 0;
}

.sheet-1 {
  top: 10%;
  left: 0;
  transform: rotate(-5deg);
  animation: float 6s ease-in-out infinite;
}

.sheet-1 i {
  color: var(--blue);
}

.sheet-2 {
  top: 50%;
  transform: translateY(-50%) rotate(2deg);
  left: 50%;
  margin-left: -140px;
  z-index: 2;
  animation: float 6s ease-in-out infinite 2s;
}

.sheet-2 i {
  color: var(--primary-green);
}

.sheet-3 {
  bottom: 10%;
  right: 0;
  transform: rotate(5deg);
  animation: float 6s ease-in-out infinite 4s;
}

.sheet-3 i {
  color: var(--purple);
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(var(--rotation, 0deg));
  }
  50% {
    transform: translateY(-15px) rotate(var(--rotation, 0deg));
  }
}

/* ==============================================
   EXAM BOARDS SECTION
   ============================================== */

.exam-boards-section {
  padding: 80px 0;
  background: #f9fafb;
}

.section-header {
  margin-bottom: 3rem;
}

.section-header.text-center {
  text-align: center;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
}

.exam-boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
}

.exam-board-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.exam-board-card:hover {
  transform: translateY(-8px);
  border-color: var(--blue);
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

.board-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--blue);
}

.exam-board-card h4 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-main);
}

.exam-board-card p {
  color: var(--text-muted);
  margin-bottom: 15px;
}

.board-info {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--primary-green);
  font-weight: 600;
}

.board-info i {
  font-size: 1rem;
}

/* ==============================================
   FILTER SECTION
   ============================================== */

.filter-section {
  padding: 60px 0;
  background: white;
}

.filter-card {
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
  border: 2px solid #e5e7eb;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.filter-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 30px;
  color: var(--text-main);
  display: flex;
  align-items: center;
}

.filter-grid {
  display: grid;
  gap: 25px;
  margin-bottom: 30px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-group label {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1rem;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: var(--transition);
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--blue);
  background: rgba(59, 130, 246, 0.05);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.filter-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 2px solid #e5e7eb;
}

/* ==============================================
   PAPERS LISTING
   ============================================== */

.papers-listing-section {
  padding: 80px 0;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.results-header h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.sort-options {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-options label {
  font-weight: 600;
  color: var(--text-main);
}

.sort-options .form-select {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 15px;
  font-weight: 600;
  min-width: 180px;
}

.sort-options .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

/* Papers Grid */
.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
}

.paper-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.paper-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: var(--blue);
}

.paper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0;
}

.paper-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-gcse {
  background: #dbeafe;
  color: #2563eb;
}

.badge-alevel {
  background: #fce7f3;
  color: #db2777;
}

.badge-board {
  background: #f3f4f6;
  color: var(--text-main);
}

.paper-year {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-muted);
}

.paper-icon-display {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px 20px;
  font-size: 4rem;
  color: var(--blue);
}

.paper-content {
  padding: 0 20px 20px;
  flex: 1;
}

.paper-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-main);
}

.paper-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.paper-meta i {
  color: var(--primary-green);
}

.divider {
  color: #d1d5db;
}

.paper-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.paper-downloads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.download-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
  font-weight: 600;
}

.download-btn:hover {
  border-color: var(--primary-green);
  background: var(--light-green);
  transform: translateY(-3px);
  color: var(--dark-green);
}

.download-btn i {
  font-size: 1.8rem;
  color: var(--primary-green);
}

.download-btn span {
  font-size: 0.9rem;
}

.download-btn small {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 80px 20px;
}

.no-results i {
  font-size: 5rem;
  color: #d1d5db;
  margin-bottom: 1.5rem;
}

.no-results h4 {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.no-results p {
  color: var(--text-muted);
}

/* ==============================================
   HOW TO USE SECTION
   ============================================== */

.how-to-use-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.how-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  transition: var(--transition);
  height: 100%;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.how-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.15);
  border-color: var(--primary-green);
}

.step-number {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-green), #059669);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
}

.how-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--primary-green);
}

.how-card h4 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-main);
}

.how-card p {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.how-tip-card {
  background: linear-gradient(135deg, var(--primary-green), #059669);
  border-radius: 20px;
  padding: 30px;
  margin-top: 40px;
  color: white;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.how-tip-card i {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.how-tip-card h5 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.how-tip-card p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.95;
}

/* ==============================================
   CTA SECTION
   ============================================== */

.cta-section {
  padding: 80px 0;
}

.cta-card {
  background: linear-gradient(135deg, var(--blue), #2563eb);
  border-radius: 24px;
  padding: 50px;
  color: white;
  box-shadow: 0 20px 60px rgba(59, 130, 246, 0.3);
}

.cta-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1rem;
  color: white;
}

.cta-text {
  font-size: 1.1rem;
  margin: 0;
  opacity: 0.95;
}

.cta-card .btn-light {
  background: white;
  color: var(--blue);
  border: none;
  font-weight: 700;
}

.cta-card .btn-light:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */

@media (max-width: 991px) {
  .papers-hero {
    min-height: auto;
    padding: 100px 0 60px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
  }

  .paper-stack {
    height: 350px;
    margin-top: 3rem;
  }

  .paper-sheet {
    width: 220px;
    padding: 20px;
  }

  .section-title {
    font-size: 2rem;
  }

  .filter-card {
    padding: 30px;
  }

  .papers-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-stats-row {
    gap: 1rem;
  }

  .stat-box {
    flex: 1;
    min-width: 100px;
  }

  .paper-stack {
    display: none;
  }

  .exam-boards-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .filter-card {
    padding: 25px;
  }

  .filter-title {
    font-size: 1.5rem;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .papers-grid {
    grid-template-columns: 1fr;
  }

  .cta-card {
    padding: 30px;
  }

  .cta-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-stats-row {
    width: 100%;
  }

  .stat-box {
    flex: 1 1 100%;
  }

  .filter-buttons {
    flex-direction: column;
  }

  .filter-btn {
    width: 100%;
    text-align: center;
  }

  .filter-actions {
    flex-direction: column;
  }

  .filter-actions .btn {
    width: 100%;
  }

  .section-title {
    font-size: 1.8rem;
  }
}