/* Custom styles for schemes.co.ke - Elimu Library */
/* Kenya's Premier Education Resources Platform */

:root {
  --primary-color: #0d7a5f;
  --secondary-color: #28a745;
  --accent_color: #4a9eff;
  --dark_color: #212529;
  --light_color: #f8f9fa;
  --border_radius: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
}

/* Added explicit icon font-family to ensure Font Awesome loads */
.fas,
.far,
.fal,
.fat,
.fad,
.fab {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
  font-weight: 900;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.fab {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400;
}

/* Ensure icons are visible */
i[class^="fa"],
i[class*=" fa"] {
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Updated header styles to match the UI design */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-bar {
  background: #0d7a5f;
  color: white;
  padding: 8px 0;
  font-size: 13px;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-info,
.top-links {
  display: flex;
  gap: 20px;
}

.contact-info span,
.top-links span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Cart Icon Styling in Top Bar */
.cart-link {
  position: relative;
  color: white;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.cart-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.cart-link i {
  font-size: 18px;
}

/* Cart icon image styling */
.cart-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #dc3545;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.main-nav {
  background: white;
  border-bottom: 1px solid #e0e0e0;
}

/* Added resources navigation ribbon styling matching screenshot */
.resources-ribbon {
  background-color: #0d7a5f;
  border-bottom: 2px solid #0a5f4a;
  padding: 0;
  font-size: 14px;
  margin-bottom: 0; /* Add this to remove bottom margin */
}
.resources-ribbon-content {
  display: flex;
  align-items: center;
  gap: 0;
}

.back-btn {
  background: none;
  border: none;
  color: white;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.back-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.resources-links {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
}

.resources-links::-webkit-scrollbar {
  display: none;
}

.resources-link {
  color: white;
  text-decoration: none;
  padding: 12px 20px;
  white-space: nowrap;
  transition: all 0.3s ease;
  font-weight: 500;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.resources-link:last-child {
  border-right: none;
}

.resources-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #0d7a5f;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 5px;
  align-items: center;
}

.nav-link {
  padding: 8px 15px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  white-space: nowrap;
}

.nav-link:hover {
  color: #0d7a5f;
  background: #f0f9f7;
  border-radius: 4px;
}

.btn-register {
  background: #0d7a5f;
  color: white !important;
  border-radius: 4px;
}

.btn-register:hover {
  background: #0a5f4a;
}

/* Enhanced hamburger menu button with animated icon */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: relative;
  width: 40px;
  height: 40px;
}

.hamburger-line {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #0d7a5f;
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.mobile-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.mobile-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.mobile-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* Enhanced mobile menu with slide-in animation and overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-menu-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  background: white;
}

.mobile-logo {
  font-size: 20px;
  font-weight: 700;
  color: #0d7a5f;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #333;
  cursor: pointer;
  padding: 5px;
  transition: all 0.3s ease;
}

.mobile-close:hover {
  color: #0d7a5f;
  transform: rotate(90deg);
}

/* Mobile cart link styling */
.mobile-cart-link {
  position: relative;
  background: linear-gradient(135deg, #0d7a5f 0%, #0a5f4a 100%);
  color: white !important;
  margin: 10px 20px;
  border-radius: 8px;
  padding: 12px 20px !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-cart-link:hover {
  background: linear-gradient(135deg, #0a5f4a 0%, #085239 100%) !important;
  transform: translateX(5px);
}

.mobile-cart-badge {
  background-color: #dc3545;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  margin-left: auto;
  animation: pulse 2s infinite;
}

/* Footer styles matching the dark design from screenshots */
.site-footer {
  background: #1a1a1a;
  color: #ccc;
  padding: 50px 0 20px;
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}

.footer-section h3 {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
}

.footer-section p {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 10px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: #ccc;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.3s;
}

.footer-section ul li a:hover {
  color: #4a9eff;
}

.footer-logo {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main content area - UPDATED */
.main-content {
  min-height: calc(100vh - 400px);
  padding-top: 0;
  margin-top: 0; /* Add this */
}

/* Category Grid Section - UPDATED */
.category-grid {
  background: #f5f5f5;
  padding: 15px 0 30px; /* Keep existing padding */
  margin-top: 0; /* Add this to remove any top margin */
}

.category-grid h2 {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  margin-top: 0; /* Keep this */
  padding-top: 0; /* Add this to ensure no top padding */
  color: #333;
}
/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  min-height: 500px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,106.7C1248,96,1344,96,1392,96L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>')
    no-repeat bottom;
  background-size: cover;
  opacity: 0.3;
}

.hero-section .container {
  position: relative;
  z-index: 1;
}

/* Search Box */
.search-box {
  position: relative;
  max-width: 600px;
}

.search-box input {
  border-radius: 50px;
  padding: 15px 25px;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-box button {
  border-radius: 50px;
  padding: 15px 30px;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 60px;
  background: white;
  border-radius: var(--border_radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  margin-top: 10px;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:hover {
  background-color: var(--light_color);
}

/* Category Cards */
.category-card {
  transition: var(--transition);
  border-radius: var(--border_radius);
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Category icon container - UPDATED for better visibility */
.category-icon {
    width: 50px;
    height: 50px;
    background: #e8f5f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0d7a5f;
    font-size: 20px;
    flex-shrink: 0;
    padding: 10px; /* Added padding for better icon spacing */
}
/* Custom icon image styling - INCREASED SIZE */
.category-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}
/* Fallback for Font Awesome icons */
.category-icon i {
    font-size: 24px;
}
/* Additional enhancement: make icon more prominent on hover */
.category-card:hover .category-icon {
    background: #d0ede5;
    transform: scale(1.1);
    transition: all 0.3s ease;
}
.category-card:hover .category-icon img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* File Cards */
.file-card {
  transition: var(--transition);
  border-radius: var(--border_radius);
}

.file-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.hover-lift {
  transition: var(--transition);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

/* Navbar */
.navbar {
  padding: 1rem 0;
  transition: var(--transition);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

/* Buttons */
.btn {
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 600;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #0052a3;
  border-color: #0052a3;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

/* Badges */
.badge {
  padding: 6px 12px;
  font-weight: 600;
  border-radius: 6px;
}

/* Breadcrumb */
.breadcrumb {
  background-color: transparent;
  padding: 1rem 0;
}

.breadcrumb-item a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

footer a {
  transition: var(--transition);
}

footer a:hover {
  color: var(--primary-color) !important;
  transform: translateX(5px);
}

.social-links a {
  display: inline-block;
  transition: var(--transition);
}

.social-links a:hover {
  transform: translateY(-3px);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section {
    min-height: 400px;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .category-card {
    margin-bottom: 1rem;
  }

  /* Mobile responsive for resources ribbon */
  .resources-ribbon {
    overflow-x: auto;
  }

  .resources-ribbon-content {
    width: max-content;
    min-width: 100%;
  }

  .back-btn {
    position: sticky;
    left: 0;
    background-color: #0d7a5f;
    z-index: 1;
  }

  .resources-links {
    flex-wrap: nowrap;
  }

  .resources-link {
    font-size: 13px;
    padding: 12px 15px;
  }

  /* Enhanced mobile navigation with slide-in animation */
  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 350px;
    height: 100vh;
    background: white;
    flex-direction: column;
    padding: 0;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
  }

  .mobile-menu-header {
    display: flex;
  }

  .nav-link {
    padding: 15px 20px !important;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
  }

  .nav-link:hover {
    background: #f0f9f7;
    padding-left: 30px !important;
    border-radius: 0;
  }

  .btn-register {
    margin: 10px 20px;
    border-radius: 8px;
    text-align: center;
  }

  .mobile-toggle {
    display: block;
  }

  .top-bar-content {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .contact-info,
  .top-links {
    flex-direction: column;
    gap: 5px;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .categories-container {
    grid-template-columns: 1fr;
  }

  .resources-grid {
    grid-template-columns: 1fr;
  }
}

/* Loading Spinner */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Form Styles */
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Card Hover Effects */
.card {
  border-radius: var(--border_radius);
  overflow: hidden;
}

.card-img-top {
  transition: var(--transition);
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

/* Alert Styles */
.alert {
  border-radius: var(--border_radius);
  border: none;
}

/* Table Styles */
.table {
  border-radius: var(--border_radius);
  overflow: hidden;
}

.table thead {
  background-color: var(--primary-color);
  color: white;
}

/* Pagination */
.pagination .page-link {
  color: var(--primary-color);
  border-radius: 8px;
  margin: 0 3px;
}

.pagination .page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Authentication Pages Styling */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d7a5f 0%, #0a5f4a 100%);
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* Auth page wrapper with gradient background matching error404.php */
.auth-page-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 2rem 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card .card-body {
  padding: 3rem 2.5rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header i {
  font-size: 3.5rem;
  color: #0d7a5f;
  margin-bottom: 1rem;
  display: block;
  animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.auth-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: #6c757d;
  font-size: 0.95rem;
  margin: 0;
}

/* Form Styling */
.auth-form .form-group {
  margin-bottom: 1.5rem;
}

.auth-form .form-label {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.auth-form .form-control {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
}

.auth-form .form-control:focus {
  border-color: #0d7a5f;
  background-color: white;
  box-shadow: 0 0 0 0.2rem rgba(13, 122, 95, 0.15);
}

.auth-form .form-control::placeholder {
  color: #adb5bd;
}

.auth-form .input-group-text {
  background-color: #f8f9fa;
  border: 2px solid #e9ecef;
  color: #6c757d;
  border-radius: 8px;
}

.auth-form .input-group .form-control {
  border-left: none;
}

.auth-form .input-group .form-control:focus {
  border-left: 2px solid #0d7a5f;
}

.auth-form .input-group .btn {
  border: 2px solid #e9ecef;
  background-color: #f8f9fa;
  color: #6c757d;
  transition: all 0.3s ease;
}

.auth-form .input-group .btn:hover {
  background-color: #e9ecef;
  border-color: #0d7a5f;
  color: #0d7a5f;
}

/* Form Check (Checkbox/Radio) */
.auth-form .form-check {
  margin-bottom: 1rem;
}

.auth-form .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.25rem;
  border: 2px solid #e9ecef;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-form .form-check-input:checked {
  background-color: #0d7a5f;
  border-color: #0d7a5f;
}

.auth-form .form-check-input:focus {
  border-color: #0d7a5f;
  box-shadow: 0 0 0 0.2rem rgba(13, 122, 95, 0.15);
}

.auth-form .form-check-label {
  color: #495057;
  font-size: 0.95rem;
  cursor: pointer;
  margin-left: 0.5rem;
}

/* Add this to your style.css file - Additional spacing fixes */

/* Force remove all spacing between header and content */
.main-content {
  min-height: calc(100vh - 400px);
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Category Grid Section - Force remove top spacing */
.category-grid {
  background: #f5f5f5;
  padding: 5px 0 30px !important; /* Reduced to 5px top padding */
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.category-grid h2 {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  margin-top: 0 !important;
  padding-top: 0 !important;
  color: #333;
}

/* Resources ribbon - ensure no bottom margin */
.resources-ribbon {
  background-color: #0d7a5f;
  border-bottom: 2px solid #0a5f4a;
  padding: 0;
  font-size: 14px;
  margin-bottom: 0 !important;
}

/* Site header - ensure no bottom margin */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 0 !important;
}

/* Main nav - ensure no bottom margin */
.main-nav {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 0 !important;
}

/* Force any section immediately after header to have no top spacing */
.site-header + * {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* If category-grid is first element after header */
.site-header ~ .category-grid,
.main-content > .category-grid:first-child {
  margin-top: 0 !important;
  padding-top: 5px !important;
}