/* ===================================
   VARIABLES CSS Y BASE
   =================================== */
   :root {
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --info-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    color: #374151;
}

/* ===================================
   GRADIENTES Y FONDOS
   =================================== */
.gradient-bg {
    background: linear-gradient(135deg, #5c388e 0%, #3730a3 50%, #7c3aed 100%);
    min-height: 100vh;
}

.header-gradient {
    background: var(--primary-gradient);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   PÁGINA DE LOGIN
   =================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(10px);
}

.logo-container {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
}

.ssl-indicator {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    margin-top: 1.5rem;
}

/* ===================================
   BOTONES
   =================================== */
.btn-gradient {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success-gradient {
    background: var(--success-gradient);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-success-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    z-index: 5;
}

.btn-eye:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* ===================================
   FORMULARIOS
   =================================== */
.form-control {
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    padding: 12px 16px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
}

.form-control:invalid {
    border-color: #ef4444;
}

.form-control::placeholder {
    color: #9ca3af;
}

/* ===================================
   CARDS Y COMPONENTES
   =================================== */
.card-modern {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-modern:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* ===================================
   NAVEGACIÓN
   =================================== */
.nav-tabs {
    border: none;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 12px;
    margin-right: 8px;
    padding: 12px 20px;
    color: #6b7280;
    background: transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.nav-tabs .nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

/* ===================================
   ESTADOS Y BADGES
   =================================== */
.status-badge {
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-al-dia {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border: 1px solid #86efac;
}

.status-pagado {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border: 1px solid #86efac;
}

.status-pendiente {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.status-programado {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    border: 1px solid #60a5fa;
}

.status-vencido {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    color: #991b1b;
    border: 1px solid #f87171;
}

/* ===================================
   INFORMACIÓN Y MÉTRICAS
   =================================== */
.info-card {
    border-radius: 12px;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.info-card-blue {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #93c5fd;
}

.info-card-purple {
    background: linear-gradient(135deg, #faf5ff, #e9d5ff);
    border-color: #c084fc;
}

.info-card-yellow {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fcd34d;
}

.info-card-green {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac;
}

.info-card-red {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border-color: #fca5a5;
}

/* ===================================
   ELEMENTOS DE LISTA
   =================================== */
.payment-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.payment-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateX(4px);
}

.credit-item {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.credit-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.credit-item:hover {
    border-color: #3b82f6;
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* ===================================
   BOTONES DE ACCIÓN RÁPIDA
   =================================== */
.quick-amount-btn {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    background: white;
    color: #374151;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.quick-amount-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    transform: translateY(-2px);
}

.quick-amount-btn.selected {
    border-color: #3b82f6;
    background: var(--primary-gradient);
    color: white;
}

/* ===================================
   PROGRESS BARS
   =================================== */
.progress {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    background: var(--success-gradient);
    transition: width 0.6s ease;
}

.progress-bar.bg-warning {
    background: var(--warning-gradient);
}

.progress-bar.bg-danger {
    background: var(--danger-gradient);
}

/* ===================================
   LOADING Y OVERLAYS
   =================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ===================================
   ALERTAS PERSONALIZADAS
   =================================== */
.alert-custom {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.alert-success-custom {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-warning-custom {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-danger-custom {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info-custom {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* ===================================
   CALENDARIO
   =================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 1rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-day:hover {
    background: #f3f4f6;
}

.calendar-day.has-payment {
    background: var(--warning-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.calendar-day.has-payment:hover {
    transform: scale(1.1);
}

.calendar-day.today {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

/* ===================================
   ANIMACIONES
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 20px;
    }

    .logo-container {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .card-modern {
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
        margin-right: 4px;
    }

    .info-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .quick-amount-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .credit-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .card-header {
        padding: 1rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    h5 {
        font-size: 1.1rem;
    }

    h6 {
        font-size: 1rem;
    }
}

/* ===================================
   UTILIDADES
   =================================== */
.text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
    backdrop-filter: blur(10px);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--primary-gradient) border-box;
}

.cursor-pointer {
    cursor: pointer;
}

.overflow-hidden {
    overflow: hidden;
}

.position-relative {
    position: relative;
}

.z-index-10 {
    z-index: 10;
}

/* ===================================
   DARK MODE SUPPORT (OPCIONAL)
   =================================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment if you want dark mode support */
    /*
    :root {
        --bg-primary: #1f2937;
        --bg-secondary: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
    }
    */
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .navbar,
    .nav-tabs,
    .btn,
    .modal {
        display: none !important;
    }

    .card-modern {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    body {
        background: white !important;
    }
}

/* ===================================
   DROP DOWN
   =================================== */
.dropdown-menu {
    min-width: 350px !important;
    padding: 1rem !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
}

/* Información del usuario en el dropdown */
.dropdown-header {
    padding: 0.75rem 0 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    border-bottom: 1px solid #eee !important;
    margin-bottom: 0.5rem !important;
}

/* Items del dropdown */
.dropdown-item {
    padding: 0.75rem 0 !important;
    font-size: 1rem !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
}

.dropdown-item:hover {
    background-color: #f8f9fa !important;
    transform: translateX(5px) !important;
}

.dropdown-item i {
    margin-right: 10px !important;
    width: 20px !important;
    text-align: center !important;
}

/* ID del usuario con estilo diferente */
.user-id {
    font-size: 0.9rem !important;
    color: #6c757d !important;
    font-weight: normal !important;
    margin-top: 0.25rem !important;
}

/* Separador en el dropdown */
.dropdown-divider {
    margin: 0.75rem 0 !important;
    border-color: #eee !important;
}

/* Botón de cerrar sesión con color diferente */
.dropdown-item.logout {
    color: #dc3545 !important;
    margin-top: 0.5rem !important;
    border-top: 1px solid #eee !important;
    padding-top: 1rem !important;
}

.dropdown-item.logout:hover {
    background-color: #f8d7da !important;
    color: #dc3545 !important;
}

/* Mejorar el select del filtro de calendario */
/* Header section del calendario */
.calendar-header-section {
    margin-bottom: 2rem;
}

/* Título del calendario */
.calendar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: left;
}

/* Container del filtro */
.calendar-filter-container {
    width: 100%;
    max-width: 100%;
}

/* Select del filtro */
.calendar-select {
    width: 100% !important;
    max-width: 100% !important;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 500;
    background-color: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
}

.calendar-select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.calendar-select:hover {
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Cards del calendario */
.card-modern {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-modern .card-body {
    padding: 1.5rem;
}

/* Responsive mejorado */
@media (max-width: 768px) {
    .calendar-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .calendar-filter-container {
        margin-bottom: 1rem;
    }
    
    .calendar-select {
        font-size: 0.95rem;
        padding: 10px 14px;
        padding-right: 40px;
    }
}

@media (max-width: 576px) {
    .calendar-header-section {
        margin-bottom: 1.5rem;
    }
    
    .calendar-title {
        font-size: 1.1rem;
    }
}

/* Modales de pago */
.payment-methods {
    max-height: 400px;
    overflow-y: auto;
}

.payment-method-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-method-card.available:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.payment-method-card.available:hover .card {
    border-color: #007bff !important;
}

.payment-method-card.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.payment-method-card .card {
    transition: all 0.3s ease;
}

.method-icon {
    width: 60px;
    text-align: center;
}

.method-info h6 {
    font-weight: 600;
}

.method-action {
    width: 30px;
    text-align: center;
}

/* Resumen de pago */
.payment-summary {
    border-left: 4px solid #007bff;
}

/* Instrucciones de pago */
.list-group-numbered {
    counter-reset: step-counter;
}

.list-group-numbered .list-group-item {
    counter-increment: step-counter;
    padding-left: 2.5rem;
    position: relative;
    border: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
    border-radius: 8px;
}

.list-group-numbered .list-group-item::before {
    content: counter(step-counter);
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: #007bff;
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-lg {
        max-width: 95%;
    }
    
    .payment-method-card .card-body {
        padding: 1rem 0.75rem;
    }
    
    .method-icon {
        width: 50px;
    }
    
    .method-icon i {
        font-size: 1.2rem !important;
    }
}