/* ==== Welcome/Solutions Section ==== */
.welcome-section {
  padding: 60px 0;
  position: relative;
  background-color: #ffffff;
  overflow: hidden;
  direction: rtl;
}

.welcome-container {
  max-width: 1754px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Solutions Card Grid */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 110px;
  width: 100%;
}

/* Base Solution Card */
.solution-card {
  background-color: #0b1a2f;
  background-size: cover;
  background-position: center;
  position: relative;
  border-radius: 2.5px;
  padding: 24px 28px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.solution-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
}

/* Card overlay to make background image darker and readable */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(9, 21, 38, 0.85) 0%, rgba(5, 12, 22, 0.95) 100%);
  z-index: 1;
  transition: background 0.3s ease;
}

.solution-card:hover .card-overlay {
  background: linear-gradient(135deg, rgba(9, 21, 38, 0.75) 0%, rgba(5, 12, 22, 0.85) 100%);
}

.card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-grow: 1;
  text-align: center;
}

.card-title {
  font-family: 'Sahel', 'Vazirmatn', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
}

.card-subtitle {
  font-family: 'Sahel', 'Vazirmatn', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #f7b731;
  margin-bottom: 20px;
  line-height: 1.4;
}

.card-description {
  font-family: 'Vazirmatn', sans-serif;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.8;
  margin-bottom: 30px;
  flex-grow: 1;
}

/* Card Link / Button on Bottom Left */
.card-link {
  font-family: 'Vazirmatn', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.3s ease;
  align-self: flex-end;
  margin-top: auto;
}

.card-link:hover {
  color: #f7b731;
}

.link-arrow {
  font-size: 16px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.card-link:hover .link-arrow {
  transform: translateX(-4px);
}

/* Background image overrides for the three cards */
.card-economic {
  background-image: url('/static/image/Right.png');
}

.card-generator {
  background-image: url('/static/image/Beetween.png');
}

.card-outage {
  background-image: url('/static/image/Left.jpeg');
}

/* Carousel dots - hidden by default on desktop */
.welcome-carousel-dots {
  display: none;
}

/* ==== Responsive Design ==== */

/* Desktop scaling (1025px - 1400px) */
@media (min-width: 1025px) and (max-width: 1400px) {
  .solutions-grid {
    gap: 40px;
  }

  .solution-card {
    padding: 20px 22px;
    min-height: 200px;
  }

  .card-subtitle {
    font-size: 21px;
  }

  .card-description {
    font-size: 14px;
  }
}

/* ========================================================================= */
/* 3D Horizontal Slider / Carousel for Tablets & Mobile (<= 1024px)         */
/* ========================================================================= */
@media (max-width: 1024px) {
  .welcome-section {
    padding: 50px 0 55px 0;
    overflow: hidden;
  }

  .welcome-container {
    padding: 0 20px;
    overflow: visible;
  }

  .solutions-grid-wrapper {
    position: relative;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    perspective: 1200px;
    -webkit-perspective: 1200px;
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
  }

  .solutions-grid {
    display: block;
    position: relative;
    width: 100%;
    min-height: 280px;
    margin: 0 auto;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
  }

  .solution-card {
    position: absolute;
    top: 0;
    left: 50%;
    width: 360px;
    max-width: 82%;
    margin: 0;
    transform: translate3d(-50%, 0, 0);
    transform-origin: center center;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    will-change: transform, opacity;
    padding: 24px 26px;
    border-radius: 6px;
  }

  .solution-card.is-dragging {
    cursor: grabbing;
    transition: none !important;
  }

  .solution-card.is-active {
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(247, 183, 49, 0.25);
    border-color: rgba(255, 255, 255, 0.18);
  }

  .solution-card:not(.is-active) {
    cursor: pointer;
  }

  .solution-card:not(.is-active) .card-link {
    pointer-events: none;
  }

  .card-subtitle {
    font-size: 21px;
    margin-bottom: 14px;
  }

  .card-description {
    font-size: 14px;
    margin-bottom: 22px;
    line-height: 1.7;
  }

  /* Carousel Dots Navigation */
  .welcome-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 26px;
    position: relative;
    z-index: 15;
  }

  .carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: rgba(11, 26, 47, 0.25);
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .carousel-dot:hover {
    background-color: rgba(247, 183, 49, 0.6);
  }

  .carousel-dot.active {
    width: 26px;
    border-radius: 5px;
    background-color: #f7b731;
    box-shadow: 0 2px 8px rgba(247, 183, 49, 0.35);
  }
}

/* Mobile Screens (<= 767px) */
@media (max-width: 767px) {
  .welcome-section {
    padding: 38px 0 42px 0;
  }

  .welcome-container {
    padding: 0 12px;
  }

  .solutions-grid-wrapper {
    perspective: 900px;
    -webkit-perspective: 900px;
  }

  .solutions-grid {
    min-height: 250px;
  }

  .solution-card {
    width: 300px;
    max-width: 84%;
    padding: 20px 18px;
    min-height: 210px;
    border-radius: 6px;
  }

  .card-title {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .card-subtitle {
    font-size: 18.5px;
    margin-bottom: 12px;
  }

  .card-description {
    font-size: 13.5px;
    line-height: 1.65;
    margin-bottom: 18px;
  }

  .card-link {
    font-size: 14px;
  }

  .welcome-carousel-dots {
    margin-top: 20px;
    gap: 7px;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
  }

  .carousel-dot.active {
    width: 22px;
  }
}

/* Extra Small Phones (<= 380px) */
@media (max-width: 380px) {
  .solution-card {
    width: 260px;
    max-width: 88%;
    padding: 16px 14px;
    min-height: 195px;
  }

  .card-title {
    font-size: 14.5px;
  }

  .card-subtitle {
    font-size: 17px;
    margin-bottom: 10px;
  }

  .card-description {
    font-size: 12.5px;
    margin-bottom: 14px;
  }

  .card-link {
    font-size: 13px;
  }
}