/**
 * 3D Portfolio Card Styles
 * Beautiful glassmorphic card with 3D effects
 */

.portfolio-card-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  perspective-origin: center center;
  overflow: visible;
  transform-style: preserve-3d;
  cursor: grab;
}

.portfolio-card-wrapper:active {
  cursor: grabbing;
}

.portfolio-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: auto;
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 10;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.3));
  transition: filter 0.3s ease;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
}

.portfolio-card:hover {
  filter: drop-shadow(0 40px 80px rgba(0, 0, 0, 0.4));
}

/* Glassmorphic Card - Total Portfolio Dark Background */
.glass-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.50);
  background: #0C111D;
  box-shadow: 7.089px 8.861px 14.177px 0 rgba(0, 0, 0, 0.05);
  padding: 32px;
  transform: translateZ(30px);
  transform-style: preserve-3d;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, rgba(12, 17, 29, 0.51) -7.23%, rgba(255, 255, 255, 0.00) 111.67%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

/* Ensure content is above the gradient overlay */
.glass-card > * {
  position: relative;
  z-index: 2;
}

/* Card Header */
.card-header {
  position: relative;
  margin-bottom: 24px;
  z-index: 2;
}

.label-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  font-family: 'Poppins', sans-serif;
}

/* Amounts Section */
.amounts-section {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  z-index: 2;
}

.amount-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.amount-block.text-right {
  align-items: flex-end;
}

.amount-value {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  line-height: 1.2;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.amount-label {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  font-family: 'Poppins', sans-serif;
}

/* Card Shadow */
.card-shadow {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 30px;
  background: radial-gradient(ellipse at center, 
    rgba(0, 0, 0, 0.4) 0%, 
    rgba(0, 0, 0, 0.15) 50%,
    transparent 70%);
  border-radius: 50%;
  filter: blur(25px);
  will-change: transform, opacity;
  transition: all 0.3s ease;
  z-index: 1;
}

.portfolio-card-small .card-shadow {
  width: 250px;
  height: 25px;
  bottom: -40px;
}

.portfolio-card:hover .card-shadow {
  transform: translateX(-50%) scale(1.1);
  opacity: 0.8;
}

/* Floating Badges */
.floating-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.2),
    0 5px 15px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  z-index: 5;
  will-change: transform;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-family: 'Poppins', sans-serif;
}

.floating-badge:hover {
  transform: scale(1.1) !important;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.25),
    0 10px 20px rgba(0, 0, 0, 0.15);
}

.badge-icon {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.badge-text {
  font-weight: 600;
  letter-spacing: -0.2px;
}

.badge-1 {
  top: 5%;
  right: -5%;
}

.badge-2 {
  top: 55%;
  right: -5%;
}

.badge-3 {
  bottom: 20%;
  left: -8%;
}

/* Single Amount Layout */
.amounts-section-single {
  justify-content: flex-start;
  text-align: left;
}

.amounts-section-single .amount-block {
  align-items: flex-start;
}

/* Card Gradient Backgrounds */
.portfolio-card.gradient-savings .glass-card {
  background: linear-gradient(135deg, 
    #B01EFF 0%,
    #E1467C 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.portfolio-card.gradient-savings .glass-card::before,
.portfolio-card.gradient-savings .glass-card::after {
  display: none;
}

.portfolio-card.gradient-timedeposit .glass-card {
  background: linear-gradient(135deg, 
    #4300B1 0%,
    #A531DC 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.portfolio-card.gradient-timedeposit .glass-card::before,
.portfolio-card.gradient-timedeposit .glass-card::after {
  display: none;
}

.portfolio-card.gradient-loans .glass-card {
  background: linear-gradient(135deg, 
    #0017E4 0%,
    #3793FF 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.portfolio-card.gradient-loans .glass-card::before,
.portfolio-card.gradient-loans .glass-card::after {
  display: none;
}

/* Card Carousel - Show one card at a time */
.card-carousel-container {
  position: relative;
  min-height: 360px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .card-carousel-container {
    min-height: 320px;
  }
}

.card-carousel-container > div {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateX(100px) scale(0.95);
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-carousel-container > div.card-active {
  opacity: 1;
  transform: translate(-50%, -50%) translateX(0) scale(1);
  pointer-events: auto;
}

.card-carousel-container > div.card-exiting {
  opacity: 0;
  transform: translate(-50%, -50%) translateX(-100px) scale(0.95);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shimmerSweep {
  0% {
    left: -150%;
  }
  100% {
    left: 150%;
  }
}

.card-carousel-container > div.card-active .portfolio-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 80%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3) 50%,
    transparent
  );
  animation: shimmerSweep 1.8s ease-out;
  pointer-events: none;
  z-index: 100;
  border-radius: 16px;
}

.account-card {
  position: relative;
  padding: 18px 22px;
  border-radius: 16px;
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.22),
    0 8px 20px rgba(0, 0, 0, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
  transform: translateZ(20px);
  transform-style: preserve-3d;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Account Card Header */
.account-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}

.account-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  letter-spacing: -0.2px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.account-subtitle {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  font-family: 'Poppins', sans-serif;
}

/* Account Amount Section */
.account-amount-section {
  position: relative;
  z-index: 2;
}

.account-amount {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  line-height: 1.2;
  letter-spacing: -0.7px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  margin-bottom: 3px;
}

.account-label {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  font-family: 'Poppins', sans-serif;
}

/* Gradient Classes */
.gradient-pink .account-card {
  background: linear-gradient(135deg, #e91e8c 0%, #d946a6 50%, #e91e8c 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.gradient-purple .account-card {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #7c3aed 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.gradient-blue .account-card {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #3b82f6 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Add shine to account cards */
.account-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.25) 0%, 
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.15) 100%);
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.6;
}

/* Account card glow */
.account-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.2) 0%, 
    transparent 100%);
  border-radius: inherit;
  pointer-events: none;
}

/* Dark mode adjustments */
.dark .floating-badge {
  background: rgba(30, 30, 30, 0.95);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .glass-card {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 40px 120px rgba(0, 0, 0, 0.5),
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .portfolio-card {
    width: 95%;
  }

  .glass-card {
    padding: 24px;
    border-radius: 20px;
  }

  .account-card {
    padding: 16px 18px;
  }

  .amounts-section {
    gap: 20px;
  }

  .amount-value {
    font-size: 22px;
  }

  .account-amount {
    font-size: 20px;
  }

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

  .account-title {
    font-size: 12px;
  }

  .floating-badge {
    display: none;
  }

  .card-shadow {
    width: 300px;
  }
}

@media (max-width: 480px) {
  .glass-card {
    padding: 20px;
  }

  .account-card {
    padding: 14px 16px;
  }

  .amounts-section {
    gap: 16px;
  }

  .amount-value {
    font-size: 18px;
  }

  .account-amount {
    font-size: 18px;
  }

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

  .account-title {
    font-size: 12px;
  }

  .card-subtitle, .account-subtitle {
    font-size: 9px;
  }

  .amount-label, .account-label {
    font-size: 10px;
  }
}

