/* Global Scrollbar Styles */
.news-feed {
    scrollbar-width: thin;
    scrollbar-color: #4f46e5 #f1f1f1;
    max-height: 400px;
    overflow-y: auto;
}
.news-feed::-webkit-scrollbar {
    width: 8px;
}
.news-feed::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.news-feed::-webkit-scrollbar-thumb {
    background-color: #4f46e5;
    border-radius: 20px;
}

/* Progress & Cart Animations */
.progress-bar {
    transition: width 0.5s ease-in-out;
}
.cart-item {
    transition: all 0.3s ease;
}
.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Fade In Utility */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 3D Scene Container */
.scene {
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    height: auto;
    /* Maintain 16:9 aspect ratio */
    aspect-ratio: 16 / 9;
    position: relative;
    margin: 0 auto;
}

/* Credit Card */
.credit-card {
    width: 90%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 5 / 3;
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    transform: translate(-50%, -50%) rotateY(0deg);
    animation: cardSwing 3s ease-in-out forwards;
}
.card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: linear-gradient(135deg, #4a6bff, #8a2be2);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card-chip {
    width: 15%;
    max-width: 50px;
    aspect-ratio: 10 / 7;
    background: linear-gradient(135deg, #ffd700, #c0c0c0);
    border-radius: 5px;
}
.card-number {
    font-family: 'Courier New', monospace;
    font-size: clamp(14px, 2vw, 18px);
    letter-spacing: 2px;
    margin: 15px 0;
}
.card-details {
    display: flex;
    justify-content: space-between;
    font-size: clamp(12px, 1.5vw, 14px);
}
.card-logo {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: bold;
    align-self: flex-end;
}

/* Person Bound by Rope */
.bound-person {
    position: absolute;
    width: 80%;
    max-width: 200px;
    aspect-ratio: 1 / 1;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}
.person {
    width: 50%;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: auto;
    aspect-ratio: 2 / 3;
    background-color: #8b5a2b;
    position: absolute;
    border-radius: 50% 50% 0 0;
}
.head {
    width: 50%;
    aspect-ratio: 1 / 1;
    background-color: #ffdbac;
    border-radius: 50%;
    position: absolute;
    top: -25%;
    left: 25%;
}
.rope,
.cut-rope {
    width: 60%;
    height: 5px;
    background-color: #8b4513;
    position: absolute;
    top: 20%;
    left: 10%;
    border-radius: 5px;
}
.cut-rope {
    transform-origin: right center;
    animation: ropeCut 1s 2.5s forwards;
}
.hands {
    width: 50%;
    height: 10px;
    background-color: #ffdbac;
    position: absolute;
    top: 30%;
    left: 0;
    border-radius: 10px;
}

/* Thank You Message */
.thank-you-message {
    opacity: 0;
    animation: fadeInMessage 1s 3.5s forwards;
    text-align: center;
    margin-top: 20px;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #333;
    font-weight: bold;
}

/* Confetti */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    opacity: 0;
    animation: confettiFall 2s ease-out infinite;
}

/* Keyframes */
@keyframes cardSwing {
    0% { transform: translate(-50%, -50%) rotateY(0deg) translateX(-200px) rotateZ(0deg); }
    30% { transform: translate(-50%, -50%) rotateY(0deg) translateX(0) rotateZ(10deg); }
    50% { transform: translate(-50%, -50%) rotateY(0deg) translateX(0) rotateZ(-5deg); }
    70% { transform: translate(-50%, -50%) rotateY(0deg) translateX(0) rotateZ(2deg); }
    80% { transform: translate(-50%, -50%) rotateY(0deg) translateX(0) rotateZ(-1deg); }
    90%,100% { transform: translate(-50%, -50%) rotateY(0deg) translateX(0) rotateZ(0deg); }
}
@keyframes ropeCut { 0% { transform: scaleX(1); } 100% { transform: scaleX(0); }}
@keyframes fadeInMessage { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); }}
@keyframes confettiFall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(200px) rotate(360deg); opacity: 0; }}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .scene { aspect-ratio: 4 / 3; }
    .card-number, .card-details, .thank-you-message { font-size: 1rem; }
}
@media (max-width: 480px) {
    .scene { aspect-ratio: 1 / 1; }
    .card-front { padding: 10px; }
    .card-number { font-size: 14px; }
}

/* Animations panier */
#cart-count {
    transition: transform 0.3s ease;
}

.add-to-cart {
    transition: all 0.3s ease;
}

.confetti {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}

@keyframes confettiFall {
    0% { transform: translateY(-10px) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}

