/* ========================================
   LATINBOOK - SISTEMA DE AMIGOS MODERNO V2
   Inspirado en Instagram/Facebook
   ======================================== */

/* ===== CONTENEDOR PRINCIPAL ===== */
.friends-container-modern {
    width: 100%;
    max-width: 100%;
    background: var(--background);
    padding: 0;
    margin: 0;
}

/* ===== HEADER CON GRADIENTE LATINBOOK ===== */
.friends-header-modern {
    background: linear-gradient(135deg, #FF6B35 0%, #FF3CAC 50%, #784BA0 100%);
    padding: 30px 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 8px 30px rgba(255, 60, 172, 0.25);
    position: relative;
    overflow: hidden;
}

.friends-header-modern::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: pulse-light 4s ease-in-out infinite;
}

@keyframes pulse-light {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.friends-header-content {
    position: relative;
    z-index: 1;
}

.friends-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.friends-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.friends-icon-main {
    font-size: 32px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.friends-title-modern {
    font-size: 28px;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.friends-count-badge {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.friends-count-badge i {
    font-size: 14px;
    color: #FFFFFF;
}

.friends-count-text {
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
}

/* ===== BARRA DE BÚSQUEDA PREMIUM ===== */
.friends-search-bar {
    position: relative;
    width: 100%;
}

.friends-search-input {
    width: 100%;
    padding: 14px 50px 14px 50px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.friends-search-input::placeholder {
    color: rgba(26, 26, 26, 0.5);
}

.friends-search-input:focus {
    outline: none;
    background: #FFFFFF;
    border-color: #FFFFFF;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.friends-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #FF3CAC;
    font-size: 18px;
    pointer-events: none;
}

.friends-search-clear {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(26, 26, 26, 0.5);
    font-size: 18px;
    cursor: pointer;
    display: none;
    transition: all 0.2s ease;
}

.friends-search-clear:hover {
    color: #FF3CAC;
    transform: translateY(-50%) scale(1.2);
}

.friends-search-clear.active {
    display: block;
}

/* ===== NAVEGACIÓN DE PESTAÑAS ===== */
.friends-tabs-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    padding: 0 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.friends-tabs-nav::-webkit-scrollbar {
    display: none;
}

.friends-tab-btn {
    padding: 12px 24px;
    background: var(--card-bg);
    border: 2px solid rgba(255, 60, 172, 0.15);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.friends-tab-btn i {
    font-size: 16px;
}

.friends-tab-btn:hover {
    background: var(--card-hover);
    border-color: rgba(255, 60, 172, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 60, 172, 0.2);
}

.friends-tab-btn.active {
    background: linear-gradient(135deg, #FF6B35 0%, #FF3CAC 50%, #784BA0 100%);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(255, 60, 172, 0.4);
}

.friends-tab-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
}

.friends-tab-btn.active .friends-tab-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== GRID DE TARJETAS ===== */
.friends-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 5px;
}

/* ===== TARJETA DE AMIGO/SUGERENCIA ===== */
.friend-card-modern {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 60, 172, 0.1);
    position: relative;
}

.friend-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(255, 60, 172, 0.25);
    border-color: rgba(255, 60, 172, 0.3);
}

/* Cover superior */
.friend-card-cover {
    height: 100px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF3CAC 50%, #784BA0 100%);
    position: relative;
    overflow: hidden;
}

.friend-card-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

/* Avatar */
.friend-card-avatar-wrapper {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.friend-card-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--background);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    background: var(--card-bg);
}

.friend-online-status {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #10B981;
    border: 3px solid var(--background);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.5);
}

.friend-online-status.online {
    animation: pulse-online 2s ease-in-out infinite;
}

/* Contenido de la tarjeta */
.friend-card-content {
    padding: 60px 20px 20px;
    text-align: center;
}

.friend-name-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 5px;
}

.friend-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.friend-verified {
    color: #3B82F6;
    font-size: 16px;
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.4));
}

.friend-username {
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 12px;
}

/* Info adicional */
.friend-info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 15px;
    font-size: 13px;
    color: var(--text-dim);
}

.friend-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.friend-info-item i {
    font-size: 14px;
    color: #FF3CAC;
}

/* Amigos mutuos */
.friend-mutual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255, 60, 172, 0.05);
    border-radius: 10px;
    margin-bottom: 15px;
}

.friend-mutual-avatars {
    display: flex;
    margin-left: -5px;
}

.friend-mutual-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--background);
    margin-left: -8px;
    object-fit: cover;
}

.friend-mutual-text {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 600;
}

.friend-mutual-count {
    color: #FF3CAC;
    font-weight: 800;
}

/* Botones de acción */
.friend-actions {
    display: flex;
    gap: 10px;
}

.friend-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.friend-btn i {
    font-size: 15px;
}

.friend-btn-primary {
    background: linear-gradient(135deg, #FF6B35 0%, #FF3CAC 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(255, 60, 172, 0.3);
}

.friend-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 60, 172, 0.5);
}

.friend-btn-secondary {
    background: rgba(255, 60, 172, 0.1);
    color: #FF3CAC;
    border: 2px solid rgba(255, 60, 172, 0.2);
}

.friend-btn-secondary:hover {
    background: rgba(255, 60, 172, 0.15);
    border-color: rgba(255, 60, 172, 0.4);
    transform: translateY(-2px);
}

.friend-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 2px solid rgba(239, 68, 68, 0.2);
}

.friend-btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

/* Botón más opciones */
.friend-btn-options {
    width: 40px;
    padding: 12px;
    background: rgba(255, 60, 172, 0.05);
    border: 2px solid rgba(255, 60, 172, 0.1);
}

.friend-btn-options:hover {
    background: rgba(255, 60, 172, 0.1);
    border-color: rgba(255, 60, 172, 0.3);
}

/* ===== ESTADOS VACÍOS ===== */
.friends-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 2px dashed rgba(255, 60, 172, 0.2);
}

.friends-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.friends-empty-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.friends-empty-text {
    font-size: 15px;
    color: var(--text-dim);
    margin-bottom: 25px;
    line-height: 1.6;
}

.friends-empty-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF3CAC 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 60, 172, 0.3);
}

.friends-empty-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 60, 172, 0.5);
}

/* ===== LOADING SKELETON ===== */
.friend-card-skeleton {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton-cover {
    height: 100px;
    background: linear-gradient(90deg, rgba(255, 60, 172, 0.1) 25%, rgba(255, 60, 172, 0.2) 50%, rgba(255, 60, 172, 0.1) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 2s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 60, 172, 0.15);
    margin: -50px auto 20px;
    border: 4px solid var(--background);
}

.skeleton-line {
    height: 16px;
    background: rgba(255, 60, 172, 0.1);
    border-radius: 8px;
    margin: 10px 20px;
}

.skeleton-line.short {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .friends-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .friends-header-modern {
        padding: 25px 20px;
    }

    .friends-title-modern {
        font-size: 24px;
    }

    .friends-count-badge {
        padding: 6px 12px;
    }

    .friends-tabs-nav {
        gap: 8px;
    }

    .friends-tab-btn {
        padding: 10px 18px;
        font-size: 13px;
    }

    .friends-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
    }

    .friend-card-avatar {
        width: 90px;
        height: 90px;
    }

    .friend-card-content {
        padding: 55px 15px 15px;
    }
}

@media (max-width: 480px) {
    .friends-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .friends-grid-modern {
        grid-template-columns: 1fr;
    }

    .friend-actions {
        flex-direction: column;
    }

    .friend-btn-options {
        width: 100%;
    }
}

/* ===== ANIMACIONES DE ENTRADA ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.friend-card-modern {
    animation: fadeInUp 0.5s ease backwards;
}

.friend-card-modern:nth-child(1) { animation-delay: 0.05s; }
.friend-card-modern:nth-child(2) { animation-delay: 0.1s; }
.friend-card-modern:nth-child(3) { animation-delay: 0.15s; }
.friend-card-modern:nth-child(4) { animation-delay: 0.2s; }
.friend-card-modern:nth-child(5) { animation-delay: 0.25s; }
.friend-card-modern:nth-child(6) { animation-delay: 0.3s; }

/* ===== MODO OSCURO ===== */
[data-theme="dark"] .friends-search-input {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .friends-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .friends-search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .friend-card-avatar {
    border-color: var(--background);
}

[data-theme="dark"] .friend-online-status {
    border-color: var(--background);
}
