/* Estilos para la sección de resultados de facturas */

/* Estilos generales de resultados */
.results-section {
    margin-top: 20px;
    animation: fadeIn 0.6s ease-out;
}

.success-banner {
    background-color: #e6f7ef;
    color: #38a169;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    border-left: 5px solid #48bb78;
    animation: fadeIn 0.5s ease-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.success-banner svg {
    margin-right: 15px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}

.success-banner span {
    font-weight: 600;
    font-size: 1.05rem;
}

/* Pestañas de navegación */
.result-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
    gap: 5px;
}

.tab {
    padding: 14px 25px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: #718096;
    font-weight: 500;
    transition: all 0.3s;
    background-color: #f8fafc;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab svg {
    width: 18px;
    height: 18px;
}

.tab.active {
    color: #4299e1;
    border-bottom-color: #4299e1;
    background-color: #ebf8ff;
}

.tab:hover:not(.active) {
    background-color: #f1f5f9;
    color: #4a5568;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* Tablas de datos */
.table-title {
    color: #2d3748;
    font-size: 1.3rem;
    margin: 30px 0 15px 0;
    padding-left: 15px;
    border-left: 5px solid #4299e1;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.data-table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    position: relative;
}

/* Scroll dual para tablas */
.data-table-container.with-dual-scroll {
    overflow-x: hidden;
}

.data-table-container.with-dual-scroll .table-top-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    height: 15px;
    margin-bottom: -15px;
    position: relative;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background: #f7fafc;
}

.data-table-container.with-dual-scroll .table-top-scroll::-webkit-scrollbar {
    height: 8px;
}

.data-table-container.with-dual-scroll .table-top-scroll::-webkit-scrollbar-thumb {
    background: #a0aec0;
    border-radius: 10px;
}

.data-table-container.with-dual-scroll .table-top-scroll::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 10px;
}

.data-table-container.with-dual-scroll .table-top-scroll div {
    height: 1px;
    display: block;
}

.data-table-container.with-dual-scroll .table-main-scroll {
    overflow-x: auto;
    overflow-y: visible;
    margin-top: 15px;
    border-radius: 12px;
}

/* Estilos de scrollbar generales */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #b0b0b0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Estilos de la tabla */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    font-size: 0.95rem;
    margin-bottom: 0;
    box-shadow: none;
}

.data-table tr:nth-child(even) {
    background-color: #f9fafd;
}

.data-table th {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    text-align: left;
    padding: 15px 18px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    position: relative;
}

.data-table th:after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(255,255,255,0.3);
}

.data-table th:last-child:after {
    display: none;
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
    transition: all 0.2s;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #f8fafc;
}

/* Cabecera de información */
.cabecera-info {
    background: linear-gradient(to right, #f9fafc, #f7faff);
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.cabecera-item {
    margin-bottom: 5px;
}

.cabecera-label {
    font-weight: 600;
    color: #4a5568;
    margin-right: 5px;
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    text-transform: capitalize;
}

.cabecera-value {
    color: #2d3748;
    font-size: 1.1rem;
    display: block;
    padding: 3px 0;
}

/* Mensajes de no datos */
.no-data-message {
    background-color: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
    color: #718096;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px dashed #e2e8f0;
}

.no-data-message svg {
    margin-bottom: 10px;
    color: #a0aec0;
}

.no-data-message p {
    margin: 0;
    font-size: 0.95rem;
}

.no-data {
    color: #718096;
    font-style: italic;
}

/* Mejoras para valores numéricos y especiales */
.numeric-cell {
    text-align: right;
    font-family: 'Roboto Mono', monospace, 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
}

.strong-value {
    font-weight: 600;
    color: #2d3748;
}

.price-value {
    color: #3182ce;
}

.total-value {
    color: #38a169;
    font-weight: 700;
}

.data-table tbody tr:last-child {
    border-top: 2px solid #e2e8f0;
    font-weight: 600;
}

.data-table tbody tr:last-child td {
    background-color: #f7fafc;
}

/* Visualización de JSON */
.formatted-json {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Roboto Mono', monospace, 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #4a5568;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.formatted-json .key {
    color: #805ad5;
}

.formatted-json .string {
    color: #38a169;
}

.formatted-json .number {
    color: #3182ce;
}

.formatted-json .boolean {
    color: #dd6b20;
}

.formatted-json .null {
    color: #a0aec0;
}

/* Sección de estadísticas */
.stats-section {
    margin-top: 30px;
}

.cost-summary {
    margin-bottom: 30px;
}

.cost-card {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.cost-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.cost-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cost-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #3182ce;
    font-family: 'Roboto Mono', monospace;
}

.cost-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.cost-metric {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.metric-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.value-number {
    font-family: 'Roboto Mono', monospace;
}

.token-bar {
    height: 8px;
    background-color: #edf2f7;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.token-fill {
    height: 100%;
    background: linear-gradient(90deg, #3182ce, #63b3ed);
    border-radius: 4px;
}

.tokens-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #718096;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.stat-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: auto;
}

.badge-blue {
    background-color: #ebf8ff;
    color: #3182ce;
}

.badge-green {
    background-color: #f0fff4;
    color: #38a169;
}

.badge-purple {
    background-color: #f5f0ff;
    color: #805ad5;
}

/* Botones de acción para la sección de resultados */
.result-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn.action-btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn.action-btn:active {
    transform: translateY(0);
}

.btn.action-btn svg {
    flex-shrink: 0;
}

.add-more-btn {
    background-color: #4299e1;
    color: white;
}

.add-more-btn:hover {
    background-color: #3182ce;
}

.save-btn {
    background-color: #48bb78;
    color: white;
}

.save-btn:hover {
    background-color: #38a169;
}

.download-btn {
    background-color: #ed8936;
    color: white;
}

.download-btn:hover {
    background-color: #dd6b20;
}

.new-scan-btn {
    background-color: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.new-scan-btn:hover {
    background-color: #edf2f7;
    color: #2d3748;
}

/* Ajustes para móviles */
@media (max-width: 768px) {
    .result-tabs {
        overflow-x: auto;
        white-space: nowrap;
        gap: 0;
    }
    
    .tab {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .cabecera-info {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .data-table th, .data-table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
    
    .success-banner {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .cost-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn.action-btn {
        width: 100%;
        padding: 10px 15px;
    }
}

/* Estilos para notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid #4299e1;
}

.notification.visible {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    border-left-color: #48bb78;
}

.notification.error {
    border-left-color: #e53e3e;
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification.success .notification-icon svg {
    stroke: #48bb78;
}

.notification.error .notification-icon svg {
    stroke: #e53e3e;
}

.notification-message {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.4;
}

/* Animación de rotación para el icono de carga */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotating {
    animation: spin 1.5s linear infinite;
}

/* Estilos para estados de los botones */
.btn.action-btn.success {
    background-color: #48bb78;
    color: white;
}

.btn.action-btn.error {
    background-color: #e53e3e;
    color: white;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
    border-left: 4px solid #4299e1;
}

.notification.visible {
    transform: translateX(0);
}

.notification.success {
    border-left-color: #48bb78;
}

.notification.error {
    border-left-color: #e53e3e;
}

.notification-icon {
    flex-shrink: 0;
}

.notification-message {
    font-weight: 500;
    color: #2d3748;
}

/* Ajustes para móviles */
@media (max-width: 480px) {
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
} 