/* Específicos da Página de Comunidade - Integrado com style.css */

/* Layout Grids */
.top-community-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}

.side-widgets-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.community-full-width-section {
    margin-top: 20px;
    width: 100%;
}

@media (max-width: 1200px) {
    .top-community-layout { grid-template-columns: 1fr; }
}

/* Ticker de Atividade */
.activity-ticker {
    background: var(--cor-primaria);
    color: white;
    height: 30px;
    display: flex;
    align-items: center;
    overflow: hidden;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 90;
    position: relative;
    margin-top: var(--header-height); 
    border-radius: 8px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.ticker-wrapper {
    display: flex;
    white-space: nowrap;
    animation: ticker-scroll 30s linear infinite;
    gap: 50px;
    padding-left: 100%;
}

.ticker-wrapper span { display: flex; align-items: center; gap: 8px; }

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Bolhas de Estatísticas (Paineis Pequenos) */
.community-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 15px;
    margin-bottom: 20px; /* Reduzido de 25px para 20px */
    margin-top: 15px; /* Reduzido de 20px para 15px */
}

.stat-bubble {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--cor-borda);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: 0.3s;
}

.stat-bubble:hover {
    border-color: var(--cor-terciaria);
    background: rgba(16, 185, 129, 0.05);
}

.stat-bubble .label {
    display: block;
    font-size: 0.65rem;
    color: var(--cor-texto-terciario);
    font-weight: 800;
    margin-bottom: 5px;
}

.stat-bubble .value {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
    font-family: monospace;
}

/* Barra de Meta Global (Faixa) */
.community-goal-banner {
    background: linear-gradient(90deg, #1a1a2e 0%, #09090b 100%);
    border-top: 3px solid var(--cor-secundaria) !important;
    padding: 20px 30px !important;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.goal-content { display: flex; align-items: center; justify-content: space-between; gap: 40px; position: relative; z-index: 2; }
.goal-info-left { display: flex; align-items: center; gap: 20px; min-width: 300px; }
.goal-icon { width: 50px; height: 50px; background: rgba(244, 63, 94, 0.1); color: var(--cor-secundaria); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 0 20px rgba(244, 63, 94, 0.2); }
.goal-text h3 { margin: 0; font-size: 1.2rem; color: #fff; }
.goal-text p { margin: 5px 0 0; font-size: 0.85rem; color: var(--cor-texto-terciario); }
.goal-progress-container { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.goal-stats { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 700; color: var(--cor-texto-secundario); }
.goal-bar-bg { height: 14px; background: rgba(255, 255, 255, 0.05); border-radius: 20px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.05); }
.goal-bar-fill { height: 100%; background: linear-gradient(90deg, var(--cor-secundaria), #ff007a); border-radius: 20px; position: relative; transition: width 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.goal-bar-glow { position: absolute; top: 0; right: 0; width: 20px; height: 100%; background: #fff; filter: blur(10px); opacity: 0.5; }
.goal-reward-preview { display: flex; align-items: center; gap: 15px; background: rgba(255, 255, 255, 0.03); padding: 10px 20px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.05); }
.goal-reward-preview i { font-size: 1.8rem; color: var(--cor-aviso); }
.reward-text span { display: block; font-size: 0.65rem; color: var(--cor-texto-terciario); font-weight: 800; }
.reward-text strong { font-size: 0.9rem; color: #fff; }

/* Showcase Modo Lista */
.search-wrapper { position: relative; width: 250px; }
.search-wrapper i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--cor-texto-terciario); }
.search-wrapper input { width: 100%; padding: 8px 12px 8px 35px; background: var(--cor-background-alt); border: 1px solid var(--cor-borda); border-radius: 8px; color: white; font-size: 0.85rem; }

.profiles-list {
    display: flex;
    flex-direction: column; gap: 20px; margin-top: 15px;
    max-height: 520px; overflow-y: auto; padding: 10px 15px 10px 5px;
    scrollbar-width: thin; scrollbar-color: var(--cor-primaria) transparent;
}
.profiles-list::-webkit-scrollbar { width: 6px; }
.profiles-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); border-radius: 10px; }
.profiles-list::-webkit-scrollbar-thumb { background: var(--cor-primaria); border-radius: 10px; box-shadow: 0 0 10px var(--cor-primaria); }

.profile-list-item {
    display: flex; align-items: center; background-size: cover; background-position: center;
    border: 1px solid var(--cor-borda); border-radius: 20px; 
    overflow: hidden; 
    padding: 40px; gap: 40px;
    transition: all 0.3s ease; position: relative; min-height: 250px;
}

/* Placeholder Minimalista para Banner */
.profile-list-item.no-banner {
    background-color: #09090b;
    background-image: 
        linear-gradient(rgba(88, 101, 242, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 101, 242, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
}
.profile-card-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(90deg, rgba(9, 9, 11, 0.95) 20%, rgba(9, 9, 11, 0.4) 100%); z-index: 1; }
.profile-list-item:hover { border-color: var(--cor-primaria); box-shadow: inset 0 0 30px rgba(88, 101, 242, 0.15); }
.profile-list-item:hover .profile-card-overlay { background: linear-gradient(90deg, rgba(9, 9, 11, 0.9) 30%, rgba(88, 101, 242, 0.15) 100%); }

.avatar-wrapper-community { position: relative; display: flex; align-items: center; justify-content: center; z-index: 2; width: 130px; height: 130px; flex-shrink: 0; }
.profile-list-avatar { 
    width: 130px; height: 130px; border-radius: 50%; 
    border: 4px solid var(--cor-background-alt); 
    box-shadow: 0 0 30px rgba(0,0,0,0.8); 
    background: #09090b; 
    position: relative; z-index: 1; 
    object-fit: cover;
}

/* Efeito extra quando for placeholder (detectado por falta de src real ou classe) */
.profile-list-avatar[src*="ui-avatars.com"] {
    border-color: var(--cor-primaria);
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.2);
}
.decoration-frame-community { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 125% !important; height: 125% !important; max-width: none !important; z-index: 2; pointer-events: none; object-fit: contain; }

.user-badges-list { display: flex; gap: 10px; margin-top: 10px; }
.badge-icon-box { background: rgba(0, 0, 0, 0.4); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 4px 10px rgba(0,0,0,0.3); padding: 4px; overflow: hidden; }
.badge-icon-box i { font-size: 1.2rem; color: var(--cor-aviso); }

.profile-list-info { flex: 1; z-index: 2; position: relative; text-shadow: 0 2px 10px rgba(0,0,0,0.8); display: flex; flex-direction: column; min-width: 0; }
.profile-list-name { 
    font-size: 1.5rem; 
    font-weight: 900; 
    color: #fff; 
    margin-bottom: 8px; 
    display: block; 
    text-transform: uppercase; 
    letter-spacing: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.rgb-text { background: linear-gradient(90deg, #ff0080, #ff8c00, #40e0d0, #9370db, #ff0080); background-size: 400% 100%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: rgb-animation 8s linear infinite; font-weight: 900 !important; }
@keyframes rgb-animation { 0% { background-position: 0% 0%; } 100% { background-position: 400% 0%; } }

.profile-actions-right { display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 2; position: relative; min-width: 180px; }
.likes-count { font-size: 1.2rem; font-weight: 800; color: #fff; text-shadow: 0 0 15px rgba(244, 63, 94, 0.5); }
.likes-count i { color: var(--cor-secundaria); margin-right: 5px; }

.action-buttons-group { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.like-btn-list { background: var(--cor-primaria); border: none; color: white; padding: 10px 25px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 0.9rem; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px; box-shadow: 0 5px 15px rgba(88, 101, 242, 0.3); width: auto; min-width: 140px; justify-content: center; z-index: 2; position: relative; }
.like-btn-list:hover { background: var(--cor-secundaria); transform: none !important; }
.like-btn-list.liked { background: var(--cor-secundaria); }

.tip-btn-list { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--cor-terciaria); padding: 10px 20px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 0.8rem; transition: 0.3s; display: flex; align-items: center; gap: 8px; justify-content: center; }
.tip-btn-list:hover:not(:disabled) { background: var(--cor-terciaria); color: #000; box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); }

/* Hall da Fama */
.hall-fame-sidebar { flex: 1; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.hall-fame-list { display: flex; flex-direction: column; gap: 10px; }
.hall-item { display: flex; align-items: center; padding: 10px; background: rgba(255,255,255,0.02); border-radius: 12px; border: 1px solid var(--cor-borda); transition: 0.3s; cursor: pointer; } /* Added cursor: pointer */
.hall-item:hover { border-color: var(--cor-secundaria); transform: translateX(5px); }
.hall-rank { width: 30px; font-weight: 900; font-size: 1rem; color: var(--cor-texto-terciario); }
.hall-item:nth-child(1) .hall-rank { color: #ffd700; }
.hall-item:nth-child(2) .hall-rank { color: #c0c0c0; }
.hall-item:nth-child(3) .hall-rank { color: #cd7f32; }

/* Baú Diário Redesenhado */
.daily-chest-panel {
    background: linear-gradient(135deg, #1a1a2e 0%, #09090b 100%);
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    border-top: 3px solid #ffd700 !important;
    position: relative; overflow: hidden; height: 180px; display: flex; align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); margin-top: auto; border-top-left-radius: 0; border-top-right-radius: 0;
}
.chest-container { display: flex; align-items: center; justify-content: space-around; padding: 0 20px; width: 100%; z-index: 2; }
.chest-icon-wrapper { position: relative; font-size: 4rem; color: #ffd700; filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4)); transition: 0.5s; }
.chest-icon-wrapper.available { animation: chest-float 3s infinite ease-in-out, chest-pulse-glow 2s infinite alternate; }
.chest-info { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.chest-info h3 { margin: 0; font-size: 1.3rem; color: #fff; text-transform: uppercase; font-weight: 800; }
.chest-info p { margin: 5px 0; font-size: 0.85rem; color: #ffd700; font-weight: 700; }
#btn-collect-chest { background: linear-gradient(90deg, #ffd700, #ffaa00); color: #000; border: none; border-radius: 8px; padding: 10px 20px; font-weight: 900; font-size: 0.8rem; cursor: pointer; transition: 0.3s; }
#btn-collect-chest:hover:not(:disabled) { transform: scale(1.05); }
@keyframes chest-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes chest-pulse-glow { 0% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4)); } 100% { filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.7)); } }

/* Missões Premium */
.missions-premium-panel { background: linear-gradient(180deg, var(--cor-surface) 0%, var(--cor-background-alt) 100%); position: relative; overflow: hidden; }
.panel-header-premium { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--cor-borda); }
.header-icon { width: 45px; height: 45px; background: rgba(16, 185, 129, 0.1); color: var(--cor-terciaria); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.header-text h3 { margin: 0; font-size: 1.1rem; }
.header-text p { margin: 0; font-size: 0.8rem; color: var(--cor-texto-secundario); }
.missions-premium-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 20px; margin-top: 10px; }
.mission-card-premium { background: rgba(255, 255, 255, 0.03); border-radius: 15px; padding: 20px; border: 1px solid var(--cor-borda); transition: all 0.3s ease; display: flex; flex-direction: column; justify-content: space-between; }
.mp-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.mp-title { font-weight: 700; font-size: 0.9rem; color: #fff; }
.mp-reward { color: var(--cor-terciaria); font-weight: 800; font-size: 0.85rem; }
.mp-bar-bg { height: 8px; background: var(--cor-background); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.mp-bar-fill { height: 100%; background: linear-gradient(90deg, var(--cor-primaria), var(--cor-primaria-light)); transition: 0.8s ease; }
.mp-btn { width: 100%; padding: 10px; border: none; border-radius: 8px; font-weight: 800; font-size: 0.8rem; cursor: pointer; transition: 0.3s; background: rgba(255,255,255,0.05); color: var(--cor-texto-terciario); }
.mp-btn.active { background: var(--cor-primaria); color: white; box-shadow: none; }
.mp-btn.claimed { background: rgba(16, 185, 129, 0.1); color: var(--cor-terciaria); border: 1px solid rgba(16, 185, 129, 0.2); cursor: default; }

/* Animação para Missão Pronta para Coleta */
.mission-card-premium.ready-to-claim {
    border-color: var(--cor-secundaria);
    animation: pulse-ready 2s infinite ease-in-out;
    background: rgba(244, 63, 94, 0.05);
}

@keyframes pulse-ready {
    0%, 100% { box-shadow: 0 0 5px rgba(244, 63, 94, 0.2); }
    50% { box-shadow: 0 0 20px rgba(244, 63, 94, 0.4); border-color: #fff; }
}

/* Ajuste para não ficar atrás do cabeçalho na página de comunidade */
.dashboard-container {
    margin-top: var(--header-height) !important;
    padding-top: 20px !important;
}

/* ========================================================================== */
/*                     COMUNIDADE - RESPONSIVIDADE TOTAL                      */
/* ========================================================================== */

@media (max-width: 992px) {
    .top-community-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .community-goal-banner {
        padding: 20px !important;
    }

    .goal-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .goal-info-left {
        flex-direction: column;
        min-width: 0;
    }

    .goal-progress-container {
        width: 100%;
    }

    .goal-reward-preview {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .activity-ticker {
        margin-top: calc(var(--header-height) + 10px);
        margin-bottom: 10px;
        width: 95%;
    }

    .community-stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-bubble {
        padding: 12px 8px;
    }

    .stat-bubble .value {
        font-size: 1rem;
    }

    /* Redesign Total dos Cards de Perfil no Mobile */
    .profiles-list {
        padding: 10px 5px;
        max-height: none; /* Permite scroll natural da página no mobile */
        gap: 25px;
    }

    .profile-list-item {
        flex-direction: column;
        padding: 0;
        gap: 0;
        text-align: center;
        min-height: auto;
        border-radius: 24px;
        background-color: #0c0c0e;
    }

    .profile-card-overlay {
        background: linear-gradient(180deg, transparent 0%, rgba(9, 9, 11, 0.95) 60%);
    }

    /* Banner no topo do card mobile */
    .profile-list-item::before {
        content: '';
        display: block;
        height: 100px;
        width: 100%;
        background-image: inherit;
        background-size: cover;
        background-position: center;
        border-radius: 24px 24px 0 0;
    }

    .avatar-wrapper-community {
        width: 110px;
        height: 110px;
        margin-top: -55px; /* Sobe o avatar sobre o banner */
        margin-bottom: 15px;
        margin-left: auto;
        margin-right: auto;
    }

    .profile-list-avatar {
        width: 110px;
        height: 110px;
        border-width: 4px;
    }

    .profile-list-info {
        align-items: center;
        padding: 0 20px;
        width: 100%;
    }

    .profile-list-name {
        font-size: 1.3rem;
        margin-bottom: 10px;
        text-align: center;
    }

    .user-badges-list {
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }

    .profile-actions-right {
        width: 100%;
        min-width: 0;
        background: rgba(255, 255, 255, 0.02);
        padding: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        margin-top: 10px;
    }

    .likes-count {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .action-buttons-group {
        flex-direction: column; /* Empilha botões para melhor clique */
        gap: 12px;
        width: 100%;
    }

    .like-btn-list, .tip-btn-list {
        width: 100%;
        padding: 15px;
        font-size: 0.85rem;
        border-radius: 12px;
    }

    /* Missões no Mobile */
    .missions-premium-grid {
        grid-template-columns: 1fr;
    }

    .panel-header-premium {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    #missions-reset-timer {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .community-stats-row {
        grid-template-columns: 1fr; /* 1 por linha em telas muito pequenas */
    }
    
    .action-buttons-group {
        flex-direction: column; /* Volta a ser empilhado se for muito estreito */
    }
}

/* --- MODAL DO BAÚ (NOVO) --- */
.chest-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(10px);
    z-index: 10000; display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.chest-modal-overlay.active { opacity: 1; visibility: visible; }

.chest-modal-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #000000 100%);
    border: 2px solid #ffd700;
    width: 90%; max-width: 400px;
    padding: 40px 20px; border-radius: 25px;
    text-align: center; position: relative;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    transform: scale(0.8); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chest-modal-overlay.active .chest-modal-content { transform: scale(1); }

/* Variação para Modal de Tip (Verde) */
.tip-modal-style {
    border-color: var(--cor-terciaria);
    box-shadow: 0 0 50px rgba(16, 185, 129, 0.3);
}

.chest-modal-icon {
    font-size: 4rem; color: #ffd700; margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
    animation: chest-pulse-glow 2s infinite alternate;
}

.chest-modal-content h2 {
    font-family: var(--font-principal);
    font-size: 1.8rem; color: #fff; margin-bottom: 10px;
    text-transform: uppercase; letter-spacing: 1px;
}

.chest-modal-content p {
    color: var(--cor-texto-secundario); font-size: 1rem; margin-bottom: 30px;
}

.reward-amount {
    color: #ffd700; font-weight: 900; font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.chest-modal-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 100%; height: 100%; background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

/* Modal Hall da Fama Top 100 */
.hall-fame-modal-content {
    width: 95%;
    max-width: 550px;
    height: 85vh; /* Altura fixa para permitir scroll interno */
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.hall-fame-full-list-container {
    flex: 1;
    overflow: hidden; /* Mantém o scroll apenas na lista */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid var(--cor-borda);
    padding: 5px;
    margin-top: 10px;
}

.hall-fame-full-list {
    height: 100%;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--cor-secundaria) transparent;
}

.hall-fame-full-list::-webkit-scrollbar {
    width: 6px;
}
.hall-fame-full-list::-webkit-scrollbar-thumb {
    background: var(--cor-secundaria);
    border-radius: 10px;
}

.hall-item-full {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: 0.2s;
    cursor: pointer;
}

.hall-item-full:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--cor-borda);
}

.hall-item-full .rank {
    font-size: 1.1rem;
    font-weight: 900;
    width: 40px;
    color: var(--cor-texto-terciario);
    text-align: center;
}

.hall-item-full:nth-child(1) .rank { color: #ffd700; font-size: 1.3rem; }
.hall-item-full:nth-child(2) .rank { color: #c0c0c0; font-size: 1.25rem; }
.hall-item-full:nth-child(3) .rank { color: #cd7f32; font-size: 1.2rem; }

.hall-item-full .avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--cor-borda);
    margin: 0 15px;
    object-fit: cover;
}

.hall-item-full .info {
    flex: 1;
}

.hall-item-full .username {
    display: block;
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
}

.hall-item-full .likes {
    font-size: 0.8rem;
    color: var(--cor-secundaria);
    font-weight: 800;
}

/* --- ESTILOS DO MODAL DE PERFIL (IMPORTADOS DO LOUNGE) --- */

/* Modal Expandido */
.profile-modal-wide {
    width: 95%;
    max-width: 1100px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden;
    background: #121214;
    border: 1px solid var(--cor-borda);
    border-radius: 20px;
    position: relative;
    box-shadow: 0 0 50px black;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop { from { transform: scale(0.9) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.profile-header-section {
    flex-shrink: 0;
    border-bottom: 1px solid var(--cor-borda);
    padding-bottom: 20px;
}

/* Tabs do Perfil */
.profile-nav-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
    border-bottom: 1px solid var(--cor-borda);
    background: rgba(0,0,0,0.2);
}

.p-tab-btn {
    background: transparent;
    border: none;
    color: var(--cor-texto-terciario);
    padding: 15px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: 0.2s;
}

.p-tab-btn:hover { color: white; }
.p-tab-btn.active {
    color: var(--cor-primaria);
    border-bottom-color: var(--cor-primaria);
}

/* Conteúdo das Tabs */
.profile-tab-content {
    display: none;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.profile-tab-content.active {
    display: block;
}

/* Library Grid */
.library-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.lib-filters {
    display: flex;
    gap: 10px;
}

.lib-filter-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--cor-borda);
    color: var(--cor-texto-terciario);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
}

.lib-filter-btn.active {
    background: var(--cor-primaria);
    color: white;
    border-color: var(--cor-primaria);
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.lib-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--cor-borda);
    transition: 0.2s;
    cursor: pointer;
}

.lib-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border-color: var(--cor-primaria);
}

.lib-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.lib-info {
    padding: 10px;
    background: rgba(0,0,0,0.8);
    position: absolute;
    bottom: 0; left: 0; width: 100%;
}

.lib-title {
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.lib-status-badge {
    position: absolute;
    top: 5px; right: 5px;
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 2px 5px black;
}

.status-completed { background: #10b981; color: black; }
.status-playing { background: #3b82f6; color: white; }
.status-watching { background: #8b5cf6; color: white; }
.status-dropped { background: #ef4444; color: white; }
.status-plan { background: #71717a; color: white; }

.lib-rating {
    color: #fbbf24;
    font-size: 0.75rem;
}

/* Botão Fechar Modal */
.close-modal-btn, .close-profile-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    font-size: 1.5rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
    z-index: 100;
}

.close-modal-btn:hover {
    background: var(--cor-aviso);
    color: white;
    transform: rotate(90deg);
}

/* ========================================================================== */
/*                     MODAL DE CONFIGURAÇÃO (REDESIGN)                       */
/* ========================================================================== */

.config-tab-wrapper {
    position: relative;
    overflow: hidden;
    height: 100%;
    /* display: flex; REMOVED - Causes visibility bug */
    flex-direction: column;
}

/* Fix Visibility: Only flex when active */
.profile-tab-content.config-tab-wrapper.active {
    display: flex;
}

/* Background Blur Effect */
.config-backdrop-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.3);
    z-index: 0;
    opacity: 0.5;
    transition: background-image 0.5s ease;
}

.config-content-container {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 30px;
    padding: 20px 40px; /* Increased side padding */
    /* height: 100%; REMOVED - Causes overflow calculation issues */
    flex: 1; /* Take remaining height */
    min-height: 0; /* Allow scrolling inside flex item */
    overflow-y: auto;
    align-items: flex-start; /* Prevent stretching items weirdly */
}

/* Poster Column */
.poster-column {
    flex-shrink: 0;
    width: 220px; /* Slightly wider */
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky; /* Keep poster visible if form scrolls? Optional */
    top: 0;
}

.modern-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s ease;
}

.modern-poster:hover {
    transform: scale(1.02);
}

/* Details Column */
.details-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%; /* Ensure it takes full width */
    max-width: 800px; /* Prevent too wide on huge screens */
}

.config-title-header {
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    line-height: 1.2;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cor-texto-terciario);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modern-select, .modern-textarea {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    width: 100%;
    font-family: var(--font-principal);
}

.modern-select:focus, .modern-textarea:focus {
    border-color: var(--cor-primaria);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.2);
    outline: none;
}

.modern-textarea {
    resize: none;
    height: 120px;
    line-height: 1.5;
}

/* Star Rating Moderno */
.star-rating-modern {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: fit-content;
    cursor: pointer;
}

.star-rating-modern i {
    font-size: 1.4rem;
    color: #444; /* Inactive color */
    transition: transform 0.2s, color 0.2s;
}

.star-rating-modern:hover i {
    transform: scale(1.1);
}

/* Save Button */
.save-action-btn {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, #4752c4 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(88, 101, 242, 0.4);
}

.save-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.6);
    filter: brightness(1.1);
}

/* Responsividade do Modal Interno */
@media (max-width: 768px) {
    .config-content-container {
        flex-direction: column;
        align-items: center;
    }
    
    .poster-column {
        width: 140px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .config-title-header {
        text-align: center;
        font-size: 1.5rem;
    }
}
