/* ===========================================
   USUARIO.CSS - VERSIÓN CON CALIFICACIÓN Y FOTO CORREGIDA
   =========================================== */

:root {
    --primary-color: #8a1a1a;
    --primary-dark: #5a0505;
    --primary-light: #fdf2f2;
    --primary-gradient: linear-gradient(135deg, #8a1a1a 0%, #b71c1c 50%, #d32f2f 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 20px 40px rgba(138, 26, 26, 0.15);
}

/* ===== HEADER SIMPLIFICADO ===== */
.usuario-header {
    background: var(--primary-gradient);
    padding: 12px 0;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.usuario-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.header-breadcrumb {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 0.85rem;
}

.header-breadcrumb a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.header-breadcrumb a:hover {
    color: white;
}

.header-breadcrumb span {
    color: white;
}

/* ===== LAYOUT LATERAL ===== */
.usuario-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.perfil-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.anuncios-main {
    flex: 1;
    min-width: 0;
}

/* ===== TARJETA DE PERFIL - CON FOTO CORRECTA ===== */
.profile-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.profile-card:hover {
    box-shadow: var(--card-shadow-hover);
}

/* Cabecera con gradiente */
.profile-header-bg {
    height: 100px;
    background: linear-gradient(135deg, #8a1a1a, #b71c1c);
    position: relative;
    z-index: 1;
}

/* Foto de perfil - centrada, por ENCIMA de la cabecera */
.profile-avatar-center {
    position: relative;
    margin-top: -50px;
    margin-bottom: 15px;
    z-index: 10;
}

.profile-avatar-center img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    background: white;
    transition: transform 0.3s ease;
}

.profile-avatar-center img:hover {
    transform: scale(1.03);
}

/* Información del perfil */
.profile-info-center {
    padding: 0 20px 20px 20px;
    position: relative;
    z-index: 5;
    background: white;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.profile-badge {
    display: inline-block;
    background: #f0f2f5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 15px;
}

.profile-badge i {
    color: #8a1a1a;
    margin-right: 4px;
}

/* ===== CALIFICACIÓN POR ESTRELLAS ===== */
.rating-container {
    margin: 10px 0 15px 0;
    text-align: center;
}

.rating-stars {
    display: inline-flex;
    gap: 5px;
    cursor: pointer;
}

.rating-stars i {
    font-size: 1.2rem;
    color: #ddd;
    transition: all 0.2s ease;
}

.rating-stars i:hover,
.rating-stars i.active {
    color: #ffc107;
}

.rating-stars i.hover {
    color: #ffc107;
}

.rating-stars.disabled {
    cursor: default;
}

.rating-stars.disabled i {
    cursor: default;
}

.rating-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 0.75rem;
    color: #666;
}

.rating-average {
    font-weight: 700;
    color: #ffc107;
}

.rating-count {
    color: #888;
}

.user-rating-message {
    font-size: 0.7rem;
    margin-top: 5px;
}

.user-rating-message a {
    color: #ffc107;
    text-decoration: none;
}

.user-rating-message a:hover {
    text-decoration: underline;
}

/* Estadísticas */
.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    margin: 15px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.profile-stat {
    text-align: center;
}

.profile-stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #8a1a1a;
}

.profile-stat-label {
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Descripción */
.profile-description {
    margin: 15px 0;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    text-align: left;
}

/* Fecha de registro */
.profile-date {
    font-size: 0.7rem;
    color: #888;
    margin-top: 10px;
    text-align: center;
}

.profile-date i {
    margin-right: 4px;
    color: #8a1a1a;
}

/* ===== TARJETAS DE INFORMACIÓN ===== */
.info-modern-card {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 15px;
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.info-modern-card:hover {
    border-color: rgba(138, 26, 26, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.card-header-modern {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(138, 26, 26, 0.1);
}

.card-header-modern .header-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8a1a1a, #b71c1c);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.card-header-modern h6 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
    padding: 0.4rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.info-item:hover {
    background: rgba(138, 26, 26, 0.05);
}

.info-item-icon {
    width: 28px;
    height: 28px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a1a1a;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.info-item-content {
    flex: 1;
}

.info-item-content strong {
    display: block;
    font-size: 0.6rem;
    color: #8a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.info-item-content .info-value {
    font-size: 0.8rem;
    font-weight: 500;
    color: #2c3e50;
    word-break: break-word;
}

.info-item-content .info-value a {
    color: #2c3e50;
    text-decoration: none;
}

.info-item-content .info-value a:hover {
    color: #8a1a1a;
}

.license-badge {
    display: inline-block;
    background: linear-gradient(135deg, #8a1a1a, #b71c1c);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.quick-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem;
    background: linear-gradient(135deg, #8a1a1a, #b71c1c);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    margin-top: 0.5rem;
}

.quick-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(138, 26, 26, 0.3);
    color: white;
}

/* ===== SECCIÓN ANUNCIOS CON FONDO BLANCO ===== */
.anuncios-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.ordenamiento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.ordenamiento-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.ordenamiento-header h2 i {
    color: #8a1a1a;
}

.info-anuncios {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-left: 3px solid #8a1a1a;
    font-size: 0.8rem;
    color: #666;
}

/* ===== GRID DE ANUNCIOS ===== */
.anuncios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.anuncio-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.anuncio-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(138, 26, 26, 0.12);
    border-color: rgba(138, 26, 26, 0.2);
}

.anuncio-image {
    position: relative;
    height: 170px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}

.anuncio-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.anuncio-card:hover .anuncio-image img {
    transform: scale(1.02);
}

.anuncio-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

.anuncio-badge.bg-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
}

.anuncio-badge.bg-primary {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
}

.resaltado-badge {
    position: absolute;
    top: 0px;
    left: 1px;
    z-index: 5;
    width: 60px;
    height: 60px;
}

.resaltado-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.anuncio-content {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.anuncio-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.anuncio-title a {
    color: #333;
    text-decoration: none;
}

.anuncio-title a:hover {
    color: var(--primary-color);
}

.descripcion-corta {
    color: #666;
    font-size: 0.75rem;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anuncio-location {
    color: #666;
    font-size: 0.7rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.anuncio-location i {
    color: var(--primary-color);
    margin-right: 4px;
    font-size: 0.7rem;
}

.anuncio-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.anuncio-price {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 700;
}

.anuncio-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 1px solid #f0f0f0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.7rem;
}

.action-btn:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

.like-count {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 2px 6px;
    font-size: 0.7rem;
    color: #666;
}

.like-count i {
    color: #ff6b6b;
    margin-right: 3px;
    font-size: 0.65rem;
}

/* ===== PAGINACIÓN ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.pagination-list {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    flex-wrap: wrap;
}

.page-link {
    min-width: 36px;
    height: 36px;
    border-radius: 36px;
    background: white;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0 12px;
    font-size: 0.85rem;
}

.page-link:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

.page-link.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

/* ===== ESTADO VACÍO ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 16px;
}

.empty-state-icon {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}

.empty-state h3 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.empty-state p {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.empty-state .btn-primary {
    background: var(--primary-gradient);
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .usuario-layout {
        flex-direction: column;
    }
    
    .perfil-sidebar {
        width: 100%;
    }
    
    .profile-avatar-center img {
        width: 90px;
        height: 90px;
        margin-top: -45px;
    }
}

@media (max-width: 768px) {
    .usuario-header {
        padding: 10px 0;
    }
    
    .anuncios-section {
        padding: 15px;
    }
    
    .anuncios-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
    
    .ordenamiento-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ordenamiento-header h2 {
        font-size: 1rem;
    }
    
    .profile-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .profile-stat {
        flex: 1;
        min-width: 70px;
    }
    
    .rating-stars i {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .anuncios-grid {
        grid-template-columns: 1fr;
    }
    
    .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
        padding: 0 8px;
    }
    
    .profile-avatar-center img {
        width: 80px;
        height: 80px;
        margin-top: -40px;
    }
    
    .profile-name {
        font-size: 1.1rem;
    }
    
    .rating-stars i {
        font-size: 0.9rem;
    }
}
/* ============================================
   SISTEMA DE CALIFICACIÓN POR ESTRELLAS
   ============================================ */

.rating-container {
    margin: 1rem 0;
    text-align: center;
}

.rating-stars {
    display: inline-flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.rating-stars i {
    font-size: 1.5rem;
    cursor: pointer;
    color: #ddd;
    transition: all 0.2s ease;
}

.rating-stars i.active {
    color: #ffc107;
}

.rating-stars i.hover {
    color: #ffc107;
    transform: scale(1.1);
}

.rating-stats {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.rating-average {
    font-weight: bold;
    color: #ffc107;
    font-size: 1.1rem;
}

.rating-count {
    color: #666;
}

.user-rating-message {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
    padding: 0.5rem;
    border-radius: 20px;
    display: inline-block;
    width: auto;
}

.user-rating-message i {
    margin-right: 0.25rem;
}

.user-rating-message a {
    text-decoration: none;
    font-weight: 500;
}

.user-rating-message a:hover {
    text-decoration: underline;
}

/* Estrellas en perfil */
.profile-stars {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin: 0.5rem 0;
}

.profile-stars i {
    font-size: 1rem;
    color: #ffc107;
}

.profile-stars i.inactive {
    color: #ddd;
}

.profile-stars .rating-value {
    margin-left: 0.5rem;
    font-weight: bold;
    color: #333;
}

.profile-stars .rating-total {
    font-size: 0.7rem;
    color: #666;
    margin-left: 0.25rem;
}