/* Single Card Layer Styles - Unique Mesh Classes */
.Mesh-card-container {
    position: relative;
    width: 450px;
    height: 285px;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.4));
    perspective: 1000px;
}

.Mesh-card-flip {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s ease-in-out;
}

/* Auto flip on hover */
.Mesh-card-container:hover .Mesh-card-flip:not(.Mesh-auto-typing) {
    transform: rotateY(180deg);
}

/* Only allow hover flip when animation is complete */
.Mesh-card-container.Mesh-animation-complete:hover .Mesh-card-flip {
    transform: rotateY(180deg);
}

/* Disable hover during animation */
.Mesh-card-container:not(.Mesh-animation-complete):hover .Mesh-card-flip {
    transform: none;
}

/* Disabled hover flip - conflicts with click flip */
/* .Mesh-card-container:hover .Mesh-card-flip:not(.Mesh-auto-typing) {
    transform: rotateY(180deg);
} */

.Mesh-card-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    overflow: hidden;
    backface-visibility: hidden;
}

.Mesh-card-front {
    z-index: 2;
}

.Mesh-card-back {
    transform: rotateY(180deg);
    z-index: 1;
}

.Mesh-layer-content {
    width: 100%;
    height: 100%;
    background: 
       url(./assets/background-card.png) no-repeat center center, 
       linear-gradient(90deg, #B242E3 20%, #0abcc2 100%);
    background-size: cover, cover;
    background-blend-mode: overlay;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        0 0 40px rgba(255, 255, 255, 0.1);

    border-radius: 18px;
    padding: 28px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Card Header */
.Mesh-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.Mesh-brand-logo {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.5px;
}

.Mesh-top-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.Mesh-bank-name {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.Mesh-bank-suffix {
    text-transform: lowercase;
}

/* Card Main */
.Mesh-card-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.Mesh-emv-chip {
    width: 40px;
    height: 30px;
    background: 
        url('./assets/chip.png') no-repeat center center,
        linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    background-size: contain, cover;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.Mesh-chip-contacts {
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    /* background: linear-gradient(135deg, #b8860b, #8b6914); */
    border-radius: 2px;
}

.Mesh-card-number {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 3px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'Courier New', monospace;
}

/* Card Footer */
.Mesh-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.Mesh-validity {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.Mesh-label {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    letter-spacing: 1px;
    line-height: 1.2;
}

.Mesh-date {
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.Mesh-cardholder-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    letter-spacing: 1px;
    margin-left: 20px;
}

.Mesh-payment-network {
    background: white;
    color: #1e40af;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Card Showcase Container Styles */
.Mesh-card-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Card Back Side Styles */
.Mesh-card-back .Mesh-layer-content {
    background: 
       url(./assets/background-card.png) no-repeat center center, 
       1px solid rgba(255, 255, 255, 0.1);
    background-size: cover, cover;
    background-blend-mode: overlay;
}

.Mesh-card-back-header {
    margin-bottom: 15px;
}

.Mesh-magnetic-stripe {
    width: 100%;
    height: 45px;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 50%, #000000 100%);
    border-radius: 4px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.Mesh-magnetic-stripe::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #444 20%, #666 50%, #444 80%, transparent 100%);
    transform: translateY(-50%);
}

.Mesh-card-back-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 25px 0;
}

.Mesh-signature-panel {
    background: white;
    border-radius: 4px;
    padding: 8px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.Mesh-signature-label {
    font-size: 7px;
    color: #333;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.Mesh-signature-area {
    height: 25px;
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    border-radius: 2px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    border: 1px solid #ddd;
}

.Mesh-signature-text {
    font-size: 14px;
    color: #1e40af;
    font-weight: 600;
    font-style: italic;
    font-family: 'Brush Script MT', cursive;
}

.Mesh-cvv-section {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.Mesh-cvv-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    letter-spacing: 1px;
}

.Mesh-cvv-number {
    background: white;
    color: #333;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.Mesh-card-back-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.Mesh-bank-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.Mesh-bank-text {
    font-size: 12px;
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.Mesh-bank-address {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.Mesh-security-features {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.Mesh-hologram {
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7);
    border-radius: 50%;
    position: relative;
    animation: Mesh-hologram-shine 2s ease-in-out infinite alternate;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.Mesh-security-text {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-align: center;
}

@keyframes Mesh-hologram-shine {
    0% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
        transform: scale(1.05);
    }
}

/* Card Auto-Typing Animation Styles */
.Mesh-typing-active::after {
    content: '|';
    color: #00D4FF;
    animation: Mesh-typing-cursor 1s infinite;
    font-weight: normal;
}

.Mesh-brand-logo.Mesh-typing-active::after {
    content: '|';
    color: #00D4FF;
    animation: Mesh-typing-cursor 1s infinite;
    font-weight: normal;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.Mesh-brand-logo.Mesh-typing-active {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 212, 255, 0.3);
}

@keyframes Mesh-typing-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Chip Layer Card Data Styles */
.chip-card-data {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.chip-data-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.chip-data-emv {
    flex-shrink: 0;
    background: 
        linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 6px;
    padding: 4px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.chip-data-emv img {
    display: block;
    border-radius: 3px;
}

.chip-card-number {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.chip-card-details {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.chip-card-holder,
.chip-card-expiry {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.chip-card-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.chip-card-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.chip-card-value {
    font-size: 16px;
    color: white;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.chip-card-number .chip-card-value {
    font-size: 20px;
    letter-spacing: 3px;
    color: #00D4FF;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.6),
        0 0 10px rgba(0, 212, 255, 0.3);
}

.chip-brand-logo {
    font-size: 18px;
    font-weight: 800;
    color: #B242E3;
    letter-spacing: 2px;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(178, 66, 227, 0.4);
}

.chip-brand-tagline {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    letter-spacing: 0.5px;
    font-style: italic;
}

/* Manual flip control */
.Mesh-card-flip.Mesh-flipped {
    transform: rotateY(180deg) !important;
}

/* Ensure overlays don't block card clicks */
.card-outline-svg,
.circle-svg,
svg,
.Mesh-card-glow-circle,
.Mesh-card-glow-circle::before {
    pointer-events: none !important;
}

/* Click interaction styles */
.Mesh-card-container {
    cursor: pointer;
    transition: transform 0.1s ease;
}

/* Enhanced hover when animation complete */
.Mesh-card-container.Mesh-animation-complete:hover {
    transform: scale(1.05);
    cursor: pointer;
}

.Mesh-card-container:hover {
    transform: scale(1.02);
}

.Mesh-card-container:active {
    transform: scale(0.98);
}

/* Disable interactions when auto-animation is running */
.Mesh-card-flip.Mesh-auto-typing {
    pointer-events: none;
}

.Mesh-card-container:has(.Mesh-auto-typing) {
    cursor: default;
}

.Mesh-card-container:has(.Mesh-auto-typing):hover {
    transform: none;
}

.Mesh-card-container.Mesh-auto-animating .Mesh-card-flip.Mesh-flipped {
    transform: rotateY(180deg);
}

.Mesh-card-glow-circle {
    position: relative;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    pointer-events: none;
}

.Mesh-card-glow-circle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: rgba(0, 212, 255, 0.8);
    transform: rotate(-90deg);
    animation: Mesh-circle-draw-smooth var(--circle-duration, 4s) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-fill-mode: forwards;
    z-index: 1;
    pointer-events: none;
}

/* Smooth circle auto-completion animation */
@keyframes Mesh-circle-draw-smooth {
    0% {
        transform: rotate(-90deg) scale(1);
        border-top-color: transparent;
        border-right-color: transparent;
        border-bottom-color: transparent;
        border-left-color: transparent;
    }
    25% {
        transform: rotate(-45deg) scale(1);
        border-top-color: rgba(0, 212, 255, 0.5);
        border-right-color: transparent;
        border-bottom-color: transparent;
        border-left-color: transparent;
    }
    50% {
        transform: rotate(0deg) scale(1);
        border-top-color: rgba(0, 212, 255, 0.8);
        border-right-color: rgba(0, 212, 255, 0.8);
        border-bottom-color: transparent;
        border-left-color: transparent;
    }
    75% {
        transform: rotate(45deg) scale(1);
        border-top-color: rgba(0, 212, 255, 0.8);
        border-right-color: rgba(0, 212, 255, 0.8);
        border-bottom-color: rgba(0, 212, 255, 0.8);
        border-left-color: transparent;
    }
    99% {
        transform: rotate(89deg) scale(1);
        border-top-color: rgba(0, 212, 255, 0.8);
        border-right-color: rgba(0, 212, 255, 0.8);
        border-bottom-color: rgba(0, 212, 255, 0.8);
        border-left-color: rgba(0, 212, 255, 0.8);
    }
    100% {
        transform: rotate(90deg) scale(1);
        border-top-color: rgba(0, 212, 255, 0.8);
        border-right-color: rgba(0, 212, 255, 0.8);
        border-bottom-color: rgba(0, 212, 255, 0.8);
        border-left-color: rgba(0, 212, 255, 0.8);
    }
}

.Mesh-card-glow-circle.Mesh-circle-complete {
}

.Mesh-card-glow-circle.Mesh-circle-complete::before {
    border-color: rgba(0, 212, 255, 0.8) !important;
    animation: none !important;
    transform: rotate(90deg) scale(1) !important;
    transition: none !important;
}

/* Responsive Design for Card */
@media (max-width: 768px) {
    .Mesh-card-glow-circle {
        width: 400px;
        height: 400px;
    }
    
    .Mesh-card-container {
        width: 350px;
        height: 220px;
    }
    
    .Mesh-layer-content {
        padding: 20px;
    }
    
    .Mesh-card-number {
        font-size: 18px;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .Mesh-card-glow-circle {
        width: 320px;
        height: 320px;
    }
    
    .Mesh-card-container {
        width: 280px;
        height: 175px;
    }
    
    .Mesh-layer-content {
        padding: 16px;
    }
    
    .Mesh-card-number {
        font-size: 16px;
    }
}
