/*
* @package phpBB Extension - Avatar hover
* @copyright (c) 2026 Fred Rimbert
* GNU GPL v2
*/

/* =========================================
   Profile top
   ========================================= */
.postbody { position: inherit }

.postprofile, .postbody, .search .postbody {
    display: block;
    width: auto;
    float: none;
    padding: 0;
    min-height: 0
}

.post .postprofile {
    width: auto;
    text-align: left;
    border-width: 0 0 1px 0;
    padding-bottom: 5px;
    margin: 0 0 5px 0;
    min-height: 40px;
    overflow: hidden
}

.postprofile dt, .postprofile dd.profile-rank, .search .postprofile dd {
    display: block;
    margin: 0}

.postprofile .has-avatar .avatar-container {
    margin: 0;
    overflow: inherit;
    float: left
}

.postprofile dd { display: none}
.postprofile .avatar-container:after { clear: none }

.postprofile .avatar { margin-right: 5px }

.postprofile .avatar img {
    width: 40px;
    height: 40px 
}
  
.postprofile .avatar.avatar-letter { border: 3px solid #dedede; }

.has-profile .postbody h3 {
    margin-left: 0 !important;
    margin-right: 0 !important 
}

.has-profile .post-buttons {
    right: 30px;
    top: 15px
}

.online { background-size: 40px }
  
/* ================= OVERLAY ================= */

#ss-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,18,25,0.15);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 99998;
}

#ss-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ================= MODAL ================= */

#ss-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 600px;
    max-width: 95%;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 40px 120px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 99999;
    overflow: hidden;
}

#ss-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

body.ss-open {
    overflow: hidden;
}

/* ================= HEADER ================= */

.ss-header {
    position: relative;    
    padding: 80px 30px 40px 30px;
    background-size: cover;
    background-position: center;
    color: #fff;
}

/* Label bas droite */
.ss-header-label {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
}

/* ================= MODAL BANNER ================= */
.ss-header {
    background: url("./images/cloud.webp");
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 50px 35px 35px 35px;
    color: #fff;
}

.ss-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1;
}

.ss-header > * { z-index: 2 }

.ss-avatar-link {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.ss-avatar-link img {
    display: block;
}

.ss-avatar-link::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 110%; 
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(20,20,25,0.95);
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10;
}

.ss-avatar-link::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(20,20,25,0.95);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ss-avatar-link:hover::after,
.ss-avatar-link:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ss-avatar-placeholder {
    width: 100px;
    height: 100px;
    background: #c40000;
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* ================= USERNAME ================= */

.ss-username {
    font-size: 24px;
    font-weight: 700;
    color: #222;
}

/* ================= RANK ================= */

.ss-rankbar {
    padding: 10px 35px;
    background: #fafafa;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #c40000;
}

/* ================= CONTENT ================= */

.ss-content {
    padding: 25px 35px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 35px;
}

.ss-content dd {
    margin: 0;
    padding: 8px 0;
    font-size: 14px;
    color: #444;
    border-bottom: 1px solid #eee;
}

/* ================= FOOTER ================= */

.ss-footer {
    padding: 25px 35px;
    text-align: right;
    background: #f8f8ff;
}

.ss-profile-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #222;
    color: #eee;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s ease;
}

.ss-profile-btn:hover {
    background: #333;
    color: #fff;
    transform: translateY(-2px);
}

/* ================= CLOSE ================= */

.ss-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 18px;
    color: #eee;
    z-index: 99999;
    cursor: pointer;
}

/* ================= MOBILE LANDSCAPE ================= */
@media (max-width: 1024px) and (orientation: landscape) {

    #ss-modal {
        width: 95%;
        height: 90vh;              
        max-height: 90vh;
        overflow-y: auto;          
        -webkit-overflow-scrolling: touch; 
    }

    #ss-modal .ss-content {
        grid-template-columns: 1fr; 
    }
}

/* ================= DISABLE TOOLTIP ON MOBILE ================= */
@media (max-width: 1024px) {

    .ss-avatar-link::before,
    .ss-avatar-link::after {
        display: none !important;
    }
}

/* Dark/Light Toggle extension by stoker
--------------------------------------------------- */
html.phpbb-dark-mode .ss-header { background: #333 }
html.phpbb-dark-mode .ss-content dd { color: #eee }
html.phpbb-dark-mode #ss-modal { background: #222 }
html.phpbb-dark-mode .ss-profile-btn { color: #eee }
html.phpbb-dark-mode .ss-profile-btn:hover { color: #fff }
