/* Page profil : favoris, catégories privées, mèmes, stats, historique, réglages */

html {
    background: var(--dark-bg, #050508);
}

body.profile-page {
    background: var(--dark-bg, #050508);
    min-height: 100vh;
}

.profile-main {
    padding: 110px 0 4rem;
    min-height: 100vh;
}

/* Les onglets vides ne doivent pas faire s'effondrer la page */
.profile-panel {
    min-height: 45vh;
}

.profile-gate {
    max-width: 520px;
    margin: 4rem auto;
    text-align: center;
    background: var(--dark-surface, #141a24);
    border: 1px solid rgba(135, 206, 235, 0.18);
    border-radius: 18px;
    padding: 2.5rem 2rem;
}

.profile-gate i {
    font-size: 2.5rem;
    color: #5865f2;
    margin-bottom: 1rem;
}

.profile-gate h1 {
    font-size: 1.5rem;
    margin: 0 0 0.6rem;
}

.profile-gate p {
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 1.5rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.profile-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(135, 206, 235, 0.35);
}

.profile-identity h1 {
    margin: 0;
    font-size: 1.7rem;
}

.profile-identity p {
    margin: 0.3rem 0 0;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.92rem;
}

.profile-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-bottom: 0.75rem;
    margin-bottom: 1.75rem;
}

.profile-tab {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary, #94a3b8);
    padding: 0.55rem 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-tab:hover {
    color: #e2e8f0;
    background: rgba(135, 206, 235, 0.08);
}

.profile-tab.is-active {
    color: #fff;
    background: rgba(135, 206, 235, 0.16);
    border-color: rgba(135, 206, 235, 0.4);
}

.profile-panel {
    display: none;
}

.profile-panel.is-active {
    display: block;
}

.profile-panel:not(.is-active) {
    min-height: 0;
}

.profile-panel-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.profile-panel-head h2,
.profile-panel-head h3 {
    margin: 0;
    font-size: 1.25rem;
}

.profile-panel-head p {
    margin: 0;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem;
    flex: 1;
    min-width: 220px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.profile-item {
    position: relative;
    background: var(--dark-surface, #141a24);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.profile-item:hover {
    border-color: rgba(135, 206, 235, 0.45);
}

.profile-item-media {
    aspect-ratio: 1 / 1;
    background: #0e131b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-item-media.is-blurred img {
    filter: blur(18px);
}

.profile-item-media i {
    font-size: 1.8rem;
    color: #475569;
}

.profile-item-body {
    padding: 0.65rem 0.75rem;
}

.profile-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.profile-item-sub {
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 16, 24, 0.78);
    color: #e2e8f0;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.profile-item:hover .profile-item-remove {
    opacity: 1;
}

.profile-item-remove:hover {
    color: #f87171;
}

.profile-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.profile-badge.approved { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.profile-badge.pending { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.profile-badge.rejected { background: rgba(244, 63, 94, 0.16); color: #fb7185; }

.profile-empty {
    color: var(--text-secondary, #94a3b8);
    font-style: italic;
    padding: 1.5rem 0;
}

.profile-notifications {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.profile-notification {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--dark-surface, #141a24);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.profile-notification.is-unread {
    border-color: rgba(88, 101, 242, 0.55);
    background: rgba(88, 101, 242, 0.09);
}

.profile-notification-icon {
    flex-shrink: 0;
    font-size: 1.05rem;
    line-height: 1.5;
}

.profile-notification-body {
    min-width: 0;
}

.profile-notification-body p {
    margin: 0;
    color: var(--text-primary, #e2e8f0);
    overflow-wrap: anywhere;
}

.profile-notification-body time {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
}

.profile-new-collection {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.profile-new-collection input {
    flex: 1;
    min-width: 220px;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #334155;
    background: #0f141d;
    color: #fff;
}

.profile-collections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

.profile-collection {
    background: var(--dark-surface, #141a24);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    padding: 0.9rem;
    cursor: pointer;
}

.profile-collection:hover {
    border-color: rgba(135, 206, 235, 0.45);
}

.profile-collection-covers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    aspect-ratio: 2 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #0e131b;
    margin-bottom: 0.7rem;
}

.profile-collection-covers img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-collection-covers img.is-blurred {
    filter: blur(14px);
}

.profile-collection-covers .cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
}

.profile-collection-name {
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.profile-collection-count {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.82rem;
    font-weight: 500;
}

.profile-collection-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.profile-collection-actions button {
    background: none;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--text-secondary, #94a3b8);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.profile-collection-actions button:hover {
    color: #fff;
    border-color: rgba(135, 206, 235, 0.5);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.9rem;
}

.profile-stat {
    background: var(--dark-surface, #141a24);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.profile-stat-value {
    font-size: 1.7rem;
    font-weight: 750;
}

.profile-stat-label {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.profile-settings {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    max-width: 560px;
}

.profile-switch {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.profile-switch input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    flex-shrink: 0;
}

.profile-switch strong {
    display: block;
}

.profile-switch em,
.profile-field em {
    display: block;
    margin-top: 0.2rem;
    font-style: normal;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.85rem;
}

.profile-field span {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.profile-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #334155;
    background: #0f141d;
    color: #fff;
}

.profile-settings-feedback {
    font-size: 0.88rem;
    color: #34d399;
}

.profile-settings-feedback.is-error {
    color: #fb7185;
}

.profile-danger {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    max-width: 560px;
}

.profile-danger h3 {
    margin: 0 0 0.9rem;
    font-size: 1.1rem;
}

.profile-danger-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.btn-danger {
    background: #be123c;
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #9f1239;
}

.profile-danger-hint {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-secondary, #94a3b8);
}

@media (max-width: 640px) {
    .profile-main { padding-top: 90px; }
    .profile-header { gap: 1rem; }
    .profile-avatar { width: 64px; height: 64px; }
    .profile-identity h1 { font-size: 1.35rem; }
    .profile-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
