/* Dashboard Styles */
/* General Styles */
:root {
  --primary-color: #3a86ff;
  --primary-dark: #2667cc;
  --secondary-color: #8338ec;
  --accent-color: #ff006e;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --success-color: #38b000;
  --warning-color: #ffbe0b;
  --info-color: #3a86ff;
  --danger-color: #ff006e;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
  --transition-normal: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f7fc;
  color: var(--dark-color);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

/* Top Bar and Navigation */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  position: relative;
  box-shadow: var(--shadow-md);
}

.top-bar .logo {
  display: flex;
  align-items: center;
}

.top-bar .logo img {
  height: 40px;
  margin-right: 10px;
}

.top-bar .logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.navigation {
  display: flex;
  align-items: center;
}

.nav-item {
  margin-right: 20px;
  position: relative;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-normal);
  padding: 8px 12px;
  border-radius: 4px;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.nav-link i {
  margin-right: 5px;
}

.user-profile {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-weight: bold;
  color: var(--primary-color);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-weight: 500;
}

/* Dropdown Menu */
.dropdown {
  position: absolute;
  top: 60px;
  right: 20px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  border-radius: 8px;
  display: none;
  flex-direction: column;
  width: 200px;
  z-index: 100;
  overflow: hidden;
  animation: dropdown-fade 0.3s ease;
}

@keyframes dropdown-fade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown a {
  padding: 12px 16px;
  text-decoration: none;
  color: var(--dark-color);
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
}

.dropdown a i {
  margin-right: 10px;
  color: var(--primary-color);
}

.dropdown a:last-child {
  border-bottom: none;
}

.dropdown a:hover {
  background-color: #f8f9fa;
  color: var(--primary-color);
}

.dropdown.active {
  display: flex;
}

/* Dashboard Layout */
.dashboard-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
  background-color: #fff;
  box-shadow: var(--shadow-sm);
  padding: 20px 0;
}

.sidebar-section {
  margin-bottom: 25px;
}

.sidebar-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6c757d;
  padding: 0 20px;
  margin-bottom: 10px;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-item {
  padding: 10px 20px;
  transition: var(--transition-normal);
}

.sidebar-item:hover {
  background-color: #f8f9fa;
}

.sidebar-item.active {
  background-color: #ebf3ff;
  border-left: 3px solid var(--primary-color);
}

.sidebar-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--dark-color);
  font-size: 0.95rem;
}

.sidebar-link i {
  margin-right: 10px;
  color: #6c757d;
  width: 20px;
  text-align: center;
}

.sidebar-link:hover i,
.sidebar-item.active .sidebar-link i {
  color: var(--primary-color);
}

/* Main Content */
.main-content {
  padding: 25px;
  background-color: #f4f7fc;
}

.welcome-section {
  background: #fff;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.welcome-text h2 {
  font-size: 1.8rem;
  margin-bottom: 5px;
  color: var(--dark-color);
}

.welcome-text p {
  font-size: 1rem;
  color: #6c757d;
}

.welcome-actions .btn {
  padding: 8px 16px;
  border-radius: 6px;
  background-color: var(--primary-color);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-normal);
  display: inline-flex;
  align-items: center;
}

.welcome-actions .btn i {
  margin-right: 5px;
}

.welcome-actions .btn:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: #fff;
}

.stat-books { background-color: var(--primary-color); }
.stat-videos { background-color: var(--secondary-color); }
.stat-courses { background-color: var(--accent-color); }
.stat-progress { background-color: var(--success-color); }

.stat-card h3 {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.stat-card p {
  font-size: 0.9rem;
  color: #6c757d;
  margin: 0;
}

.learning-section h3 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: var(--dark-color);
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
}

.option {
  position: relative;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  overflow: hidden;
  height: 200px;
}

.option:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.option a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.option-header {
  height: 100px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  position: relative;
}

.option:nth-child(2) .option-header {
  background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
}

.option:nth-child(3) .option-header {
  background: linear-gradient(45deg, var(--accent-color), var(--warning-color));
}

.option-icon {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.option-icon img {
  width: 30px;
  height: 30px;
}

.option-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.option-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.option-description {
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.4;
}

.option-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  background-color: var(--warning-color);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 4px;
  font-weight: 500;
}

/* Blog Cards Section */
.blog-cards {
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 30px auto;
  max-width: 1200px;
  padding: 10px;
}

.blog-cards h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
  color: #222;
  position: relative;
}

.blog-cards h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #0073e6;
  margin: 8px auto 0;
  border-radius: 2px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.card a {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.card:hover .thumb img {
  transform: scale(1.05);
}

.card-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-content h3 {
  font-size: 1.1rem;
  margin: 0 0 10px 0;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.card-content p {
  font-size: 0.92rem;
  color: #555;
  margin: 0;
  line-height: 1.4;
}

.btn-center {
  text-align: center;
  margin-top: 15px;
}

.btn-read-more {
  display: inline-block;
  padding: 10px 18px;
  background: #0073e6;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.2s ease;
}

.btn-read-more:hover {
  background: #005bb5;
  transform: translateY(-2px);
}

/* Footer */
footer {
  background-color: #fff;
  padding: 20px 25px;
  text-align: center;
  font-size: 0.9rem;
  color: #6c757d;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Animations and Transitions */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Profile Page Specific Styles */
.card {
  background-color: #fff;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-sm);
}

.profile-header {
  text-align: center;
  margin-bottom: 30px;
}

.profile-image-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
}

.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--primary-color);
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.change-photo {
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: var(--primary-color);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  border: 2px solid #fff;
}

.change-photo:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

.card-title {
  color: var(--primary-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  font-size: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--dark-color);
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 111, 255, 0.2);
}

.form-control:disabled {
  background-color: #f2f2f2;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(74, 111, 255, 0.4);
}

.btn-block {
  display: block;
  width: 100%;
}

.text-muted {
  color: #6c757d;
  font-size: 14px;
}

.password-toggle {
  position: relative;
}

.password-toggle i {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #6c757d;
}

.password-requirements {
  background-color: #f8f9fa;
  padding: 10px 15px;
  border-radius: 4px;
  margin-top: 10px;
  font-size: 14px;
}

.password-requirements ul {
  padding-left: 20px;
  margin: 5px 0;
}

#profile_pic_input {
  display: none;
}

.alert {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.alert i {
  margin-right: 10px;
  font-size: 18px;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid var(--danger-color);
}

/* Responsive Design */
@media (max-width: 991px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .stats-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-section {
    grid-template-columns: 1fr;
  }

  .welcome-section {
    flex-direction: column;
    text-align: center;
  }

  .welcome-actions {
    margin-top: 15px;
  }

  .navigation .nav-item:not(:last-child) {
    display: none;
  }

  .main-content {
    padding: 15px;
  }

  .card {
    padding: 15px;
  }

  .profile-image-container, .profile-image {
    width: 100px;
    height: 100px;
  }

  .btn {
    padding: 10px 20px;
  }

  .change-photo {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  .top-bar {
    padding: 10px 15px;
  }

  .top-bar .logo-text {
    font-size: 1.2rem;
  }

  .card-title {
    font-size: 18px;
  }

  .form-control {
    padding: 10px 12px;
  }
}

/* ========================================
   Login/Registration Page Styles (index.php)
   ======================================== */

/* Login Page Body */
body.login-page {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-container {
  display: flex;
  width: 80%;
  max-width: 1000px;
  background: url('img/bg.jpg') no-repeat top right;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.info-side {
  flex: 1;
  padding: 40px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: top;
  position: relative;
  overflow: hidden;
}

.info-side h1 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.info-side p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  line-height: 1.6;
  position: relative;
  z-index: 2;
  opacity: 0.9;
}

.form-side {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-page .container {
  width: 100%;
  max-width: 400px;
  background: transparent;
  padding: 20px;
  text-align: center;
  margin: 0 auto;
}

.login-page .logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  position: relative;
}

.login-page .logo img {
  width: 100%;
  height: auto;
  transition: var(--transition-normal);
}

.login-page .logo:after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: #4361ee;
  border-radius: 3px;
}

.login-page h2 {
  margin: 0 0 10px;
  font-size: 1.8rem;
  color: #ffffff;
}

.welcome-message {
  color: #ffffff;
  margin-bottom: 30px;
  font-size: 1.1rem;
}

.login-page .form-group {
  position: relative;
  margin-bottom: 25px;
}

.login-page input {
  width: 90%;
  padding: 12px 15px;
  border: 1px solid #e1e1e1;
  border-radius: 6px;
  font-size: 1rem;
  transition: var(--transition-normal);
  background-color: #f9f9f9;
}

.login-page input:focus {
  outline: none;
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
  background-color: white;
}

.login-page button {
  width: 100%;
  padding: 12px;
  background: #4361ee;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.login-page button:hover {
  background: #3a56d4;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.login-page button:active {
  transform: translateY(0);
}

.alt-action {
  margin-top: 20px;
  font-size: 0.95rem;
  color: #6c757d;
}

.alt-action a {
  color: #4361ee;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-normal);
}

.alt-action a:hover {
  color: #3a56d4;
  text-decoration: underline;
}

.hidden {
  display: none;
}

/* Animation Classes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
  animation: fadeIn 0.5s ease forwards;
}

/* Error message styling */
.error-message {
  color: #dc3545;
  background-color: rgba(220, 53, 69, 0.1);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: left;
  font-size: 0.9rem;
  display: none;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile Responsiveness for Login Page */
@media (max-width: 768px) {
  .page-container {
    flex-direction: column;
    width: 95%;
  }

  .info-side {
    padding: 30px 20px;
    text-align: center;
  }

  .form-side {
    padding: 20px;
  }

  .login-page .container {
    padding: 10px;
  }

  .login-page h2 {
    font-size: 1.5rem;
  }

  .info-side h1 {
    font-size: 1.8rem;
  }
}

/* ========================================
   Mobile-Specific Fixes for All Pages
   ======================================== */

/* Mobile-specific fixes */
@media (max-width: 768px) {
  /* Prevent horizontal overflow */
  body {
    overflow-x: hidden;
  }

  /* Fix top bar */
  .top-bar {
    padding: 10px 15px;
    flex-wrap: wrap;
  }

  .top-bar .logo-text {
    font-size: 1rem;
  }

  .navigation {
    flex-wrap: wrap;
  }

  /* Fix horizontal tabs */
  .ebooks-tabs {
    margin-left: 0;
    margin-right: 0;
    padding: 10px 15px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .ebooks-tabs .tab {
    min-width: auto;
    flex-shrink: 0;
  }

  /* Fix main content width */
  .main-content {
    padding: 10px;
    width: 100%;
    overflow-x: hidden;
  }

  /* Fix tab content grid */
  .tab-content {
    width: 100%;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  /* Fix grid items */
  .grid-item {
    width: 100%;
    max-width: 100%;
  }

  .grid-item img {
    width: 100%;
    height: auto;
    max-height: 100px;
  }

  /* Fix chapter title */
  .chapter-title {
    font-size: 1.1rem;
    padding: 0 5px;
  }
}

@media (max-width: 576px) {
  .tab-content {
    grid-template-columns: 1fr !important; /* Change from "1fr 1fr" to just "1fr" */
    gap: 10px;
  }

  /* Ensure images don't overflow */
  .grid-item img {
    width: 100% !important;
    height: auto !important;
    max-height: 100px;
    object-fit: contain;
  }
}

/* ========================================
   E-books Page Horizontal Tabs
   ======================================== */

.ebooks-tabs {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px;
  margin-bottom: 25px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 10px;
  flex-wrap: nowrap;
}

.ebooks-tabs::-webkit-scrollbar {
  display: none;
}

.ebooks-tabs .tab {
  padding: 12px 20px !important;
  background-color: #fff !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 8px !important;
  cursor: pointer;
  transition: var(--transition-normal);
  font-size: 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  border-left: none !important;
  border-bottom: none !important;
}

.ebooks-tabs .tab:hover {
  background-color: #f8f9fa !important;
  border-color: var(--primary-color) !important;
}

.ebooks-tabs .tab.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
  color: #fff !important;
  border-color: var(--primary-color) !important;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  border-left: none !important;
  border-bottom: none !important;
}

.ebooks-tabs .tab.active i {
  color: #fff !important;
}

.ebooks-tabs .tab i {
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .ebooks-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 8px;
    padding: 0 10px;
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .ebooks-tabs .tab {
    padding: 10px 16px !important;
    font-size: 0.85rem !important;
    min-width: fit-content;
  }

  .ebooks-tabs .tab i {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .ebooks-tabs {
    gap: 6px;
  }

  .ebooks-tabs .tab {
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
    gap: 6px;
  }

  .ebooks-tabs .tab i {
    font-size: 0.85rem;
  }
}

/* E-books Page Tab Content */
.main-content .tab-content {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.main-content .tab-content.active {
  display: grid;
  animation: fadeIn 0.4s ease;
}

.main-content .grid-item {
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.main-content .grid-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.main-content .grid-item img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-bottom: 1px solid #eee;
  padding: 10px;
}

.main-content .grid-item p {
  padding: 15px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  color: var(--dark-color);
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-content .chapter-title {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
  color: var(--primary-color);
  font-size: 1.4rem;
}

@media (max-width: 768px) {
  .main-content .tab-content {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  .main-content .chapter-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 576px) {
  .main-content .tab-content {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .main-content .grid-item img {
    width: 100% !important;
    height: auto !important;
    max-height: 100px;
    object-fit: contain;
  }

  .main-content .grid-item p {
    padding: 10px;
    font-size: 0.85rem;
  }
}

/* ========================================
   E-books, Videos, Materials Pages Styles
   ======================================== */

/* Main Container for Content Pages */
.main-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px);
  width: 100%;
}

/* Sidebar for Tabs */
.main-container .sidebar {
  background-color: #fff;
  box-shadow: var(--shadow-sm);
  padding: 10px 0;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Tabs List */
.tabs {
  list-style: none;
  margin-bottom: 0;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Individual Tab */
.tab {
  padding: 12px 20px;
  cursor: pointer;
  transition: var(--transition-normal);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab:hover {
  background-color: #f8f9fa;
}

.tab.active {
  background-color: #ebf3ff;
  border-left: 3px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 500;
}

/* Button in Sidebar */
.main-container .button {
  display: block;
  margin: 10px auto;
  padding: 10px 15px;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  text-align: center;
  border-radius: 6px;
  transition: var(--transition-normal);
  font-weight: 500;
  max-width: 200px;
}

.main-container .button:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Content Area */
.main-container .content {
  padding: 15px;
  background-color: #f4f7fc;
  width: 100%;
}

/* Tab Content */
.tab-content {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.tab-content.active {
  display: grid;
  animation: fadeIn 0.4s ease;
}

/* Grid Item Cards */
.grid-item {
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.grid-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.grid-item img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-bottom: 1px solid #eee;
  padding: 10px;
}

.grid-item p {
  padding: 15px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  color: var(--dark-color);
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chapter Title */
.chapter-title {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
  color: var(--primary-color);
  font-size: 1.4rem;
}

/* Badge for new content */
.new-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--warning-color);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Menu for mobile dropdown */
.menu {
  position: relative;
  cursor: pointer;
}

.menu span {
  font-size: 1.5rem;
  padding: 8px;
}

/* Responsive Design for E-books, Videos, Materials Pages */
@media (min-width: 992px) {
  .main-container {
    flex-direction: row;
  }

  .main-container .sidebar {
    width: 240px;
    height: calc(100vh - 70px);
    overflow-y: auto;
  }

  .tabs {
    flex-direction: column;
  }

  .main-container .content {
    flex: 1;
  }

  .tab.active {
    border-left: 3px solid var(--primary-color);
    border-bottom: none;
  }
}

@media (max-width: 991px) {
  .tab.active {
    border-left: none;
    border-bottom: 3px solid var(--primary-color);
  }
}

@media (max-width: 768px) {
  .tab-content {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  .chapter-title {
    font-size: 1.2rem;
  }

  .main-container .content {
    padding: 10px;
  }
}

@media (max-width: 576px) {
  .top-bar .logo {
    font-size: 1.1rem;
  }

  .top-bar .logo img {
    height: 30px;
  }

  .tab-content {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .grid-item img {
    width: 100% !important;
    height: auto !important;
    max-height: 100px;
    object-fit: contain;
  }

  .grid-item p {
    padding: 10px;
    font-size: 0.85rem;
  }

  .tab {
    padding: 10px 15px;
    font-size: 0.85rem;
  }
}
