﻿/* Estilos específicos para la página de Administración de Pagos */
.pagos-root {
    min-height: 100vh;
    background: #f3f6fb;
    color: #1f2937;
    width: 100%;
    font-family: sans-serif;
}

    .pagos-root * {
        box-sizing: border-box;
    }

    .pagos-root .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
    }

    /* Header (sin sidebar) */
    .pagos-root .header {
        background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
        padding: 20px 0;
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
    }

    .pagos-root .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .pagos-root .logo {
        font-size: 2rem;
        font-weight: 700;
        color: white;
        text-decoration: none;
        background: linear-gradient(45deg, #ffffff, #f0f9ff, #dbeafe);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .pagos-root .user-info {
        display: flex;
        align-items: center;
        gap: 15px;
        color: white;
    }

    .pagos-root .user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(45deg, #059669, #10b981);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 1.1rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .pagos-root .logout-btn {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: white;
        padding: 8px 16px;
        border-radius: 8px;
        text-decoration: none;
        font-size: 0.9rem;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
    }

        .pagos-root .logout-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px);
        }

    /* Main Content */
    .pagos-root .main-content {
        padding: 40px 0;
    }

    .pagos-root .page-header {
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
        border-radius: 20px;
        padding: 30px 40px;
        margin-bottom: 30px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    }

    .pagos-root .page-title {
        font-size: 2.2rem;
        font-weight: 700;
        color: #1e3a8a;
        margin-bottom: 10px;
    }

    .pagos-root .page-subtitle {
        font-size: 1.1rem;
        color: #64748b;
    }

    /* --- ESTILOS DE CONTENIDO PRINCIPAL --- */
    .pagos-root .tab-content {
        background: white;
        border-radius: 20px;
        padding: 30px 40px;
        box-shadow: 0 10px 40px rgba(220, 225, 240, 0.7);
        border: 1px solid #e2e8f0;
        margin-bottom: 40px;
    }

    .pagos-root .table-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
        gap: 20px;
        flex-wrap: wrap;
    }

    .pagos-root .table-title {
        font-size: 1.6rem;
        color: #1e3a8a;
        margin: 0;
    }

    .pagos-root .company-name {
        color: #2563eb;
        font-weight: 700;
    }

    .pagos-root .search-box {
        position: relative;
        flex-grow: 1;
        min-width: 250px;
        max-width: 400px;
    }

        .pagos-root .search-box input {
            width: 100%;
            padding: 12px 40px 12px 16px;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            font-size: 0.95rem;
            background-color: #f9fafb;
            transition: all 0.3s ease;
        }

            .pagos-root .search-box input:focus {
                background-color: white;
                border-color: #2563eb;
                box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
                outline: none;
            }

    .pagos-root .search-icon {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: #9ca3af;
    }


    .pagos-root .add-btn {
        background: linear-gradient(135deg, #059669, #10b981);
        color: white;
        border: none;
        padding: 12px 25px;
        border-radius: 10px;
        font-weight: 600;
        font-size: 0.95rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
        white-space: nowrap;
    }

        .pagos-root .add-btn span {
            font-size: 1.3rem;
            line-height: 1;
        }

        .pagos-root .add-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
        }


/* Tabs Navigation */
.tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: -1px; /* Para que la pestaña activa se una visualmente a la tarjeta */
    padding: 0 10px;
}

.tab-btn {
    padding: 12px 24px;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .tab-btn:hover {
        background: #edf2f7;
        color: #1e3a8a;
    }

    .tab-btn.active {
        background: white;
        color: #2563eb;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.03);
        border-top: 3px solid #2563eb;
    }
    /* Tabla */
    .pagos-root .table-container {
        overflow-x: auto;
    }

    .pagos-root .admin-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 8px;
        font-size: 0.95rem;
    }

        .pagos-root .admin-table th {
            text-align: left;
            padding: 15px 20px;
            background: transparent;
            color: #64748b;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.8rem;
            letter-spacing: 0.5px;
            border-bottom: 2px solid #e2e8f0;
        }

        .pagos-root .admin-table td {
            padding: 20px;
            border: none;
            background: #fdfdff;
            color: #334155;
            vertical-align: middle;
        }

        .pagos-root .admin-table tr.data-row {
            transition: all 0.2s ease-in-out;
            border-radius: 12px;
            box-shadow: 0 2px 10px -2px rgba(220, 225, 240, 0.6);
            border: 1px solid #f0f3f8;
        }

            .pagos-root .admin-table tr.data-row:hover {
                transform: translateY(-3px) scale(1.01);
                background: #ffffff;
                box-shadow: 0 10px 30px -5px rgba(200, 205, 220, 0.9);
            }

        .pagos-root .admin-table tr td:first-child {
            border-top-left-radius: 12px;
            border-bottom-left-radius: 12px;
        }

        .pagos-root .admin-table tr td:last-child {
            border-top-right-radius: 12px;
            border-bottom-right-radius: 12px;
        }

    .pagos-root .actions-cell {
        text-align: center;
    }

    .pagos-root .action-btn.view-btn {
        background: #eef2ff;
        color: #4338ca;
        border: 2px solid #e0e7ff;
        padding: 10px 20px;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
    }

        .pagos-root .action-btn.view-btn:hover {
            background: #e0e7ff;
            transform: translateY(-2px);
        }

        .pagos-root .action-btn.view-btn span {
            font-size: 1.1rem;
        }

    .pagos-root .action-btn.generate-payment-btn {
        background: #1e3a8a;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
    }

        .pagos-root .action-btn.generate-payment-btn:hover {
            background: #2563eb;
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
        }

    /* Status Badge */
    .pagos-root .status-badge {
        padding: 5px 12px;
        border-radius: 20px;
        font-size: 0.8rem;
        font-weight: 600;
        display: inline-block;
    }

        .pagos-root .status-badge.active {
            background: rgba(16, 185, 129, 0.1);
            color: #059669;
        }

        .pagos-root .status-badge.inactive {
            background: rgba(239, 68, 68, 0.1);
            color: #dc2626;
        }

    /* Paginación */
    .pagos-root .pagination-controls {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 25px;
    }

    .pagos-root .pagination-btn {
        background: #f8fafc;
        color: #64748b;
        border: 2px solid #e2e8f0;
        padding: 8px 16px;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
    }

        .pagos-root .pagination-btn:hover:not(:disabled) {
            background: #f1f5f9;
            border-color: #cbd5e1;
        }

        .pagos-root .pagination-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

/* --- ESTILOS DE MODALES Y FORMULARIOS --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    animation: modalFadeIn 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

    .modal-close:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: rotate(90deg);
    }

.modal-body {
    padding: 30px;
    max-height: calc(90vh - 75px);
    overflow-y: auto;
}

.admin-form {
    width: 100%;
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f1f5f9;
}

    .form-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e3a8a;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #e2e8f0;
    position: relative;
}

    .form-section-title::after {
        content: '';
        position: absolute;
        bottom: -3px;
        left: 0;
        width: 60px;
        height: 3px;
        background: linear-gradient(135deg, #2563eb, #3b82f6);
        border-radius: 2px;
    }

.form-grid {
    display: grid;
    gap: 20px;
}

    .form-grid.three-columns {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

    .form-group.span-3 {
        grid-column: span 3;
    }

    .form-group label {
        font-size: 0.9rem;
        font-weight: 600;
        color: #374151;
    }

.form-input, .form-select, .form-input[type="date"] {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    background-color: #f9fafb;
    transition: all 0.3s ease;
    font-family: inherit;
    color: #1f2937;
}

    .form-input:focus, .form-select:focus {
        background-color: white;
        border-color: #2563eb;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
        outline: none;
    }

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 45px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding-top: 30px;
    margin-top: 20px;
    border-top: 2px solid #f1f5f9;
}

.cancel-btn, .submit-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

    .cancel-btn:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }

.submit-btn {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

    .submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    }

/* --- NUEVOS ESTILOS PARA MODAL DE PAGO --- */
.modal-container.payment-setup-modal {
    max-width: 600px;
}

.license-description {
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #4b5563;
}

    .license-description p {
        margin: 0;
    }

.price-display-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.price-input {
    font-weight: 600;
    color: #1e3a8a;
    background-color: #f3f4f6 !important;
    text-align: center;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.toggle-label {
    font-weight: 500;
    color: #374151;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 20px;
        width: 20px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        transition: .4s;
        border-radius: 50%;
    }

input:checked + .slider {
    background-color: #2563eb;
}

    input:checked + .slider:before {
        transform: translateX(22px);
    }

.total-to-pay {
    background: #eef2ff;
    border: 2px solid #c7d2fe;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-top: 10px;
}

    .total-to-pay .total-label {
        display: block;
        font-size: 1rem;
        font-weight: 600;
        color: #4338ca;
        margin-bottom: 5px;
    }

    .total-to-pay .total-amount {
        font-size: 2.2rem;
        font-weight: 700;
        color: #312e81;
    }

/* Gateway Modal Styles */
.modal-container.gateway-modal {
    max-width: 480px;
}

.gateway-body {
    text-align: center;
}

.payment-info-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 28px;
}

.payment-amount {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.amount-label {
    font-size: 0.9rem;
    color: #0369a1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.amount-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0c4a6e;
    letter-spacing: -1px;
}

.payment-description {
    color: #0369a1;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.gateway-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.gateway-btn {
    padding: 18px 24px;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

    .gateway-btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .gateway-btn:hover::before {
        width: 300px;
        height: 300px;
    }

.gateway-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.gateway-text {
    position: relative;
    z-index: 1;
}

.gateway-btn.paypal-btn {
    background: linear-gradient(135deg, #0070ba 0%, #003087 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 112, 186, 0.3);
}

    .gateway-btn.paypal-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(0, 112, 186, 0.4);
    }

.gateway-btn.stripe-btn {
    background: linear-gradient(135deg, #635bff 0%, #5469d4 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(99, 91, 255, 0.3);
}

    .gateway-btn.stripe-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(99, 91, 255, 0.4);
    }

.payment-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

    .payment-security svg {
        color: #10b981;
    }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    color: #64748b;
    font-size: 0.92rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .back-link:hover {
        color: #1f2937;
        transform: translateX(-4px);
    }
/* Animaciones y Responsive */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalPopIn {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .pagos-root .main-content-wrapper {
        margin-left: 0;
    }

    .pagos-root .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .form-grid.three-columns {
        grid-template-columns: 1fr;
    }

    .form-group.span-3 {
        grid-column: span 1;
    }

    .price-display-grid {
        grid-template-columns: 1fr;
    }
}
