/* Portfolio Section */
.portfolio {
  padding: 40px;
  background: #262840;
  border-color: #007bff;
}

.portfolio .heading {
  text-align: center;
  font-size: 4.5rem;
  margin-bottom: 3.5rem;
  color: #ffffff !important;
}

.portfolio .heading span {
  color: var(--main-color, #59B2f4) !important;
}

/* Container Layout */
.portfolio-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Card Styling - Equal size across all cards */
.card {
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--snd-color, #262840);
  border-radius: 16px;
  border: 1px solid rgba(89, 178, 244, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card:hover {
  transform: translateY(-8px);
  border-color: rgba(89, 178, 244, 0.6);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 0 20px rgba(89, 178, 244, 0.25);
}

/* Front Image - Uniform height and crop */
.card .front {
  width: 100%;
  height: 220px;
  flex: 0 0 220px;
  overflow: hidden;
  background: #191f36;
  position: relative;
}

.card .front a {
  display: block;
  width: 100%;
  height: 100%;
}

.card .front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.card:hover .front img {
  transform: scale(1.08);
}

.placeholder-card-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: rgba(89, 178, 244, 0.35);
  background: #191f36;
  transition: color 0.3s ease;
}

.card:hover .placeholder-card-img {
  color: var(--main-color, #59B2f4);
}

/* Back Content - Stretched to fill remaining card space */
.card .back {
  padding: 2.4rem 2.2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.card .back-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  justify-content: space-between;
  align-items: center;
}

.card .back h2 {
  margin-bottom: 1.2rem;
  font-size: 2.1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  min-height: 5.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card .back p {
  font-size: 1.45rem;
  color: #cbd5e0;
  line-height: 1.6;
  margin-bottom: 2rem;
  flex: 1 1 auto;
  min-height: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* View Details Button & Action Group - Always pinned to bottom */
.card-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: auto;
  width: 100%;
  padding-top: 0.5rem;
}

.btn-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.9rem 2rem;
  min-height: 4.2rem;
  background: var(--main-color, #59B2f4);
  color: var(--snd-color, #191f36) !important;
  font-size: 1.45rem;
  font-weight: 700;
  border-radius: 35px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(89, 178, 244, 0.4);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-card:hover {
  background: #ffffff;
  color: #191f36 !important;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 24px rgba(89, 178, 244, 0.65);
}

.btn-card i {
  font-size: 1.3rem;
  transition: transform 0.25s ease;
}

.btn-card:hover i {
  transform: translateX(4px);
}

/* Open Live Project Button on Cards */
.btn-card-live {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.9rem 2rem;
  min-height: 4.2rem;
  border-radius: 35px;
  text-decoration: none;
  font-size: 1.45rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(0, 180, 216, 0.4) !important;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-card-live:hover {
  background: linear-gradient(135deg, #0096c7 0%, #03045e 100%) !important;
  color: #ffffff !important;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 180, 216, 0.7) !important;
}

/* Responsive Layout */
@media (max-width: 992px) {
  .portfolio-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .portfolio-container {
    grid-template-columns: 1fr;
  }
}
