/* Custom styles for Osoba School - New Design */

:root {
  --primary-bg: #faf5f7;
  --primary-text: #4a2c35;
  --accent-color: #70263d;
  --accent-hover: #9b3054;
  --secondary-text: #6d5560;
  --card-bg: #faf5f7;
  --section-bg: rgba(255, 255, 255, 0.7);
  --light-bg: #f8f9fa;
}

html, body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--primary-bg);
  color: var(--primary-text);
  margin: 0 !important;
  padding: 0 !important;
}

main {
  margin: 0;
  padding: 0;
  padding-top: 56px; /* Height of navbar */
}

/* Navigation */
.navbar-custom {
  background-color: var(--section-bg);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  margin: 0;
}

.navbar-brand {
  font-weight: 800;
  color: var(--accent-color) !important;
  letter-spacing: 0.5px;
}

.nav-link {
  color: var(--accent-color) !important;
  font-weight: 500;
  transition: color 0.3s;
  margin: 0 10px;
}

.nav-link:hover {
  color: var(--accent-hover) !important;
}

.btn-login {
  border: 2px solid var(--accent-color);
  border-radius: 9999px;
  padding: 8px 20px;
  margin-left: 24px;
  transition: all 0.3s;
}

.btn-login:hover {
  background-color: var(--accent-color);
  color: white !important;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 24px 24px 112px;
  margin-top: 0;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--accent-color);
  line-height: 1.2;
}

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

.hero-subtitle {
  max-width: 768px;
  margin: 0 auto 40px;
  font-size: 1.125rem;
  color: var(--secondary-text);
  line-height: 1.6;
}

.btn-primary-custom {
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 9999px;
  padding: 12px 32px;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

.btn-primary-custom:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

/* Features Section */
.features-section {
  padding: 80px 24px;
  background-color: var(--section-bg);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  margin: 0 24px 40px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
  color: var(--accent-color);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  padding: 24px;
  border-radius: 16px;
  background-color: var(--card-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s;
  text-align: center;
}

.feature-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.feature-name {
  font-weight: 600;
  margin-top: 12px;
}


.course-content ul {
  padding-left: 1.1rem;
  color: var(--secondary-text);
  margin-bottom: 16px;
}

.course-content ul li {
  margin-bottom: 6px;
}

.course-image-1 {
  background: linear-gradient(135deg, #fde2e4, #fad2e1);
}

.course-image-2 {
  background: linear-gradient(135deg, #d7e3fc, #a0c4ff);
}

.course-image-3 {
  background: linear-gradient(135deg, #c8f7c5, #7bdcb5);
}

.course-image {
  height: 200px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.1);
}

.course-image::before {
  content: "";
  position: absolute;
  top: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  animation: pulse 3s infinite ease-in-out;
}

.course-image::after {
  content: "";
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(5px);
  animation: pulse 4s infinite ease-in-out;
  animation-delay: 1s;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
}

.cta-banner {
  margin: 0 24px 64px;
  padding: 48px;
  background: radial-gradient(circle at top left, rgba(112, 38, 61, 0.15), rgba(112, 38, 61, 0.05));
  border-radius: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cta-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 8px;
}

.cta-content p {
  color: var(--secondary-text);
  margin: 0;
}

.cta-banner .btn {
  white-space: nowrap;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

.course-card {
  background-color: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

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

.course-card:nth-child(1) {
  animation-delay: 0.1s;
}

.course-card:nth-child(2) {
  animation-delay: 0.2s;
}

.course-card:nth-child(3) {
  animation-delay: 0.3s;
}

.course-card:nth-child(4) {
  animation-delay: 0.4s;
}

.course-card:nth-child(5) {
  animation-delay: 0.5s;
}

.course-card:nth-child(6) {
  animation-delay: 0.6s;
}

.course-card:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  transform: translateY(-8px);
}

.course-image {
  height: 200px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.3s ease;
}

/* Hover effect for course images */
.course-card:hover .course-image {
  transform: scale(1.05);
}

/* Overlay for better text readability on custom images */
.course-image[style*="background-image"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.05));
  z-index: 1;
}

.course-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--accent-color);
  line-height: 1.3;
  transition: color 0.3s ease;
}

.course-card:hover .course-title {
  color: var(--accent-hover);
}

.course-description {
  color: var(--secondary-text);
  margin-bottom: 20px;
  line-height: 1.6;
  flex-grow: 1;
  font-size: 0.95rem;
  white-space: pre-line; /* Preserve line breaks from database */
  word-wrap: break-word; /* Break long words if needed */
  overflow-wrap: break-word;
}

.btn-course {
  border: 2px solid var(--accent-color);
  border-radius: 30px;
  padding: 12px 24px;
  color: var(--accent-color);
  font-weight: 600;
  transition: all 0.3s;
  text-align: center;
  align-self: flex-start;
  margin-top: auto;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn-course .ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  transform: scale(0);
  animation: ripple 0.6s linear;
}

@keyframes ripple {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

.btn-course::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.btn-course:hover::before {
  left: 100%;
}

.btn-course:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(112, 38, 61, 0.3);
}

/* Footer */
.footer {
  background-color: white;
  padding: 64px 24px 32px;
  text-align: center;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.05);
}

.footer-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--accent-color);
}

.contact-info {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.btn-contact {
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 9999px;
  padding: 8px 24px;
  font-weight: 500;
  margin-top: 24px;
  transition: background-color 0.3s;
}

.btn-contact:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Admin and Student Dashboard Styles */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 48px 0 0;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
  background-color: #f8f9fa;
  transition: transform 0.3s ease-in-out;
}

.sidebar-sticky {
  position: relative;
  top: 0;
  height: calc(100vh - 48px);
  padding-top: .5rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar .nav-link {
  font-weight: 500;
  color: #333;
  padding: 0.5rem 1rem;
  transition: all 0.2s;
  border-radius: 0.375rem;
  margin: 0.125rem 0.5rem;
}

.sidebar .nav-link.active {
  color: var(--accent-color);
  background-color: rgba(112, 38, 61, 0.1);
  border-left: 3px solid var(--accent-color);
}

.sidebar .nav-link:hover {
  color: var(--accent-color);
  background-color: rgba(112, 38, 61, 0.05);
}

.sidebar-heading {
  font-size: .75rem;
  text-transform: uppercase;
  color: #6c757d;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
}

/* Progress bar styling */
.progress {
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  background-color: #e9ecef;
}

.progress-bar {
  background-color: var(--accent-color);
  transition: width 0.6s ease;
}

/* Card enhancements */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: box-shadow 0.3s ease;
  border-radius: 12px;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Button enhancements */
.btn {
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
}

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

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

/* Breadcrumb styling */
.breadcrumb {
  background-color: #e9ecef;
  border-radius: 0.375rem;
  margin-top: -10px;
}

/* Table styling */
.table th {
  border-top: none;
  font-weight: 600;
  vertical-align: top;
}

.table td {
  vertical-align: top;
}

/* Collapsible tree structure for courses */
.courses-tree .card-header {
  font-weight: bold;
  background-color: var(--accent-color);
  color: white;
  border-radius: 12px !important;
  cursor: pointer;
}

.courses-tree .module-header {
  font-weight: 600;
  background-color: #e9ecef;
  border-radius: 8px !important;
  cursor: pointer;
}

.toggle-icon {
  font-weight: bold;
  font-size: 1.2rem;
}

/* Course tree specific styles */
.modules-list .card {
  border-left: 3px solid var(--accent-color);
}

.lessons-list .card {
  border-left: 2px solid #6c757d;
}

.dropdown-toggle::after {
  display: none;
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-outline-secondary:hover {
  background-color: rgba(108, 117, 125, 0.1);
}

/* Student Dashboard Specific Styles */
.welcome-section h2 {
  color: var(--accent-color);
  font-weight: 700;
}

.course-card {
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: rgba(112, 38, 61, 0.2);
}

.modules-preview .badge {
  font-weight: 500;
  padding: 0.5em 0.75em;
}

.accordion-item {
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 12px !important;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.accordion-item:first-of-type {
  border-top-left-radius: 12px !important;
  border-top-right-radius: 12px !important;
}

.accordion-item:last-of-type {
  border-bottom-left-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
}

.accordion-button {
  font-weight: 500;
  padding: 1rem 1.25rem;
}

.accordion-button:not(.collapsed) {
  background-color: var(--light-bg);
  color: var(--accent-color);
}

.accordion-body {
  padding: 1.25rem;
}

.list-group-item {
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 8px !important;
  margin-bottom: 0.5rem;
}

.list-group-item:last-child {
  margin-bottom: 0;
}

.lesson-card {
  border-radius: 12px;
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.lesson-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments for sidebar */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  main {
    padding-top: 56px; /* Navbar height on mobile */
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .navbar-nav {
    text-align: center;
  }
  
  .btn-login {
    margin: 10px 0;
  }

  /* Fix welcome section overlap with header on mobile */
  .welcome-section {
    margin-top: 20px;
    padding-top: 20px;
  }

  /* Breadcrumb mobile spacing */
  .breadcrumb {
    margin-top: 40px !important;
  }

  /* Fix course card layout on mobile */
  .course-card .card-body {
    padding: 1rem;
  }

  .course-card .d-flex.justify-content-between {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .course-card .text-end {
    text-align: left !important;
    width: 100%;
  }

  .course-card .progress {
    width: 100% !important;
  }

  .modules-preview .d-flex {
    flex-wrap: wrap;
  }

  .course-card .d-flex.justify-content-between.align-items-center {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.75rem;
  }

  .course-card .text-muted.small {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-section {
    padding: 40px 16px 70px;
  }
  
  .features-section {
    margin: 0 16px 30px;
    padding: 40px 16px;
  }
  
  .courses-section {
    padding: 80px 24px;
    background-color: var(--section-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    margin: 0 24px 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  }

  .welcome-section h2 {
    font-size: 1.75rem;
  }
}

.hero-tag {
  display: inline-block;
  background-color: rgba(112, 38, 61, 0.1);
  color: var(--accent-color);
  padding: 6px 16px;
  border-radius: 9999px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.course-content ul {
  padding-left: 1.1rem;
  color: var(--secondary-text);
  margin-bottom: 16px;
}

.course-content ul li {
  margin-bottom: 6px;
}

.course-image-1 {
  background: linear-gradient(135deg, #fde2e4, #fad2e1);
}

.course-image-2 {
  background: linear-gradient(135deg, #d7e3fc, #a0c4ff);
}

.course-image-3 {
  background: linear-gradient(135deg, #c8f7c5, #7bdcb5);
}

.course-image::before {
  content: "";
  position: absolute;
  top: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
}

.course-image::after {
  content: "";
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(5px);
}

.cta-banner {
  margin: 0 24px 64px;
  padding: 48px;
  background: radial-gradient(circle at top left, rgba(112, 38, 61, 0.15), rgba(112, 38, 61, 0.05));
  border-radius: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cta-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 8px;
}

.cta-content p {
  color: var(--secondary-text);
  margin: 0;
}

.cta-banner .btn {
  white-space: nowrap;
}

/* Student Dashboard Lesson List Styles */
.accordion-body .list-group-flush {
  margin-left: -1rem;
  margin-right: -1rem;
}

.accordion-body .list-group-flush .list-group-item {
  border-radius: 0 !important;
  border-left: none;
  border-right: none;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
  background-color: transparent;
}

.accordion-body .list-group-flush .list-group-item:first-child {
  border-top: none;
}

.accordion-body .list-group-flush .list-group-item:last-child {
  border-bottom: none;
}

.accordion-body .list-group-flush .list-group-item:hover {
  background-color: rgba(112, 38, 61, 0.05);
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent-color);
}

.accordion-body .list-group-flush .list-group-item.list-group-item-success {
  background-color: rgba(25, 135, 84, 0.05);
  border-left: 3px solid #198754;
}

.accordion-body .list-group-flush .list-group-item.list-group-item-success:hover {
  background-color: rgba(25, 135, 84, 0.1);
}

.lesson-title {
  font-weight: 500;
  color: var(--primary-text);
  display: flex;
  align-items: center;
  flex: 1;
}

.lesson-number {
  font-size: 0.875rem;
  min-width: 1.5rem;
}

.accordion-body .list-group-flush .list-group-item .badge {
  font-size: 0.875rem;
  padding: 0.35em 0.65em;
}

/* Responsive adjustments for lesson list */
@media (max-width: 576px) {
  .accordion-body .list-group-flush .list-group-item {
    padding: 0.65rem 0.75rem;
  }
  
  .lesson-title {
    font-size: 0.9rem;
  }
  
  .lesson-number {
    font-size: 0.8rem;
    min-width: 1.25rem;
  }
  
  .accordion-body .list-group-flush .list-group-item .badge {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
  }
}

@media (max-width: 768px) {
  .cta-banner {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
  }

  .cta-content h2 {
    font-size: 1.5rem;
  }
  
  /* Responsive course cards */
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .course-image {
    height: 180px;
  }
}
