﻿/* Education Section with Infinite Scroll - Optimized for All Screens */
#education-section {
  padding: 4rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.infinite-scroll-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1400px;
  height: 750px;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 2rem auto;
  perspective: 2000px;
}

.infinite-scroll-wrapper::before,
.infinite-scroll-wrapper::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  background: linear-gradient(var(--dir, to bottom), rgba(6, 0, 16, 1) 0%, rgba(6, 0, 16, 0.8) 20%, transparent 100%);
  height: 35%;
  width: 100%;
  z-index: 2;
  pointer-events: none;
}

.infinite-scroll-wrapper::before {
  top: 0;
}

.infinite-scroll-wrapper::after {
  --dir: to top;
  bottom: 0;
}

.infinite-scroll-container {
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  padding: 0 2rem;
  cursor: default;
  transform-origin: center center;
  transform: rotateX(25deg) rotateZ(-18deg) skewX(18deg);
  transform-style: preserve-3d;
  width: 100%;
  max-width: 950px;
  will-change: transform;
  pointer-events: none;
  user-select: none;
}

.infinite-scroll-container:active {
  cursor: default;
}

.infinite-scroll-item {
  --accent-color: #fb922b;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 3.5rem 3rem;
  font-size: 1.1rem;
  text-align: center;
  border: 3px solid var(--accent-color);
  background: linear-gradient(145deg, rgba(30, 30, 45, 0.98), rgba(15, 15, 25, 0.95));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
  position: relative;
  min-height: 380px;
  margin-top: -2.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 5px 20px rgba(251, 146, 43, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  will-change: transform, border-color, box-shadow;
}

.infinite-scroll-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 3px;
  background: linear-gradient(145deg, rgba(251, 146, 43, 0.4), rgba(251, 146, 43, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.infinite-scroll-item:hover::before {
  opacity: 1;
}

.infinite-scroll-item:first-child {
  margin-top: 0;
}

.infinite-scroll-item:hover {
  transform: scale(1.03) translateZ(20px);
  border-color: #fff;
  box-shadow: 0 15px 50px rgba(251, 146, 43, 0.4), 0 5px 20px rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.education-item {
  gap: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.education-item .school-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 1.2rem;
  border-radius: 50%;
  border: 4px solid var(--accent-color);
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 
    0 8px 25px rgba(251, 146, 43, 0.3),
    0 0 40px rgba(251, 146, 43, 0.1);
}

.infinite-scroll-item:hover .school-logo {
  transform: scale(1.15) rotate(8deg);
  box-shadow: 
    0 12px 35px rgba(251, 146, 43, 0.5),
    0 0 60px rgba(251, 146, 43, 0.2);
}

.education-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.education-item .degree {
  font-size: 2rem;
  font-weight: 800;
  color: #fb922b;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  text-shadow: 
    0 2px 10px rgba(251, 146, 43, 0.4),
    0 0 30px rgba(251, 146, 43, 0.2);
  letter-spacing: -0.5px;
}

.education-item .institution {
  font-size: 1.4rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.4rem;
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.education-item .duration {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fb922b;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.95;
  text-shadow: 0 1px 4px rgba(251, 146, 43, 0.3);
}

.education-item .description {
  font-size: 1.15rem;
  color: #e0e0e0;
  line-height: 1.8;
  max-width: 650px;
  margin: 0 auto;
  opacity: 0.92;
  font-weight: 400;
}

/* Large Desktop - 1920px and above */
@media (min-width: 1920px) {
  .infinite-scroll-wrapper {
    max-width: 1600px;
    height: 850px;
    perspective: 2500px;
  }
  .infinite-scroll-container {
    max-width: 1150px;
    padding: 0 2.5rem;
  }
  .infinite-scroll-item {
    min-height: 450px;
    padding: 4rem 3.5rem;
    border-radius: 28px;
  }
  .education-item .school-logo {
    width: 140px;
    height: 140px;
  }
  .education-item .degree {
    font-size: 2.4rem;
  }
  .education-item .institution {
    font-size: 1.6rem;
  }
  .education-item .duration {
    font-size: 1.3rem;
  }
  .education-item .description {
    font-size: 1.25rem;
    max-width: 750px;
  }
}

/* Desktop - 1200px to 1919px */
@media (min-width: 1200px) and (max-width: 1919px) {
  .infinite-scroll-wrapper {
    max-width: 1300px;
    height: 700px;
    perspective: 1800px;
  }
  .infinite-scroll-container {
    max-width: 900px;
  }
  .infinite-scroll-item {
    min-height: 350px;
    padding: 3rem 2.5rem;
  }
  .education-item .school-logo {
    width: 110px;
    height: 110px;
  }
  .education-item .degree {
    font-size: 1.8rem;
  }
  .education-item .institution {
    font-size: 1.3rem;
  }
  .education-item .duration {
    font-size: 1.1rem;
  }
  .education-item .description {
    font-size: 1.1rem;
  }
}

/* Laptop - 1024px to 1199px */
@media (min-width: 1024px) and (max-width: 1199px) {
  .infinite-scroll-wrapper {
    max-width: 850px;
    height: 600px;
  }
  .infinite-scroll-container {
    max-width: 650px;
  }
  .infinite-scroll-item {
    min-height: 260px;
  }
}

/* Tablet Landscape - 768px to 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  #education-section {
    padding: 3rem 1.5rem;
  }
  .infinite-scroll-wrapper {
    height: 550px;
    max-width: 100%;
    padding: 0 1rem;
  }
  .infinite-scroll-container {
    max-width: 85%;
    transform: rotateX(18deg) rotateZ(-18deg) skewX(18deg);
    padding: 0 1rem;
  }
  .infinite-scroll-item {
    min-height: 240px;
    padding: 2rem 1.5rem;
    margin-top: -1.5rem;
  }
  .education-item .school-logo {
    width: 75px;
    height: 75px;
  }
  .education-item .degree {
    font-size: 1.3rem;
  }
  .education-item .institution {
    font-size: 1.05rem;
  }
  .education-item .duration {
    font-size: 0.9rem;
  }
  .education-item .description {
    font-size: 0.95rem;
  }
}

/* Tablet Portrait - 481px to 767px */
@media (max-width: 767px) {
  #education-section {
    padding: 3rem 1rem;
  }
  .infinite-scroll-wrapper {
    height: 500px;
    max-width: 100%;
  }
  .infinite-scroll-container {
    max-width: 90%;
    transform: rotateX(15deg) rotateZ(-15deg) skewX(15deg);
    padding: 0 0.8rem;
  }
  .infinite-scroll-item {
    min-height: 220px;
    padding: 1.8rem 1.3rem;
    margin-top: -1.2rem;
    border-radius: 16px;
  }
  .education-item .school-logo {
    width: 65px;
    height: 65px;
    padding: 0.4rem;
  }
  .education-item .degree {
    font-size: 1.2rem;
  }
  .education-item .institution {
    font-size: 1rem;
  }
  .education-item .duration {
    font-size: 0.85rem;
  }
  .education-item .description {
    font-size: 0.9rem;
    line-height: 1.6;
  }
}

/* Mobile Large - 415px to 480px */
@media (max-width: 480px) {
  .infinite-scroll-wrapper {
    height: 470px;
  }
  .infinite-scroll-container {
    max-width: 92%;
    transform: rotateX(12deg) rotateZ(-12deg) skewX(12deg);
  }
  .infinite-scroll-item {
    min-height: 200px;
    padding: 1.5rem 1rem;
    margin-top: -1rem;
  }
  .education-item .school-logo {
    width: 60px;
    height: 60px;
  }
  .education-item .degree {
    font-size: 1.1rem;
  }
  .education-item .institution {
    font-size: 0.95rem;
  }
  .education-item .duration {
    font-size: 0.8rem;
  }
  .education-item .description {
    font-size: 0.85rem;
  }
}

/* Mobile Medium - 376px to 414px */
@media (max-width: 414px) {
  .infinite-scroll-wrapper {
    height: 450px;
  }
  .infinite-scroll-item {
    min-height: 190px;
    padding: 1.3rem 0.9rem;
  }
  .education-item .degree {
    font-size: 1.05rem;
  }
}

/* Mobile Small - 320px to 375px */
@media (max-width: 375px) {
  #education-section {
    padding: 2.5rem 0.8rem;
  }
  .infinite-scroll-wrapper {
    height: 420px;
  }
  .infinite-scroll-container {
    max-width: 95%;
    transform: rotateX(10deg) rotateZ(-10deg) skewX(10deg);
    padding: 0 0.5rem;
  }
  .infinite-scroll-item {
    min-height: 180px;
    padding: 1.2rem 0.8rem;
    margin-top: -0.8rem;
    border-radius: 14px;
  }
  .education-item .school-logo {
    width: 55px;
    height: 55px;
    border-width: 2px;
  }
  .education-item .degree {
    font-size: 1rem;
    margin-bottom: 0.2rem;
  }
  .education-item .institution {
    font-size: 0.9rem;
  }
  .education-item .duration {
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
  }
  .education-item .description {
    font-size: 0.8rem;
    line-height: 1.5;
  }
}

/* Mobile Extra Small - Below 320px */
@media (max-width: 319px) {
  .infinite-scroll-wrapper {
    height: 400px;
  }
  .infinite-scroll-item {
    min-height: 170px;
    padding: 1rem 0.6rem;
  }
  .education-item .school-logo {
    width: 50px;
    height: 50px;
  }
  .education-item .degree {
    font-size: 0.95rem;
  }
  .education-item .institution {
    font-size: 0.85rem;
  }
  .education-item .duration {
    font-size: 0.7rem;
  }
  .education-item .description {
    font-size: 0.75rem;
  }
}

/* Landscape Mode Adjustments */
@media (max-height: 600px) and (orientation: landscape) {
  #education-section {
    padding: 2rem 1rem;
    min-height: auto;
  }
  .infinite-scroll-wrapper {
    height: 350px;
  }
  .infinite-scroll-item {
    min-height: 150px;
    padding: 1rem 0.8rem;
  }
  .education-item .school-logo {
    width: 50px;
    height: 50px;
  }
}
