/* ========================================
   CAROUSEL BLOCK STYLES - PHASE 3
======================================== */

/* Editor Styles */
.cgb-carousel-editor {
  padding: 30px;
  background: #f8f9fa;
  border: 2px dashed #0073aa;
  border-radius: 8px;
}

.cgb-carousel-editor h3 {
  margin: 0 0 20px 0;
  color: #0073aa;
  font-size: 18px;
  font-weight: 600;
}

/* Carousel Preview Grid */
.cgb-carousel-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.cgb-carousel-preview-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.cgb-carousel-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cgb-remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

.cgb-carousel-preview-item:hover .cgb-remove-image {
  opacity: 1;
}

.cgb-external-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  background: #0073aa;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  z-index: 5;
}

/* Frontend Styles */
.cgb-carousel-block {
  margin: 30px 0;
  position: relative;
}

.cgb-carousel-block .swiper,
.cgb-carousel-block .cgb-swiper {
  width: 100%;
  height: 500px;
  border-radius: 8px;
  overflow: hidden;
}

.cgb-carousel-block .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

.cgb-carousel-block .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cgb-carousel-block .swiper-slide a {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.cgb-carousel-block .swiper-slide a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cgb-carousel-block .swiper-button-next,
.cgb-carousel-block .swiper-button-prev {
  color: #0073aa;
  background: rgba(255, 255, 255, 0.9);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: all 0.3s;
}

.cgb-carousel-block .swiper-button-next:hover,
.cgb-carousel-block .swiper-button-prev:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.cgb-carousel-block .swiper-button-next:after,
.cgb-carousel-block .swiper-button-prev:after {
  font-size: 20px;
}

.cgb-carousel-block .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background: #fff;
  opacity: 0.7;
}

.cgb-carousel-block .swiper-pagination-bullet-active {
  background: #0073aa;
  opacity: 1;
}

/* Lightbox Styles */
.cgb-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.cgb-lightbox-image {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  animation: zoomIn 0.3s;
}

.cgb-lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  z-index: 100000;
  transition: transform 0.2s;
}

.cgb-lightbox-close:hover {
  transform: scale(1.2);
}

.cgb-lightbox-prev,
.cgb-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 60px;
  color: white;
  cursor: pointer;
  padding: 10px 20px;
  user-select: none;
  transition: opacity 0.2s;
}

.cgb-lightbox-prev:hover,
.cgb-lightbox-next:hover {
  opacity: 0.7;
}

.cgb-lightbox-prev {
  left: 20px;
}

.cgb-lightbox-next {
  right: 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
  }
  to {
    transform: scale(1);
  }
}

/* Carousel - Responsive */
@media (max-width: 1024px) {
  .cgb-carousel-block .swiper,
  .cgb-carousel-block .cgb-swiper {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .cgb-carousel-block .swiper,
  .cgb-carousel-block .cgb-swiper {
    height: 300px;
  }

  .cgb-carousel-preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .cgb-lightbox-prev,
  .cgb-lightbox-next {
    font-size: 40px;
    padding: 5px 10px;
  }

  .cgb-lightbox-prev {
    left: 10px;
  }

  .cgb-lightbox-next {
    right: 10px;
  }

  .cgb-lightbox-close {
    top: 10px;
    right: 15px;
    font-size: 30px;
  }
}

/* ========================================
   FEATURES GRID BLOCK STYLES - PHASE 3
======================================== */

/* Editor Styles */
.cgb-features-grid-editor {
  padding: 30px;
  background: #f8f9fa;
  border: 2px dashed #00a32a;
  border-radius: 8px;
}

.cgb-features-grid-editor h3 {
  margin: 0 0 20px 0;
  color: #00a32a;
  font-size: 18px;
  font-weight: 600;
}

.cgb-features-grid-editor h2[contenteditable="true"] {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  padding: 10px;
  border: 1px dashed #ddd;
  border-radius: 4px;
  min-height: 40px;
}

.cgb-features-grid-editor h2[contenteditable="true"]:focus {
  outline: none;
  border-color: #00a32a;
  background: white;
}

.cgb-features-preview {
  margin: 20px 0;
}

.cgb-feature-item-editor {
  background: white;
  position: relative;
}

.cgb-feature-item-editor h4[contenteditable="true"] {
  font-size: 18px;
  font-weight: 600;
  min-height: 30px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 3px;
}

.cgb-feature-item-editor h4[contenteditable="true"]:focus {
  outline: none;
  border-color: #00a32a;
  background: #f9f9f9;
}

.cgb-feature-item-editor [contenteditable="true"] {
  min-height: 40px;
  padding: 5px;
}

.cgb-feature-item-editor [contenteditable="true"]:focus {
  outline: 2px solid #00a32a;
  outline-offset: 2px;
}

.cgb-feature-item-editor ul,
.cgb-feature-item-editor ol {
  margin: 10px 0;
  padding-left: 25px;
}

.cgb-feature-item-editor li {
  margin-bottom: 5px;
}

.cgb-feature-item-editor p {
  margin: 0 0 10px 0;
}

.cgb-feature-item-editor p:last-child {
  margin-bottom: 0;
}

/* Frontend Styles */
.cgb-features-grid-wrapper {
  margin: 30px 0;
}

.cgb-features-heading {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 30px 0;
  color: #333;
}

.cgb-features-grid {
  margin: 20px 0;
}

.cgb-features-grid .cgb-feature-item {
  transition: all 0.3s ease;
}

.cgb-features-grid-wrapper.has-hover-effect .cgb-feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.cgb-features-grid .cgb-feature-item h4 {
  margin: 0 0 15px 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.cgb-features-grid .cgb-feature-item .feature-description {
  font-size: 15px;
  line-height: 1.6;
  color: #666;
}

.cgb-features-grid .cgb-feature-item .feature-description p {
  margin: 0 0 12px 0;
}

.cgb-features-grid .cgb-feature-item .feature-description p:last-child {
  margin-bottom: 0;
}

.cgb-features-grid .cgb-feature-item .feature-description ul,
.cgb-features-grid .cgb-feature-item .feature-description ol {
  margin: 10px 0;
  padding-left: 25px;
}

.cgb-features-grid .cgb-feature-item .feature-description li {
  margin-bottom: 8px;
}

.cgb-features-grid .cgb-feature-item .feature-description strong {
  font-weight: 600;
  color: #333;
}

.cgb-features-grid .cgb-feature-item .feature-description em {
  font-style: italic;
}

/* Features Grid - Responsive based on data attributes */
@media (max-width: 1023px) {
  .cgb-features-grid-wrapper[data-cols-tablet="4"] .cgb-features-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .cgb-features-grid-wrapper[data-cols-tablet="3"] .cgb-features-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .cgb-features-grid-wrapper[data-cols-tablet="2"] .cgb-features-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .cgb-features-grid-wrapper[data-cols-tablet="1"] .cgb-features-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 767px) {
  .cgb-features-grid-wrapper[data-cols-mobile="2"] .cgb-features-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .cgb-features-grid-wrapper[data-cols-mobile="1"] .cgb-features-grid {
    grid-template-columns: 1fr !important;
  }

  .cgb-features-heading {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .cgb-features-grid .cgb-feature-item h4 {
    font-size: 18px;
  }

  .cgb-features-grid .cgb-feature-item .feature-description {
    font-size: 14px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .cgb-features-heading {
    color: #f3f4f6;
  }

  .cgb-features-grid .cgb-feature-item h4 {
    color: #f3f4f6;
  }

  .cgb-features-grid .cgb-feature-item .feature-description {
    color: #9ca3af;
  }

  .cgb-features-grid .cgb-feature-item .feature-description strong {
    color: #f3f4f6;
  }
}
