:root {
  --glass-bg: rgba(93, 93, 163, 0.446);
  --violet: #abaaaf;
  --violet-light: #d4d1da;
  --blur: 16px;
  --border-radius: 1.5rem;
  --card-width: 320px;
  --card-width-mobile: 80vw;
  --modal-bg: rgba(17,10,30,0.9);
  --modal-glass: rgba(49, 32, 67, 0.85);
  --transition: 0.4s cubic-bezier(.77,0,.18,1);
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.carousel-container {
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  position: relative;
  margin: 80px auto 80px auto;
  user-select: none;
}
.carousel-track {
  display: flex;
  gap: 2rem;
  transition: transform var(--transition);
  will-change: transform;
}
.testimonial-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1.5px solid rgba(160, 132, 238, 0.11);
  min-width: var(--card-width);
  max-width: var(--card-width);
  flex: 0 0 var(--card-width);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem;
  cursor: pointer;
  transition: box-shadow .25s, transform .25s;
}
.testimonial-card:hover {
  box-shadow: 0 10px 40px 0 rgba(160,132,238,0.17);
  transform: scale(1.03) translateY(-4px);
  margin-top: 10px;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
  width: 100%;
}
.card-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--violet-light);
  box-shadow: 0 2px 14px 0 rgba(160,132,238,0.09);
}
.card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.card-name {
  color: #ccc;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.card-country {
  font-size: .96rem;
  color: var(--violet-light);
  font-weight: 500;
}
.card-date {
  font-size: .88rem;
  color: #ddd;
  margin-bottom: .25rem;
}
.card-subject {
  font-size: 1.01rem;
  font-weight: 500;
  color: var(--violet);
  margin-bottom: .4rem;
  letter-spacing: .01em;
}
.card-comment {
  font-size: 1rem;
  color: #fafaff;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 6.2em;
  line-height: 1.25em;
  margin-bottom: .6em;
}
.see-more {
  color: var(--violet-light);
  cursor: pointer;
  font-size: .99rem;
  font-weight: 500;
  border: none;
  background: none;
  padding: 0;
  outline: none;
  margin-top: -.5em;
  transition: color .18s;
}
.see-more:hover { color: var(--violet); text-decoration: underline; }

.carousel-arrows {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
  margin-bottom: 14px;
  z-index: 20;
  pointer-events: none;
}
.carousel-arrow-btn {
  pointer-events: auto;
  background: rgba(98,71,170,0.22);
  border: none;
  outline: none;
  color: var(--violet-light);
  width: 48px;
  height: 48px;
  margin: 0 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 2px 16px 0 rgba(98,71,170,0.08);
  cursor: pointer;
  transition: background .15s, color .15s, transform .2s;
  backdrop-filter: blur(4px);
}
.carousel-arrow-btn:active { transform: scale(.95);}
.carousel-arrow-btn:hover { background: var(--violet); color: #fff;}

/* MODAL */
.modal-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-bg.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: var(--modal-glass);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  border-radius: 2.1rem;
  box-shadow: 0 18px 54px 0 rgba(160,132,238,0.16);
  max-width: 94vw;
  min-width: 300px;
  width: 370px;
  padding: 2.6rem 2rem 2rem 2rem;
  color: #fafaff;
  position: relative;
  text-align: left;
  opacity: 0;
  transform: translateY(60px) scale(.8);
  transition: 
    opacity .38s cubic-bezier(.45,.06,.6,1.05),
    transform .52s cubic-bezier(.23,.94,.76,.85);
}
.modal-bg.open .modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.modal-bg.closing .modal-card {
  opacity: 0;
  transform: translateY(80px) scale(.7);
  transition:
    opacity .33s cubic-bezier(.44,1,.51,.87),
    transform .32s cubic-bezier(.47,0,.75,1.2);
}
.modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 38px;
  height: 38px;
  background: rgba(130,100,230,0.14);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fafaff;
  font-size: 1.56rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 2px 8px 0 rgba(130,100,230,0.09);
  transition: background .17s;
}
.modal-close:hover {
  background: var(--violet);
  color: #fff;
}
.modal-photo {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 50%;
  border: 2.5px solid var(--violet-light);
  box-shadow: 0 3px 20px 0 rgba(160,132,238,0.18);
  margin-bottom: 1.4rem;
  margin-top: -.6rem;
  margin-left: .2rem;
}
.modal-name { font-size: 1.25rem; font-weight: 600; }
.modal-country { color: var(--violet-light); font-size: 1.04rem; font-weight: 500; }
.modal-date { font-size: .98rem; color: #ccc; margin: .12rem 0 .44rem 0; }
.modal-subject { font-size: 1.09rem; color: var(--violet); font-weight: 500; margin-bottom: .66rem; }
.modal-comment { font-size: 1.06rem; line-height: 1.46; white-space: pre-line; color: #fafaff; }
.modal-card { max-height: 82vh; overflow-y: auto; }

@media (max-width: 800px) {
  .carousel-container { max-width: 100vw; }
  .testimonial-card {
    min-width: var(--card-width-mobile);
    max-width: var(--card-width-mobile);
    flex-basis: var(--card-width-mobile);
    padding: 1.15rem;
  }
  .modal-card {
    width: 97vw;
    min-width: 0;
    padding: 1.4rem .8rem 1.3rem .8rem;
  }
  .carousel-arrows { bottom: -16px; }
}
@media (min-width: 2500px) {
  .carousel-container { max-width: 100vw; }
  .testimonial-card { min-width: 500px; max-width: 500px; font-size: 1.18rem; }
  .modal-card { width: 600px; font-size: 1.18rem;}
}
