.education-section {
  padding: 60px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
}

.section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 10px;
  position: relative;
}

.section-title::after {
  content: '';
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #f26c21, #f39c12);
  display: block;
  margin: 10px auto;
  border-radius: 2px;
}

.section-title i {
  color: #f26c21;
  font-size: 2rem;
  vertical-align: middle;
  margin-right: 10px;
  animation: pulseIcon 2s infinite;
}

@keyframes pulseIcon {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

#intro .lead-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #f26c21;
  background: linear-gradient(45deg, #f26c21, #f39c12);
  -webkit-background-clip: text;
  background-clip: text;
  text-align: center;
  margin-bottom: 30px;
  max-width: 1700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: gradientText 3s ease infinite, fadeIn 1.5s ease-out forwards;
  animation-delay: 0.5s;
}

#education .lead-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  padding: 15px 20px;
  background: #ffffff;
  border: 2px solid transparent;
  border-image: linear-gradient(45deg, #f26c21, #f39c12) 1;
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: fadeInUp 1.2s ease-out forwards;
  animation-delay: 0.3s;
}

@keyframes gradientText {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}

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

.section-content.hidden {
  display: none;
}

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

.education-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  background: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  pointer-events: auto;
  display: flex;
  flex-direction: column; /* Karta ichidagi elementlar vertikal joylashadi */
}

.education-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 25px rgba(242, 108, 33, 0.4);
}

.education-card:has(.modal-content.active) {
  transform: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.education-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.education-card:hover img {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.education-info {
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* .education-info kartaning qolgan joyini to‘ldiradi */
  min-height: 150px; /* Minimal balandlik belgilandi */
}

.education-info h4 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: #1a1a1a;
  margin-bottom: 10px;
}

.education-info p {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  color: #4a4a4a;
  margin-bottom: 15px;
  flex-grow: 1; /* Matn qolgan joyni to‘ldiradi */
}

.progress-container {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  flex-grow: 1;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(45deg, #f26c21, #f39c12);
  transition: width 0.3s ease;
}

.progress-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  color: #4a4a4a;
}

.details-link {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(45deg, #f26c21, #f39c12);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.3s ease;
  margin-top: auto; /* Tugma har doim pastda joylashadi */
  align-self: flex-start; /* Tugma chapga tekislanadi */
}

.details-link:hover {
  background: linear-gradient(45deg, #f39c12, #f26c21);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(242, 108, 33, 0.4);
}

.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  background: #fff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  max-width: 700px;
  width: 90%;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 20px;
  pointer-events: auto;
}

.modal-content.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

.modal-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
}

.modal-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-text h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: #1a1a1a;
  margin: 0;
}

.modal-text p {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  color: #4a4a4a;
  line-height: 1.6;
  margin: 0;
}

.modal-details {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  color: #4a4a4a;
}

.modal-details li {
  margin-bottom: 8px;
}

.modal-details li strong {
  color: #1a1a1a;
}

.modal-close {
  display: block;
  padding: 10px 20px;
  background: linear-gradient(45deg, #f26c21, #f39c12);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
  align-self: center;
}

.modal-close:hover {
  background: linear-gradient(45deg, #f39c12, #f26c21);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(242, 108, 33, 0.4);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hidden {
  display: none;
}

@media (max-width: 991px) {
  .education-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  .education-card img {
    height: 160px;
  }
  .section-title {
    font-size: 2rem;
  }
  #intro .lead-text {
    font-size: 1rem;
  }
  #education .lead-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .education-section {
    padding: 40px 0;
  }
  .education-grid {
    grid-template-columns: 1fr;
  }
  .education-card img {
    height: 140px;
  }
  .education-info h4 {
    font-size: 1.2rem;
  }
  .education-info p {
    font-size: 0.85rem;
  }
  .modal-content {
    max-width: 80%;
    padding: 20px;
  }
  .modal-image {
    height: 150px;
  }
}

@media (max-width: 576px) {
  .section-title {
    font-size: 1.8rem;
  }
  #intro .lead-text {
    font-size: 0.9rem;
    padding: 10px 15px;
  }
  #education .lead-text {
    font-size: 0.95rem;
    padding: 10px 15px;
  }
  .education-card img {
    height: 120px;
  }
  .education-info h4 {
    font-size: 1.1rem;
  }
  .modal-content h3 {
    font-size: 1.5rem;
  }
  .modal-text p {
    font-size: 0.9rem;
  }
  .modal-details {
    font-size: 0.85rem;
  }
}