/* ============================================================
   css/perfil-comun.css
   Diseno del perfil, compartido por perfil.php (el propio) y
   perfil_publico.php (el de otro usuario).

   Estas reglas estaban solo dentro de perfil.php, asi que el
   perfil publico no podia parecerse: se guiaba por perfil.css,
   que es la hoja antigua y usa otros nombres de clase.
   ============================================================ */

        .profile-hero { position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 2rem; background: var(--bg-card); border: 1px solid var(--border); }
        .profile-cover-new { width: 100%; height: 240px; background-size: cover; background-position: center; position: relative; }
        .profile-cover-new::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(15,15,15,0.6) 60%, var(--bg-card) 100%); }
        .profile-body { padding: 0 2rem 2rem; margin-top: -70px; position: relative; z-index: 2; display: flex; gap: 2rem; align-items: flex-end; flex-wrap: wrap; }
        .profile-avatar-new { width: 140px; height: 140px; border-radius: 50%; border: 4px solid var(--bg-card); object-fit: cover; background: #1a1a1a; flex-shrink: 0; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
        .profile-info { flex: 1; min-width: 220px; padding-bottom: 6px; }
        .profile-info h1 { font-size: 2rem; font-weight: 800; margin: 0 0 4px; color: var(--text-main); letter-spacing: -0.5px; }
        .profile-role-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,0,98,0.12); color: var(--accent); padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.3px; }
        .profile-bio { color: #aaa; font-size: 0.92rem; line-height: 1.6; margin: 12px 0 0; max-width: 600px; }
        .profile-actions-new { padding-bottom: 6px; align-self: flex-end; }
        .btn-edit-new { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: white; padding: 9px 18px; border-radius: 10px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
        .btn-edit-new:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

        .profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 0 2rem 2rem; }
        .stat-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; transition: 0.2s; }
        .stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
        .stat-icon-wrap { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(255,0,98,0.1); color: var(--accent); flex-shrink: 0; }
        .stat-content { display: flex; flex-direction: column; line-height: 1.2; }
        .stat-number { font-size: 1.4rem; font-weight: 800; color: white; }
        .stat-label  { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

        .tabs-wrapper { position: relative; display: flex; gap: 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 6px; margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: none; }
        .tabs-wrapper::-webkit-scrollbar { display: none; }
        .tab-btn-new { background: transparent; border: none; color: #999; cursor: pointer; padding: 10px 18px; border-radius: 10px; font-size: 0.9rem; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: color 0.25s; position: relative; z-index: 2; font-family: inherit; }
        .tab-btn-new svg { width: 16px; height: 16px; }
        .tab-btn-new:hover { color: #ddd; }
        .tab-btn-new.active { color: white; }
        .tab-indicator { position: absolute; background: var(--accent); border-radius: 10px; box-shadow: 0 4px 12px rgba(255,0,98,0.35); transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1; top: 6px; bottom: 6px; }

        .tab-content { display: none; opacity: 0; }
        .tab-content.active { display: block; animation: smoothTab 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
        @keyframes smoothTab { 0% { opacity: 0; transform: translateY(15px); } 100% { opacity: 1; transform: translateY(0); } }

        .library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
        .library-grid .manga-card { 
            background: transparent; border-radius: 12px; overflow: hidden; transition: transform 0.25s; 
            /* CRÍTICO PARA RENDIMIENTO EN MÓVILES */
            content-visibility: auto; contain-intrinsic-size: 280px; 
        }
        .library-grid .manga-card:hover { transform: translateY(-5px); }
        .library-grid .manga-card a { text-decoration: none; }
        .library-grid .card-cover { position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: #1a1a1a; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: box-shadow 0.3s;}
        .library-grid .manga-card:hover .card-cover { box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
        .library-grid .card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
        .library-grid .manga-card:hover .card-cover img { transform: scale(1.05); }
        .library-grid .card-badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); color: white; padding: 3px 9px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
        .library-grid .manga-info { padding: 10px 4px 0; }
        .library-grid .manga-title { font-size: 0.88rem; font-weight: 600; color: var(--text-main); margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

        .empty-library { text-align: center; padding: 4rem 1rem; color: #666; background: var(--bg-card); border: 1px dashed var(--border); border-radius: 14px; }
        .empty-library p { margin: 0; font-size: 0.95rem; }

        /* Scans + botón cerrar sesión */
        .profile-scans { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
        .scan-pill {
            display: inline-flex; align-items: center; gap: 6px;
            background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
            border-radius: 30px; padding: 4px 12px 4px 5px;
            text-decoration: none; color: #ccc; font-size: 0.78rem; font-weight: 600;
            transition: border-color 0.2s, background 0.2s;
        }
        .scan-pill:hover { border-color: var(--accent); background: rgba(255,0,98,0.08); color: white; }
        .scan-pill img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
        .scan-pill .scan-v { color: #10b981; font-size: 0.6rem; }

        @media (max-width: 768px) {
            .profile-cover-new { height: 160px; }
            .profile-body { padding: 0 1rem 1.5rem; margin-top: -55px; gap: 1rem; }
            .profile-avatar-new { width: 110px; height: 110px; border-width: 3px; }
            .profile-info h1 { font-size: 1.5rem; }
            .profile-bio { font-size: 0.85rem; }
            .profile-stats { padding: 0 1rem 1.5rem; gap: 8px; grid-template-columns: repeat(2, 1fr); }
            .stat-card { padding: 12px; }
            .stat-number { font-size: 1.15rem; }
            .stat-label { font-size: 0.68rem; }
            .stat-icon-wrap { width: 32px; height: 32px; }
            .tabs-wrapper { padding: 5px; }
            .tab-btn-new { padding: 8px 14px; font-size: 0.82rem; }
            .library-grid { grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 12px; }
            .library-grid .manga-title { font-size: 0.78rem; }
        }
