/* CEX Dashboard Container */
.phm-cex-dashboard-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Widgets Base */
.cex-widget {
    flex: 1;
    min-width: 320px;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
}

/* Header del Widget */
.cex-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cex-widget-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.cex-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Balances */
.cex-balance-main {
    margin-bottom: 10px;
}

.cex-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.cex-ticker {
    font-size: 1.2rem;
    color: #666;
    font-weight: 500;
}

.cex-balance-fiat-conversions {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 5px;
}

.cex-market-price {
    font-size: 0.8rem;
    color: #2196f3;
    margin-bottom: 25px;
}

/* Botones */
.cex-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cex-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-align: center;
}

.cex-actions .cex-btn {
    flex: 1;
}

.cex-btn-primary {
    background: #00acc1;
    color: #fff;
}
.cex-btn-primary:hover {
    background: #0093a5;
    box-shadow: 0 4px 10px rgba(0, 172, 193, 0.3);
}

.cex-btn-secondary {
    background: #f5f5f5;
    color: #333;
}
.cex-btn-secondary:hover {
    background: #e0e0e0;
}

.cex-btn-outline {
    background: transparent;
    border: 1px solid #ccc;
    color: #333;
}
.cex-btn-outline:hover {
    border-color: #00acc1;
    color: #00acc1;
}

/* --- Virtual Card UI (Diseño Glassmorphism Premium) --- */
.cex-virtual-card {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 16px;
    padding: 24px;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(42, 82, 152, 0.4);
    position: relative;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Añadir un brillo diagonal sutil */
.cex-virtual-card::after, .cex-crypto-wallet::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    animation: shine 4s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.card-logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    font-style: italic;
    opacity: 0.9;
}

.card-chip {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #d4af37 0%, #aa7700 100%);
    border-radius: 6px;
    margin: 15px 0;
    position: relative;
}
.card-chip::after {
    content: '';
    position: absolute;
    top: 5px; left: 0; right: 0; bottom: 5px;
    border-top: 1px solid rgba(255,255,255,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.card-number {
    font-size: 1.4rem;
    letter-spacing: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    margin-bottom: 15px;
}

.card-balance-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-balance span {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.balance-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.card-conversions {
    font-size: 0.8rem;
    opacity: 0.9;
    text-align: right;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}

.card-holder {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-valid {
    font-size: 0.8rem;
    background: rgba(255,255,255,0.2);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Responsividad y Slider Móvil */
@media (max-width: 768px) {
    .phm-cex-dashboard-container {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
        scroll-behavior: smooth;
        scrollbar-width: none; /* Firefox */
    }
    .phm-cex-dashboard-container::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    .cex-slide-item {
        scroll-snap-align: center;
        flex: 0 0 100%;
        max-width: 100%;
    }
    .cex-slider-controls {
        display: block !important;
    }
}

/* --- Modals CSS --- */
.cex-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
}

.cex-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    font-family: 'Inter', sans-serif;
}

.cex-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.cex-modal-header h3 {
    margin: 0; font-size: 1.3rem; color: #333;
}

.cex-modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}
.cex-modal-close:hover { color: #333; }

.cex-modal-body {
    padding: 24px;
}

.cex-address-box {
    background: #f8f9fa;
    border: 1px dashed #ccc;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    margin: 15px 0;
}
.cex-address-box code {
    color: #e83e8c; font-size: 1.1rem;
}

.cex-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    margin-top: 5px;
    box-sizing: border-box;
}

.cex-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    text-align: right;
}

.cex-response-msg {
    margin-top: 15px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}
