/* ==========================================================================
   Starlab — Modern Herkese Açık Profil Sayfası (author.php)
   ========================================================================== */

.sprofile-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* ---- Üst kart: banner + avatar + isim + rozetler + istatistik şeridi ---- */
.sprofile-hero {
    position: relative;
    border-radius: var(--radius-xl);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    margin-top: 20px;
    /* overflow:hidden BİLEREK burada değil — çerçeveli avatarlar avatarın
       biraz dışına taşacak şekilde tasarlanıyor (bkz. .sprofile-avatar
       notu); bu kutuda gizli overflow olsaydı üstteki köşelere yakın
       duran çerçeveleri kırpardı. Yuvarlak üst köşe görünümü artık
       doğrudan .sprofile-banner'ın kendi border-radius'undan geliyor. */
}

.sprofile-banner {
    height: 160px;
    background: linear-gradient(135deg, #241a35 0%, #34133a 45%, #17131f 100%);
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow: hidden;
    position: relative;
}
.sprofile-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,17,23,0) 40%, rgba(15,17,23,0.85) 100%);
}

.sprofile-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 0 24px 20px;
    margin-top: -56px;
    position: relative;
    flex-wrap: wrap;
}

.sprofile-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: var(--color-bg-tertiary);
    flex-shrink: 0;
    /* NOT: overflow burada bilerek gizli DEĞİL. Çerçeve, avatarın biraz
       dışına taşacak şekilde tasarlanıyor (bkz. achievement-badges.css
       --sl-frame-scale); dıştan kırparsak çerçeve kesilir. Asıl yuvarlak/
       kare kırpma işi içteki .avatar-container'a ait ve onun şekli
       frame-shape-round / frame-shape-square sınıfına göre belirlenir. */
}

/* Çerçevesiz (varsayılan) avatarlarda dairesel çerçeve/glow halkası —
   ÖZEL bir çerçeve takılıyken bu artık uygulanmıyor. Eskiden koşulsuz
   uygulanıyordu, bu da süslü/kare/köşeli özel çerçevelerin ARKASINDA
   alakasız, dairesel bir gölge/halka olarak görünüyordu (kullanıcı
   ekran görüntülerinde şikayet ettiği "arkadaki alakasız gölge"). */
.sprofile-avatar:not(:has(.profile-frame-overlay)) {
    border: 4px solid var(--color-bg-secondary);
    box-shadow: 0 0 0 2px var(--color-primary-light), 0 8px 24px rgba(0,0,0,0.4);
}

/* Çerçevesiz durumda (ör. WP varsayılan avatar / plain img) yine de
   dairesel görünmesi için düz img'lere burada yuvarlak uygulanır. */
.sprofile-avatar > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Çerçeveli avatar bileşeni kendi boyutunu --sl-avatar-size üzerinden alır;
   burada sadece hizalamayı sprofile-avatar kutusuna oturtuyoruz. */
.sprofile-avatar .user-avatar-with-frame {
    display: block;
    margin: 0 auto;
}

/* Yuvarlak çerçevede dış halka görünümünü korumak için ince bir maske; kare
   çerçevede köşeleri sprofile-avatar'ın kendi border-radius'una uydurmuyoruz,
   çünkü kırpma işini avatar-container zaten kendi border-radius'uyla yapıyor. */
.sprofile-avatar.shape-round,
.sprofile-avatar:has(.frame-shape-round) {
    overflow: visible;
}
.sprofile-avatar.shape-square,
.sprofile-avatar:has(.frame-shape-square) {
    border-radius: 20%;
}

.sprofile-main {
    flex: 1;
    min-width: 220px;
    padding-top: 62px;
}

.sprofile-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sprofile-username {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 0;
}

.sprofile-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-light);
}
.sprofile-pill.is-role { background: rgba(124,58,237,.18); color: #c4b5fd; border-color: rgba(124,58,237,.35); }
.sprofile-pill.is-admin { background: rgba(239,68,68,.18); color: #fca5a5; border-color: rgba(239,68,68,.35); }

.sprofile-handle {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 2px 0 10px;
}

.sprofile-xp-bar-wrap { max-width: 420px; }
.sprofile-xp-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}
.sprofile-xp-bar-label .pct { color: var(--color-success); font-weight: 700; }
.sprofile-xp-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--color-bg-tertiary);
    overflow: hidden;
}
.sprofile-xp-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #34d399);
}

.sprofile-stats-row {
    display: flex;
    gap: 26px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.sprofile-stat { text-align: left; }
.sprofile-stat .val { display: block; font-weight: 800; font-size: 1.05rem; color: var(--color-text-primary); }
.sprofile-stat .lbl { font-size: 0.74rem; color: var(--color-text-muted); }

.sprofile-actions {
    display: flex;
    gap: 10px;
    padding-top: 62px;
    flex-wrap: wrap;
}
.sprofile-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid var(--color-border-light);
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, opacity .15s ease;
    text-decoration: none;
}
.sprofile-btn:hover { transform: translateY(-1px); }
.sprofile-btn.primary { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff; }
.sprofile-btn.primary:hover { background: #6d28d9; }
.sprofile-btn.success { background: var(--color-success); border-color: var(--color-success); color: #06281c; }
.sprofile-btn.danger-outline { background: transparent; color: #fca5a5; border-color: rgba(239,68,68,.4); }
.sprofile-btn.danger-outline:hover { background: rgba(239,68,68,.12); }
.sprofile-btn:disabled { opacity: .55; cursor: default; transform: none; }
.sprofile-btn .fa-spinner { animation: sprofile-spin 0.7s linear infinite; }
@keyframes sprofile-spin { to { transform: rotate(360deg); } }

/* ---- Sekmeler ---- */
.sprofile-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    border-top: 1px solid var(--color-border);
    overflow-x: auto;
}
.sprofile-tab {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 14px 14px 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.sprofile-tab:hover { color: var(--color-text-primary); }
.sprofile-tab.is-active { color: var(--color-primary-light); border-bottom-color: var(--color-primary-hover); }
.sprofile-tab .count { color: var(--color-text-disabled); font-weight: 500; }
.sprofile-tab.has-badge { position: relative; }
.sprofile-tab .req-dot {
    display: inline-block;
    min-width: 16px; height: 16px; line-height: 16px;
    border-radius: 999px; background: var(--color-error); color: #fff;
    font-size: 0.65rem; text-align: center; padding: 0 3px; margin-left: 4px;
}

/* ---- İçerik grid ---- */
.sprofile-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-top: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .sprofile-content { grid-template-columns: 1fr; }
}

.sprofile-panel {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 20px;
}
.sprofile-panel + .sprofile-panel { margin-top: 16px; }
.sprofile-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 14px;
}
.sprofile-panel-title .muted { font-size: 0.78rem; color: var(--color-text-muted); font-weight: 500; }

.sprofile-tabpanel { display: none; }
.sprofile-tabpanel.is-active { display: block; }

/* ---- Sidebar widgetleri ---- */
.sprofile-sidebar .sprofile-panel { padding: 18px; }
.sprofile-level-box {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.sprofile-level-circle {
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(16,185,129,.12);
    border: 2px solid var(--color-success);
    color: var(--color-success);
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}
.sprofile-level-circle .num { font-size: 1.15rem; }
.sprofile-level-circle .tag { font-size: 0.55rem; text-transform: uppercase; letter-spacing: .3px; margin-top: 1px; }
.sprofile-level-meta .name { font-weight: 700; color: var(--color-text-primary); }
.sprofile-level-meta .pct { font-size: 0.78rem; color: var(--color-text-muted); }

.sprofile-mini-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 9px 0;
    border-top: 1px solid var(--color-divider);
}
.sprofile-mini-row:first-of-type { border-top: none; }
.sprofile-mini-row .k { color: var(--color-text-muted); }
.sprofile-mini-row .v { color: var(--color-text-primary); font-weight: 700; }

/* ---- Rozetler / achievements ---- */
.sprofile-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.sprofile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
}
.sprofile-badge.is-locked { opacity: 0.45; filter: grayscale(0.6); }
.sprofile-badge-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.05rem; flex-shrink: 0;
}
.sprofile-badge-title { font-weight: 700; font-size: 0.88rem; color: var(--color-text-primary); }
.sprofile-badge-desc { font-size: 0.76rem; color: var(--color-text-muted); }

/* ---- Okuma listesi tablosu ---- */
.sprofile-table { width: 100%; border-collapse: collapse; }
.sprofile-table th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--color-text-disabled);
    padding: 0 10px 10px;
    border-bottom: 1px solid var(--color-border);
}
.sprofile-table td {
    padding: 10px;
    border-bottom: 1px solid var(--color-divider);
    font-size: 0.86rem;
    vertical-align: middle;
}
.sprofile-table tr:last-child td { border-bottom: none; }
.sprofile-novel-cell { display: flex; align-items: center; gap: 10px; }
.sprofile-novel-cell img { width: 32px; height: 42px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.sprofile-novel-cell a { color: var(--color-text-primary); font-weight: 600; text-decoration: none; }
.sprofile-status-chip {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(16,185,129,.15);
    color: var(--color-success);
}

/* ---- Arkadaşlar ---- */
.sprofile-friend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.sprofile-friend-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-lg);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    text-decoration: none;
}
.sprofile-friend-card img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.sprofile-friend-card .name { color: var(--color-text-primary); font-weight: 600; font-size: 0.85rem; }
.sprofile-friend-card .lvl { color: var(--color-text-muted); font-size: 0.72rem; }

.sprofile-request-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 10px 0;
    border-top: 1px solid var(--color-divider);
}
.sprofile-request-row:first-of-type { border-top: none; }
.sprofile-request-row img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.sprofile-request-row .name { flex: 1; font-weight: 600; color: var(--color-text-primary); font-size: 0.86rem; }

/* ---- Yorum önizleme satırları (Genel Bakış → Son Yorumlar / Yorumlar sekmesi) ----
   Ortak class'lar kullanılıyor ki her iki sekme de aynı, responsive
   davranışa sahip olsun (önceden inline style kullanılıyordu ve
   taşan/uzun yorumlarda satır container'ından dışarı kayıyordu). */
.sprofile-comment-main {
    flex: 1 1 220px;
    min-width: 0; /* flex item'ların içeriğe göre büzülmesini engelleyen varsayılanı kapat */
}
.sprofile-comment-title {
    display: block;
    color: var(--color-text-primary);
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.sprofile-comment-title:hover { color: var(--color-primary-light); }
.sprofile-comment-excerpt {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
    margin-top: 2px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.sprofile-comment-time {
    color: var(--color-text-disabled);
    font-size: 0.76rem;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}
@media (max-width: 520px) {
    .sprofile-comment-time {
        margin-left: 0;
        order: 3;
        width: 100%;
    }
}

/* ---- Okuma Listesi (başkasının profili) ve Desteklenen Romanlar mini kart ızgarası ----
   starlab_render_profile_library_card_html() ve author.php "Desteklenen
   Romanlar" bloğu bu class'ları üretiyordu ama hiçbir yerde CSS'i yoktu —
   bu yüzden bu sekmeler stilsiz/kırık görünüyordu (kendi profilinde ise
   Okuma Listesi ayrı bir tablo markup'ı — .sprofile-table — kullandığı
   için sorun görünmüyordu). */
.bookmarked-novels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}
.novel-card-mini {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .15s ease, border-color .15s ease;
}
.novel-card-mini:hover {
    transform: translateY(-3px);
    border-color: var(--color-border-light);
}
.novel-thumbnail-link {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    background: var(--color-bg-secondary);
    overflow: hidden;
}
.novel-thumbnail-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.novel-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-disabled);
    font-size: 1.7rem;
}
.novel-info-mini { padding: 8px 10px 10px; }
.novel-title-mini {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.novel-title-mini a {
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 600;
}
.novel-title-mini a:hover { color: var(--color-primary-light); }
.novel-info-mini .muted {
    display: block;
    color: var(--color-text-muted);
    margin-top: 5px;
}

.sprofile-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--color-text-muted);
}
.sprofile-empty i { font-size: 2rem; opacity: .5; margin-bottom: 10px; display: block; }

.sprofile-locked-notice {
    text-align: center;
    padding: 60px 20px;
}
.sprofile-locked-notice i { font-size: 2.5rem; color: var(--color-text-muted); margin-bottom: 14px; display: block; }

/* "Daha Fazla Yükle" (Kitaplık sekmesi, başkasının profili) — daha önce
   düz WP-admin .button sınıfını kullanıyordu ve sayfaya hiç uymuyordu.
   Artık sitenin kendi .btn/.btn-secondary sistemine oturuyor. */
.profile-library-load-more-wrap {
    text-align: center;
    margin-top: var(--space-6, 20px);
}

.profile-library-load-more-btn {
    min-width: 180px;
}

.profile-library-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.profile-library-load-more-btn .btn-spinner {
    display: inline-flex;
    align-items: center;
}
