/* css/perfil.css */

/* --- Cabecera del Perfil (Banner, Avatar, Info) --- */
.profile-header {
    position: relative;
    height: 150px; /* Altura del banner en móvil */
    background-color: var(--surface-color);
    margin-top: 1.5rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.profile-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-user-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center; /* Centrar verticalmente avatar y texto */
    gap: 1rem; /* Espacio reducido en móvil */
}

.profile-avatar-img {
    width: 80px; /* Tamaño avatar en móvil */
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff; /* Borde más fino en móvil */
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    flex-shrink: 0; /* Evita que el avatar se encoja */
}

.profile-user-details {
    display: flex;
    flex-direction: column;
    align-self: center; /* Centrar verticalmente */
    overflow: hidden; /* Evitar que el texto largo se desborde */
}

.profile-username {
    font-size: 1.8rem; /* Tamaño nombre en móvil */
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 0.25rem; /* Menos espacio debajo del nombre */
    white-space: nowrap; /* Evitar que el nombre se parta */
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-description {
    font-size: 0.9rem; /* Descripción más pequeña en móvil */
    color: var(--text-color-secondary);
    margin-top: 0;
    line-height: 1.4; /* Espaciado de línea ajustado */
    /* Limitar líneas visibles y añadir puntos suspensivos (opcional) */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Mostrar máximo 2 líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.profile-links {
    margin-top: 0.5rem; /* Menos espacio arriba */
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.8rem; /* Espacio reducido entre enlaces */
}
.profile-link-item {
    color: var(--fuchsia-accent, #e30b5d);
    font-size: 0.85rem; /* Enlaces más pequeños en móvil */
    text-decoration: none;
    font-weight: 500;
}
.profile-link-item:hover {
    text-decoration: underline;
    color: var(--fuchsia-hover, #c0094e);
}

/* --- Pestañas de Navegación --- */
.profile-nav-tabs {
    display: flex;
    flex-direction: column; /* Apilado en móvil */
    background-color: var(--surface-color);
    margin-top: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.profile-nav-tab {
    flex-grow: 1;
    text-align: center;
    padding: 0.8rem 0.5rem; /* Menos padding vertical en móvil */
    color: var(--text-color-secondary);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: background-color 0.3s, color 0.3s;
    font-size: 0.95rem; /* Texto de pestaña más pequeño */
}

.profile-nav-tab:hover {
    background-color: #2a2a2a;
}

.profile-nav-tab.active {
    color: var(--fuchsia-accent, #e30b5d);
    border-bottom-color: var(--fuchsia-accent, #e30b5d);
    background-color: #2a2a2a; /* Fondo sutil para la activa */
}

/* --- Contenido de las Pestañas --- */
.profile-tab-content {
    display: none; /* Ocultas por defecto */
    padding: 1.5rem;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.profile-tab-content.active {
    display: block; /* Mostramos la activa */
}

/* --- Cuadrícula de Mangas dentro de Pestañas (FIX) --- */
.profile-tab-content .manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Columnas más pequeñas */
    gap: 1rem; /* Espacio reducido */
}

.profile-tab-content .manga-card img {
    width: 100%;
    height: 200px; /* Altura reducida para las portadas */
    object-fit: cover;
    display: block;
}

.profile-tab-content .manga-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}
.profile-tab-content .manga-card:hover {
    transform: translateY(-5px);
}
.profile-tab-content .manga-card a {
    display: block; color: inherit; text-decoration: none;
}
.profile-tab-content .manga-card .manga-info {
     padding: 0.8rem; /* Menos padding */
}
.profile-tab-content .manga-card .manga-nombre {
    font-size: 0.9rem; /* Título más pequeño */
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Formulario de Editar Perfil --- */
.edit-profile-form {
    max-width: 700px;
    margin: 0 auto;
    padding: 1rem;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.edit-profile-form fieldset {
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius-soft, 12px); /* Usar variable */
}

.edit-profile-form legend {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0 0.5rem;
    color: var(--text-color);
}

.edit-profile-form .form-group {
    margin-bottom: 1.2rem;
}

.edit-profile-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
}

.edit-profile-form input[type="text"],
.edit-profile-form textarea,
.edit-profile-form input[type="url"],
.edit-profile-form input[type="file"] {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Añadido transition */
}
.edit-profile-form textarea {
    min-height: 80px;
    resize: vertical;
    font-family: 'Poppins', sans-serif; /* Heredar fuente */
}
.edit-profile-form input[type="file"] {
    padding: 0.5rem;
    background-color: var(--input-bg-dark, #3a3a3a); /* Usar variable */
}

/* Estilo focus */
.edit-profile-form input[type="text"]:focus,
.edit-profile-form textarea:focus,
.edit-profile-form input[type="url"]:focus {
     border-color: var(--fuchsia-accent, #e30b5d);
     outline: none;
     box-shadow: 0 0 0 3px rgba(227, 11, 93, 0.3);
}

.edit-profile-form .submit-btn {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background-color: var(--fuchsia-accent, #e30b5d);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: background-color 0.3s;
    margin-top: 1.5rem; /* Añadido margen superior */
}
.edit-profile-form .submit-btn:hover {
    background-color: var(--fuchsia-hover, #c0094e);
}

/* Contador de caracteres */
#charCount {
    font-weight: normal;
    font-size: 0.8em;
    color: var(--text-color-secondary);
}

/* Formulario de Enlaces */
.enlace-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    align-items: center;
}
.enlace-group input[type="text"],
.enlace-group input[type="url"] {
    flex-grow: 1;
    font-size: 0.9rem; /* Ajustar tamaño */
}
.btn-remove-enlace {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: background-color 0.2s; /* Añadido transition */
}
.btn-remove-enlace:hover {
    background-color: #c82333;
}
.btn-add-enlace {
    background-color: transparent; /* Fondo transparente */
    color: var(--fuchsia-accent);
    border: 1px dashed var(--fuchsia-accent);
    padding: 0.6rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5rem;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s; /* Añadido transition */
}
.btn-add-enlace:hover {
    background-color: rgba(227, 11, 93, 0.1); /* Fondo fucsia sutil */
    color: var(--fuchsia-hover);
}

/* Estilos Modal Cropper (sin cambios respecto a antes) */
.modal { display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); justify-content: center; align-items: center; }
.modal.show { display: flex; }
.modal-dialog { background-color: var(--surface-color); margin: auto; padding: 2rem; border-radius: var(--border-radius); box-shadow: 0 5px 15px rgba(0,0,0,0.4); width: 90%; max-width: 600px; position: relative; }
/* ... (Resto de estilos del modal como antes) ... */

/* --- MEDIA QUERIES (TABLET Y SUPERIORES) --- */
@media (min-width: 768px) {
    .profile-header {
        height: 250px; /* Restaurar altura banner */
    }
    .profile-avatar-img {
        width: 120px; /* Restaurar tamaño avatar */
        height: 120px;
        border-width: 4px; /* Restaurar borde */
    }
    .profile-username {
        font-size: 2.5rem; /* Restaurar tamaño nombre */
    }
    .profile-description {
        font-size: 0.95rem; /* Restaurar tamaño descripción */
        -webkit-line-clamp: 3; /* Mostrar hasta 3 líneas en desktop */
    }
    .profile-links {
        margin-top: 1rem; /* Restaurar margen */
        gap: 0.5rem 1rem;
    }
    .profile-link-item {
        font-size: 0.9rem; /* Restaurar tamaño enlace */
    }

    .profile-nav-tabs {
        flex-direction: row; /* Horizontal */
    }
    .profile-nav-tab {
        padding: 1rem 0.5rem; /* Restaurar padding */
        font-size: 1rem; /* Restaurar tamaño */
    }
    .profile-tab-content .manga-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* Restaurar tamaño columnas */
        gap: 1.2rem;
    }
    .profile-tab-content .manga-card img {
        height: 240px; /* Restaurar altura portadas */
    }
    .profile-tab-content .manga-card .manga-info {
        padding: 1rem;
    }
     .profile-tab-content .manga-card .manga-nombre {
        font-size: 1rem;
    }
}