/* Custom styles for Digital Jain Pathshala */

/* Stats Card Styles */
.stats-card {
  width: 80%;
  height: 100%;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 20px;
  transition: transform 0.3s ease;
}

.stats-card:hover {
  transform: translateY(-5px);
}

.top-grid .col-2 {
  padding: 0px !important;
  height: 100px !important;
  border-radius: 8px;
}

.top-grid .grid-border {
  border: none;
}

/* Content Block Base Styles */
.content-block {
  position: relative;
  box-shadow: 2px 2px 2px #ff8000;
  border: 1px solid #ff8000;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
}

.content-block:hover {
  z-index: 999999 !important;
}

/* Floating Box Styles */
.floating-box {
  position: fixed;
  left: 100%;
  top: 95px;
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(255, 136, 0, 0.5);
  width: 200px;
  z-index: 999999 !important;
  display: none;
  margin-left: 5px;
  pointer-events: none;
}

.floating-box::after {
  content: "";
  position: absolute;
  top: 3px;
  left: -2px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #ff8000;
  border-radius: 50%;
  transform: rotate(-45deg);
  z-index: 999999 !important;
}

.content-block:hover .floating-box {
  display: block;
  position: absolute;
}

/* Right Side Floating Box */
.content-block.right-side .floating-box {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 5px;
  z-index: 999999 !important;
}

.content-block.right-side .floating-box::after {
  left: auto;
  right: -3px;
  transform: rotate(45deg);
}

/* Ensure blocks container has proper stacking */
.blocks {
  position: relative;
  z-index: 1;
}

/* Override any other sections that might be causing issues */
.intro-section {
  position: relative;
  z-index: 1;
}

.hero-section {
  position: relative;
  z-index: 1;
}

/* Add this to ensure floating boxes are always on top */
.content-block:hover {
  isolation: isolate;
}

.floating-box h6 {
  font-size: 14px;
  color: #6c757d;
}

.floating-box p {
  font-size: 12px;
  color: #6c757d;
}

.content-block:hover .floating-box {
  display: block;
  pointer-events: none;
}

/*For blocks on the right side of the grid */
.content-block.right-side .floating-box {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 5px;
  z-index: 99999;
}

.content-block.right-side .floating-box::after {
  top: 3px;
  left: auto;
  right: -3px;
  transform: rotate(45deg);
  z-index: 99999;
}

.blocks:hover .content-block::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2;
  transition: background-color 0.3s ease;
  border: none;
  border-radius: 8px;
}

/* Clear overlay for hovered element */
.blocks .content-block:hover::before {
  content: "";
  background-color: rgba(0, 0, 0, 0);
  z-index: 3;
}

/* Flip Animation */
@keyframes flip {
  0% {
    transform: perspective(400px) rotateX(0);
    opacity: 1;
  }

  50% {
    transform: perspective(400px) rotateX(-90deg);
    opacity: 0.5;
  }

  100% {
    transform: perspective(400px) rotateX(0);
    opacity: 1;
  }
}

.flip-animate {
  animation: flip 2s ease-in-out;
  display: inline-block;
  transform-origin: bottom;
}

.book-item {
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
}

.book-item:hover {
  transform: translateY(-5px);
}

.book-image {
  width: 100%;
  height: 150px !important;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

.book-title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 8px 0;
  color: #333;
  text-align: center;
}

.book-price {
  font-size: 16px;
  color: #ff8800;
  font-weight: bold;
  text-align: center;
}

.owl-nav {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.explore-button a {
  color: #ffffff !important;
  text-decoration: none;
}

/* Hover effect for anchor inside the button */
.explore-button a:hover {
  color: #ffffff !important;
}

.why-djp-item:hover {
  background-color: rgba(255, 136, 0, 0.08) !important;
  transform: translateX(5px);
}

.why-djp-section .btn:hover {
  background-color: #f80 !important;
  color: white !important;
}

/* Map styles */
#india-map {
  height: 500px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 136, 0, 0.1);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  background: #fff;
  position: relative;
  z-index: 1;
}

.marker-label {
  background-color: rgba(255, 136, 0, 0.9);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  opacity: 1;
  transition: all 0.3s ease;
}

.leaflet-container {
  background: #fff !important;
}

.leaflet-control-container {
  display: none;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}

#lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  margin: auto;
  display: block;
}

/* Image Popup */
.image-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  padding: 20px;
}

.popup-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #666;
  font-size: 24px;
  cursor: pointer;
  z-index: 10000;
}

.popup-image {
  max-width: 100%;
  max-height: 70vh;
  margin: auto;
  display: block;
  border-radius: 4px;
}

.popup-description {
  margin-top: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
}

.popup-title {
  color: #f80;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.popup-text {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Testimonial Cards */
.testimonial-card {
  cursor: pointer;
}

/* Popup Styles */
.testimonial-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 20px;
  box-sizing: border-box;
}

.popup-content {
  background-color: white;
  border-radius: 15px;
  overflow: hidden;
  width: 100%;
  max-width: 700px;
  position: relative;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  margin: auto;
}

.popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  color: #333;
  cursor: pointer;
  transition: color 0.2s ease;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.popup-close:hover {
  color: #ff8800;
}

.popup-body {
  padding: 30px;
}

.popup-testimonial {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #444;
  font-style: italic;
  margin-bottom: 25px;
  position: relative;
  padding: 20px 25px;
  border-left: 4px solid #ff8800;
  background-color: #fff9f0;
  word-wrap: break-word;
}

.popup-testimonial p {
  margin: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.popup-author {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
}

.popup-author-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 136, 0, 0.2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  background-color: #f5f5f5;
  flex-shrink: 0;
}

.popup-author-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-author-info {
  flex: 1;
  min-width: 0;
}

.popup-author-info h3 {
  color: #ff8800;
  margin: 0 0 8px 0;
  font-weight: 600;
  font-size: 1.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popup-author-info p {
  color: #666;
  margin: 0 0 5px 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popup-author-info p:last-child {
  color: #888;
  font-size: 0.9rem;
}

body.popup-open {
  overflow: hidden;
}

/* Book Store Styles */
.book-item {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  display: block;
  background: white;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 136, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.book-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.book-item:hover .book-image {
  transform: scale(1.03);
}

.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f80;
  color: white;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(255, 136, 0, 0.3);
}

.book-title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin: 12px 0 8px;
  line-height: 1.4;
  height: 42px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.book-author {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
  font-weight: 400;
}

.book-rating {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 5px;
}

.stars {
  color: #f80;
  font-size: 14px;
  letter-spacing: 1px;
}

.rating-value {
  color: #f80;
  font-weight: 600;
  font-size: 14px;
  margin-right: 5px;
}

.rating-count {
  color: #999;
  font-size: 13px;
  font-weight: 400;
}

.book-price {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.current-price {
  font-size: 18px;
  font-weight: 600;
  color: #f80;
}

.original-price {
  font-size: 14px;
  color: #999;
  text-decoration: line-through;
}

.owl-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.owl-prev,
.owl-next {
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
  background: rgba(255, 136, 0, 0.1) !important;
  color: #f80 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 136, 0, 0.2) !important;
}

.owl-prev:hover,
.owl-next:hover {
  background: #f80 !important;
  color: white !important;
  transform: translateX(0);
}

.owl-prev:hover {
  transform: translateX(-3px);
}

.owl-next:hover {
  transform: translateX(3px);
}

.owl-prev i,
.owl-next i {
  font-size: 16px;
}

/* Updates Carousel Styles */
#updatesCarousel {
  padding: 0 50px;
  position: relative;
}

#updatesCarousel .item {
  position: relative;
  overflow: hidden;
  margin: 0 10px;
  height: 100%;
}

#updatesCarousel .updates-card {
  height: 100%;
  transition: all 0.3s ease;
  cursor: pointer;
}

#updatesCarousel .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#updatesCarousel .update-image-container {
  position: relative;
  overflow: hidden;
  height: 220px;
}

#updatesCarousel .carousel-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

#updatesCarousel .item:hover .carousel-image {
  transform: scale(1.05);
}

#updatesCarousel .card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

#updatesCarousel .update-desc {
  flex-grow: 1;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#updatesCarousel .carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  border-top: 2px solid #f80;
  padding: 10px 15px;
}

#updatesCarousel .owl-nav {
  margin: 0;
  display: block !important;
}

#updatesCarousel .owl-nav button.owl-prev,
#updatesCarousel .owl-nav button.owl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(255, 136, 0, 0.2) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 14px;
  margin: 0;
  z-index: 1;
}

#updatesCarousel .owl-nav button.owl-prev {
  left: 5px;
}

#updatesCarousel .owl-nav button.owl-next {
  right: 5px;
}

#updatesCarousel .owl-nav button.owl-prev:hover,
#updatesCarousel .owl-nav button.owl-next:hover {
  background: #f80 !important;
  color: white !important;
}

#updatesCarousel .owl-nav button i {
  font-size: 16px;
  line-height: 1;
}

/* Program Cards Styles */
.program-card {
  transform: translateY(0);
}

.program-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08) !important;
}

.program-card .btn:hover {
  background-color: #f80 !important;
  color: white !important;
  transform: translateX(3px);
}

.program-card:hover .program-icon {
  background-color: rgba(255, 136, 0, 0.15) !important;
}

/* Testimonial Card Styles */
.testimonial-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 136, 0, 0.1);
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.testimonial-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.testimonial-text {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: italic;
  position: relative;
  padding-left: 20px;
  border-left: 3px solid rgba(255, 136, 0, 0.3);
  margin-bottom: 20px;
  flex-grow: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 136, 0, 0.1);
  margin-top: auto;
}

.testimonial-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 136, 0, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.testimonial-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.testimonial-card:hover .testimonial-image img {
  transform: scale(1.1);
}

.author-info {
  flex-grow: 1;
}

.testimonial-author h6 {
  color: #f80;
  margin: 0 0 5px 0;
  font-weight: 600;
  font-size: 1rem;
}

.testimonial-author span {
  color: #777;
  font-size: 0.85rem;
  display: block;
  line-height: 1.3;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .top-grid .col-2 {
    padding: 0px !important;
    height: 60px !important;
    border: 2px solid #ff8000;
    border-radius: 8px;
  }

  .top-grid .grid-border {
    border: none;
  }

  .content-block {
    position: relative;
  }

  /* Floating box styles */
  .floating-box {
    position: absolute;
    left: 100%;
    top: 60px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 150px;
    z-index: 1000;
    display: none;
    margin-left: 10px;
  }

  .content-block.sm-right-side .floating-box {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 5px;
  }

  .content-block.sm-right-side .floating-box::after {
    top: 3px;
    left: auto;
    right: -3px;
    transform: rotate(45deg);
  }

  .testimonial-card {
    padding: 20px;
  }

  .testimonial-image {
    width: 50px;
    height: 50px;
  }

  .testimonial-text {
    font-size: 0.9rem;
    padding-left: 15px;
  }

  .popup-author {
    flex-direction: column;
    align-items: flex-start;
  }

  .popup-author-image {
    margin-bottom: 15px;
  }

  .popup-body {
    padding: 20px;
  }

  .popup-testimonial {
    padding: 15px;
    font-size: 1rem;
  }

  #updatesCarousel {
    padding: 0 40px;
  }

  #updatesCarousel .update-image-container {
    height: 180px;
  }

  #updatesCarousel .item {
    margin: 0 5px;
  }

  #updatesCarousel .update-desc {
    line-clamp: 2;
    -webkit-line-clamp: 2;
  }

  #updatesCarousel .owl-nav {
    display: block !important;
  }
}

@media (max-width: 991px) {
  #updatesCarousel .update-image-container {
    height: 200px;
  }
}

/* Updates section styling */
.text-gradient {
  background: linear-gradient(90deg, #444 0%, #f80 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-orange {
  color: #f80 !important;
}

.decorative-line {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #ff8800, #ffaa33);
  margin: 15px auto;
  border-radius: 3px;
}

.updates-slider {
  padding: 10px;
}

.updates-card {
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.updates-card:hover {
  transform: translateY(-10px);
}

.update-image-container {
  position: relative;
  overflow: hidden;
  height: 220px;
}

.update-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.updates-card:hover .update-image {
  transform: scale(1.1);
}

.update-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: #f80;
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(255, 136, 0, 0.3);
}

.update-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease;
}

.updates-card:hover .update-overlay {
  height: 100%;
}

.view-details {
  color: white;
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 20px;
  border: 2px solid white;
  border-radius: 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
  transition-delay: 0.1s;
}

.updates-card:hover .view-details {
  opacity: 1;
  transform: translateY(0);
}

.update-date {
  color: #888;
  font-size: 0.85rem;
}

.update-title {
  color: #333;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.updates-card:hover .update-title {
  color: #f80;
}

.update-desc {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.update-footer a {
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.update-footer a:hover {
  padding-left: 5px;
}

.section-header {
  margin-bottom: 40px;
}

/* Carousel Navigation Buttons */
.update-nav-btn,
#updatesCarousel .owl-nav button.owl-prev,
#updatesCarousel .owl-nav button.owl-next {
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  background: white !important;
  color: #f80 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

#updatesCarousel .owl-nav button.owl-prev {
  left: -20px;
}

#updatesCarousel .owl-nav button.owl-next {
  right: -20px;
}

#updatesCarousel .owl-nav button.owl-prev:hover,
#updatesCarousel .owl-nav button.owl-next:hover {
  background: #f80 !important;
  color: white !important;
}

#updatesCarousel .owl-dots {
  margin-top: 20px;
}

#updatesCarousel .owl-dot span {
  background: rgba(255, 136, 0, 0.3);
  transition: all 0.3s ease;
}

#updatesCarousel .owl-dot.active span,
#updatesCarousel .owl-dot:hover span {
  background: #f80;
}

/* Hide carousel until initialized */
#updatesCarousel {
  opacity: 0;
  transition: opacity 0.5s ease;
}
