/* Container for the 3D effect */
/* Container for the 3D effect */
.credit-card-container {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    perspective: 1000px;

    /* Responsive Sizing */
    width: 100%;
    max-width: 360px;
    /* Don't get too huge */
    aspect-ratio: 1.586;
    /* Standard Credit Card Ratio */
    height: auto;
    margin: 0 auto;
    /* Center in grid cell if possible */

    cursor: pointer;
    box-shadow: none !important;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.credit-card-container.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Common Face Styles */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    /* Slightly more rounded like cards */
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Front Face */
.card-front {
    /* bg handled by common */
}

.card-front::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.05) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    opacity: 0.1;
    pointer-events: none;
}

/* Back Face */
.card-back {
    transform: rotateY(180deg);
    padding: 0;
    /* Custom padding for strip */
    background: linear-gradient(135deg, #334155, #1e293b);
}

.card-strip {
    background: #000;
    height: 40px;
    margin-top: 20px;
    width: 100%;
}

.card-signature-block {
    padding: 0 1.5rem;
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    /* CVV to Right */
}

.card-cvv-box {
    background: white;
    color: black;
    padding: 0.25rem 0.5rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    display: inline-block;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
}

.card-item-name {
    position: absolute;
    top: 15px;
    left: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    max-width: 150px;
    /* Leave space for edit btn */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-full-number {
    padding: 1.5rem;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: white;
    margin-top: auto;
}

/* Typography & Elements */
.card-brand {
    font-family: var(--font-family);
    font-weight: 800;
    font-style: italic;
    font-size: 1.25rem;
    text-align: right;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.card-chip {
    width: 45px;
    height: 34px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.card-number-masked {
    font-size: 1.3rem;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-family: 'Courier New', monospace;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-family);
}

.card-holder,
.card-expiry {
    display: flex;
    flex-direction: column;
}

.card-holder span,
.card-expiry span {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
}

.card-holder div,
.card-expiry div {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* Edit Button */
.card-edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.card-edit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.copy-number-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 10px;
    vertical-align: middle;
}

.copy-number-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}