/* Gallery Intro Section */
.gallery-intro-section {
  padding: 48px 0 24px 0;
  background: linear-gradient(135deg, #f7faff 60%, #e3e9f7 100%);
  text-align: center;
}
.gallery-intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.gallery-intro-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(30,60,120,0.08);
  padding: 8px;
  margin-bottom: 8px;
}
.gallery-intro-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: #1976d2;
  margin-bottom: 0.5rem;
}
.gallery-intro-desc {
  color: #444;
  font-size: 1.1rem;
  max-width: 540px;
}

/* Section Titles */
.gallery-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1976d2;
  margin-bottom: 28px;
  text-align: center;
}

/* Videos Section */
.gallery-videos-section {
  padding: 36px 0 24px 0;
  background: #f7faff;
}
.gallery-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px 18px;
  justify-items: center;
}
.gallery-video-card {
  background: rgba(255,255,255,0.85);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(30,60,120,0.13);
  border: 1.5px solid #e3e9f7;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s, background 0.22s;
  backdrop-filter: blur(2.5px);
  cursor: pointer;
  max-width: 400px;
  width: 100%;
}
.gallery-video-card:hover {
  box-shadow: 0 12px 36px rgba(25,118,210,0.18);
  border-color: #1976d2;
  transform: translateY(-5px) scale(1.025);
  background: rgba(255,255,255,0.97);
}
.gallery-video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
  background: #e3e9f7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  transition: transform 0.22s;
}
.gallery-video-card:hover .gallery-video-thumb img {
  transform: scale(1.04) rotate(-1deg);
}
.gallery-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(25,118,210,0.85);
  color: #fff;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 2px 12px rgba(25,118,210,0.18);
  transition: background 0.18s, color 0.18s;
  z-index: 2;
}
.gallery-video-card:hover .gallery-video-play {
  background: #1976d2;
}
.gallery-video-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #1976d2;
  margin: 16px 0 12px 0;
  text-align: center;
}

/* Video Modal */
.gallery-video-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  align-items: center;
  justify-content: center;
}
.gallery-video-modal.active {
  display: flex;
}
.gallery-video-modal .modal-backdrop {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 60, 120, 0.35);
  backdrop-filter: blur(2px);
  z-index: 1;
}
.gallery-video-modal .modal-content {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 12px 48px rgba(30,60,120,0.18);
  max-width: 700px;
  width: 95vw;
  padding: 0;
  animation: modalFadeIn 0.4s cubic-bezier(.77,0,.18,1);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.gallery-video-modal .modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #1976d2;
  cursor: pointer;
  z-index: 3;
  transition: color 0.2s;
}
.gallery-video-modal .modal-close:hover {
  color: #0d47a1;
}
.gallery-video-modal .modal-body {
  width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-video-modal .modal-body iframe {
  width: 100%;
  min-height: 340px;
  border: none;
  border-radius: 0 0 22px 22px;
  background: #000;
}
@media (max-width: 700px) {
  .gallery-video-modal .modal-body iframe {
    min-height: 180px;
    border-radius: 0 0 14px 14px;
  }
}

/* Certificates Section */
.gallery-certificates-section {
  padding: 36px 0 24px 0;
  background: #f7faff;
}
.gallery-certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 36px 24px;
  justify-items: center;
}
.gallery-certificate-card {
  background: rgba(255,255,255,0.92);
  border-radius: 28px;
  box-shadow: 0 8px 32px rgba(30,60,120,0.13), 0 2px 12px rgba(25,118,210,0.08);
  border: 2.5px solid #e3e9f7;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s, background 0.22s;
  backdrop-filter: blur(4px);
  max-width: 420px;
  width: 100%;
  min-height: 340px;
  position: relative;
  animation: certCardIn 0.8s cubic-bezier(.4,2,.6,1);
}
.gallery-certificate-card:hover {
  box-shadow: 0 16px 48px rgba(25,118,210,0.18), 0 4px 18px rgba(30,60,120,0.13);
  border-color: #1976d2;
  background: rgba(255,255,255,0.98);
  transform: translateY(-8px) scale(1.035);
}
.gallery-certificate-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  transition: transform 0.22s;
  box-shadow: 0 2px 18px rgba(30,60,120,0.10);
}
.gallery-certificate-card:hover img {
  transform: scale(1.06) rotate(-1deg);
}
.gallery-certificate-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #1976d2;
  margin: 22px 0 18px 0;
  text-align: center;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 8px rgba(25,118,210,0.07);
}
@media (max-width: 1100px) {
  .gallery-certificates-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .gallery-certificates-grid { grid-template-columns: 1fr; gap: 18px 0; }
  .gallery-certificate-card { border-radius: 16px; min-height: 180px; }
  .gallery-certificate-card img { border-top-left-radius: 16px; border-top-right-radius: 16px; height: 120px; }
}
@keyframes certCardIn {
  0% { opacity: 0; transform: translateY(40px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Collections Section */
.gallery-collections-section {
  padding: 36px 0 24px 0;
  background: #f7faff;
}
.gallery-collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px 10px;
  justify-items: center;
}
.gallery-collection-img {
  background: rgba(255,255,255,0.85);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(30,60,120,0.10);
  border: 1.5px solid #e3e9f7;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s, background 0.22s;
  max-width: 220px;
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-collection-img:hover {
  box-shadow: 0 8px 24px rgba(25,118,210,0.13);
  border-color: #1976d2;
  background: rgba(255,255,255,0.97);
  transform: scale(1.04);
}
.gallery-collection-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  transition: transform 0.22s;
}

/* Image Modal */
.gallery-image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  align-items: center;
  justify-content: center;
}
.gallery-image-modal.active {
  display: flex;
}
.gallery-image-modal .modal-backdrop {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 60, 120, 0.35);
  backdrop-filter: blur(2px);
  z-index: 1;
}
.gallery-image-modal .modal-content {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 12px 48px rgba(30,60,120,0.18);
  max-width: 700px;
  width: 95vw;
  padding: 0;
  animation: modalFadeIn 0.4s cubic-bezier(.77,0,.18,1);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.gallery-image-modal .modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #1976d2;
  cursor: pointer;
  z-index: 3;
  transition: color 0.2s;
}
.gallery-image-modal .modal-close:hover {
  color: #0d47a1;
}
.gallery-image-modal .modal-body {
  width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-image-modal .modal-body img {
  width: 100%;
  max-width: 650px;
  height: auto;
  border-radius: 0 0 22px 22px;
  background: #e3e9f7;
}
@media (max-width: 700px) {
  .gallery-image-modal .modal-body img {
    max-width: 98vw;
    border-radius: 0 0 14px 14px;
  }
}

html[dir="rtl"] .gallery-intro-content,
html[dir="rtl"] .gallery-section-title,
html[dir="rtl"] .gallery-video-title,
html[dir="rtl"] .gallery-certificate-title {
  text-align: right;
  direction: rtl;
}
html[dir="rtl"] .gallery-intro-content {
  align-items: flex-end;
}

.gallery-section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px auto;
  height: 22px;
  width: 100%;
  max-width: 900px;
  opacity: 0.95;
  animation: dividerFadeIn 1s cubic-bezier(.77,0,.18,1);
}
.gallery-section-divider::before,
.gallery-section-divider::after {
  content: '';
  display: block;
  height: 4px;
  width: 100%;
  max-width: 320px;
  border-radius: 2px;
  background: linear-gradient(90deg, #1976d2, #64b5f6);
  opacity: 0.18;
  animation: dividerLineAnim 1.2s cubic-bezier(.77,0,.18,1);
}
.gallery-section-divider::before { margin-right: 16px; }
.gallery-section-divider::after { margin-left: 16px; }
.gallery-section-divider .gallery-divider-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(30,60,120,0.08);
  padding: 2px;
  z-index: 2;
  animation: dividerIconAnim 1.2s cubic-bezier(.77,0,.18,1);
}
@keyframes dividerFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 0.95; transform: none; }
}
@keyframes dividerLineAnim {
  from { width: 0; opacity: 0; }
  to { width: 100%; opacity: 0.18; }
}
@keyframes dividerIconAnim {
  from { opacity: 0; transform: scale(0.7) rotate(-10deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}
@media (max-width: 700px) {
  .gallery-section-divider::before,
  .gallery-section-divider::after { max-width: 60px; }
}
