/* ==========================================================================
   premium-finance-glass.css
   Estilos Ultra-Premium para el Módulo de Finanzas (Glassmorphism / Neumorphism)
   ========================================================================== */

:root {
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --glass-blur: blur(12px);
    --accent-color: #0ea5e9;
    /* Sky Blue */
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

/* --- Modal Overlay & Container --- */
.finance-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.3);
    /* removed backdrop-filter */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.finance-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.finance-modal {
    background: var(--glass-bg);
    /* removed backdrop-filter */
    -webkit-/* removed backdrop-filter */
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.finance-modal-overlay.active .finance-modal {
    transform: translateY(0) scale(1);
}

/* --- Header Section --- */
.finance-header {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    padding: 24px 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.finance-title h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.finance-title span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-close-glass {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 36px;
    height: 36px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-close-glass:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: rotate(90deg);
}

/* --- Main Layout --- */
.finance-body {
    display: grid;
    grid-template-columns: 350px 1fr;
    height: 100%;
    overflow: hidden;
}

/* --- Left Column: Summary & Payment --- */
.finance-left-col {
    padding: 32px;
    background: rgba(255, 255, 255, 0.4);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.debt-summary-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.circular-progress {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
}

.circular-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
}

.progress-bg {
    stroke: #f1f5f9;
}

.progress-value {
    stroke: url(#gradient);
    stroke-dasharray: 440;
    stroke-dashoffset: 440;
    /* Full circle */
    transition: stroke-dashoffset 1.5s ease;
}

.percentage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.percentage-text .value {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
}

.percentage-text .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.amount-details {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.detail-item span:first-child {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detail-item span:last-child {
    font-weight: 700;
    color: var(--text-primary);
}

/* --- Right Column: History --- */
.finance-right-col {
    padding: 32px;
    overflow-y: auto;
    background: rgba(248, 250, 252, 0.5);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding-left: 24px;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideIn 0.4s forwards;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 1);
}

.timeline-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.timeline-amount {
    font-weight: 800;
    color: #10b981;
    font-size: 1.1rem;
}

/* --- Payment Input --- */
.payment-input-group {
    margin-top: auto;
    /* Push to bottom */
}

.glass-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.6);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.glass-input:focus {
    background: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.btn-glass-primary {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-glass-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .finance-body {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .finance-left-col {
        padding: 24px;
    }

    .circular-progress {
        width: 120px;
        height: 120px;
    }
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
