/* ===== CAROUSEL 3D IMERSIVO ===== */
.carousel-wrapper {
    /* background: linear-gradient(135deg, #0f172a, #1e293b); */
    background: #e9e9e9;
    border-radius: 20px;
    padding: 40px 20px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.carousel {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 350px;
    perspective: 1200px;
    margin: 0 auto;
}

.carousel__container {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.card {
    position: absolute;
    width: 320px;
    height: 200px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    color: white;
    left: 50%;
    top: 50%;
    margin-left: -160px;
    margin-top: -100px;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

/* Estados dos cartões - Principal, Lateral Esquerdo, Lateral Direito */
.card.active {
    transform: translateX(0) translateZ(100px) scale(1.1);
    z-index: 10;
    opacity: 1;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.card.left {
    transform: translateX(-200px) translateZ(-50px) rotateY(25deg) scale(0.85);
    z-index: 5;
    opacity: 0.7;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.card.right {
    transform: translateX(200px) translateZ(-50px) rotateY(-25deg) scale(0.85);
    z-index: 5;
    opacity: 0.7;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.card.hidden {
    transform: translateX(0) translateZ(-100px) scale(0.6);
    z-index: 1;
    opacity: 0.3;
    pointer-events: none;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    border-radius: 20px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.card.active::before {
    opacity: 1;
}

.card.left::before,
.card.right::before {
    opacity: 0.5;
}



.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.card-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.bandeira {
    font-size: 0.8em;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.card-gasto {
    font-size: 2.2em;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 10px 0;
    position: relative;
    z-index: 1;
}

.card-info {
    font-size: 0.9em;
    text-align: center;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

.card-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

.btn-edit,
.btn-delete {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit:hover {
    background: rgba(59, 130, 246, 0.7);
    transform: scale(1.1);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.7);
    transform: scale(1.1);
}

.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.carousel-btn {
    /* background: rgba(255, 255, 255, 0.15); */
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

body.dark-mode .carousel-btn {
    background: rgba(255, 255, 255, 0.15);
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.carousel-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.carousel-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn {
    /* background: rgba(255, 255, 255, 0.15); */
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    min-width: 120px;
    justify-content: center;
}

body.dark-mode .action-btn {
    background: rgba(255, 255, 255, 0.15);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.edit-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

.action-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.no-cards {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1em;
    text-align: center;
}

/* Cores dos cartões */
.card.from-purple-600.to-pink-500 {
    background: linear-gradient(135deg, #9333ea, #ec4899);
}

.card.from-yellow-500.to-orange-500 {
    background: linear-gradient(135deg, #eab308, #f97316);
}

.card.from-blue-600.to-indigo-600 {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.card.from-green-600.to-teal-500 {
    background: linear-gradient(135deg, #16a34a, #14b8a6);
}

.card.from-red-600.to-pink-600 {
    background: linear-gradient(135deg, #dc2626, #db2777);
}

.card.from-gray-700.to-gray-900 {
    background: linear-gradient(135deg, #374151, #111827);
}

/* Dark Mode */
body.dark-mode .carousel-wrapper {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}

/* Responsivo */
@media (max-width: 768px) {
    .carousel {
        width: 100%;
        max-width: 350px;
        height: 220px;
    }

    .card {
        width: 240px;
        height: 140px;
        margin-left: -120px;
        margin-top: -70px;
        padding: 15px;
    }

    .card.active {
        transform: translateX(0) translateZ(30px) scale(1);
    }

    .card.left {
        transform: translateX(-100px) translateZ(-20px) rotateY(15deg) scale(0.75);
    }

    .card.right {
        transform: translateX(100px) translateZ(-20px) rotateY(-15deg) scale(0.75);
    }
    
    .card-header h3 {
        font-size: 1.1em;
    }
    
    .card-gasto {
        font-size: 1.6em;
    }
    
    .card-info {
        font-size: 0.8em;
    }



    .carousel-wrapper {
        padding: 20px 10px;
        min-height: 320px;
    }

    .carousel-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }

    .carousel-actions {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .action-btn {
        min-width: 140px;
        padding: 10px 16px;
    }
}