/* ============= HISTORIAL DE INTERCAMBIOS ============= */
.historial-intercambios {
    max-width: 1000px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.historial-intercambios h2 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.intercambios-lista {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.intercambio-card {
    background: #f9f9f9;
    border-left: 5px solid #2196f3;
    padding: 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.intercambio-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.intercambio-card.estado-completado {
    border-left-color: #4caf50;
    background: #f1f8e9;
}

.intercambio-card.estado-cancelado {
    border-left-color: #f44336;
    background: #ffebee;
}

.intercambio-card.estado-pendiente {
    border-left-color: #ff9800;
    background: #fff3e0;
}

.intercambio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.usuario-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.usuario-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.usuario-info h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.estado-badge {
    background: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    color: #666;
}

.intercambio-detalles {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 15px 0;
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.figurita {
    text-align: center;
    flex: 1;
}

.figurita .codigo {
    display: block;
    font-weight: bold;
    color: #2196f3;
    font-size: 16px;
    margin-bottom: 5px;
}

.figurita .nombre {
    display: block;
    font-size: 12px;
    color: #999;
}

.swap {
    font-size: 24px;
    color: #666;
    margin: 0 20px;
}

.intercambio-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-calificar {
    background: #ffc107;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.btn-calificar:hover {
    background: #ffb300;
    transform: scale(1.05);
}

.mi-calificacion {
    font-size: 13px;
}

.mi-calificacion .estrellas {
    color: #ffc107;
    font-size: 14px;
}

/* ============= MODAL PARA CALIFICAR ============= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.rating-container {
    text-align: center;
}

.estrellas-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    font-size: 40px;
}

.estrella {
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.2s ease;
}

.estrella:hover,
.estrella.activa {
    opacity: 1;
    transform: scale(1.2);
}

#comentario-calificacion {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    margin: 20px 0;
    resize: none;
}

#comentario-calificacion:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

/* ============= PERFIL DE REPUTACIÓN ============= */
.perfil-reputacion {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.perfil-reputacion h2 {
    color: #333;
    margin-bottom: 20px;
}

.perfil-reputacion .avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #2196f3;
    margin-bottom: 20px;
}

.reputacion-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-reputacion,
.stat-intercambios,
.stat-confiabilidad {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-reputacion h3,
.stat-intercambios h3,
.stat-confiabilidad h3 {
    font-size: 32px;
    margin: 0 0 10px 0;
    color: #fff;
}

.stat-reputacion p,
.stat-intercambios p,
.stat-confiabilidad p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.estrellas {
    color: #ffc107;
    font-size: 24px;
    letter-spacing: 2px;
}

/* ============= CALIFICACIONES ============= */
.calificaciones-lista {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
}

.calificacion-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.calificacion-item .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.calificacion-item strong {
    color: #333;
}

.calificacion-item p {
    color: #666;
    font-size: 14px;
    margin: 8px 0;
    line-height: 1.5;
}

.calificacion-item small {
    color: #999;
    font-size: 12px;
}

/* ============= TOP USUARIOS CONFIABLES ============= */
.top-usuarios-confiables {
    max-width: 1200px;
    margin: 30px auto;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.top-usuarios-confiables h2 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.tabla-top-usuarios {
    width: 100%;
    border-collapse: collapse;
}

.tabla-top-usuarios thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tabla-top-usuarios th {
    padding: 15px;
    text-align: left;
    font-weight: bold;
}

.tabla-top-usuarios td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.tabla-top-usuarios tr:hover {
    background: #f5f5f5;
}

.tabla-top-usuarios .ranking {
    font-size: 20px;
    text-align: center;
}

.tabla-top-usuarios .estrellas {
    color: #ffc107;
    font-size: 16px;
    margin-right: 8px;
    letter-spacing: 1px;
}

.tabla-top-usuarios a {
    color: #2196f3;
    text-decoration: none;
    font-weight: bold;
}

.tabla-top-usuarios a:hover {
    text-decoration: underline;
}

.progress-bar-small {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar-small .progress {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    .intercambio-detalles {
        flex-direction: column;
        gap: 10px;
    }
    
    .swap {
        margin: 10px 0;
    }
    
    .intercambio-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .estrellas-selector {
        gap: 10px;
        font-size: 32px;
    }
    
    .reputacion-stats {
        grid-template-columns: 1fr;
    }
    
    .tabla-top-usuarios {
        font-size: 12px;
    }
    
    .tabla-top-usuarios th,
    .tabla-top-usuarios td {
        padding: 10px;
    }
}
