*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, sans-serif;
}

body{
    min-height:100vh;
    background:#f4f7ff;
    color:#111827;
}

.btn-perfil-fav{
    position:fixed;
    top:20px;
    right:22px;
    z-index:1000;
}

.btn-perfil-fav img{
    width:54px;
    height:54px;
    border-radius:50%;
    object-fit:cover;
    cursor:pointer;
    border:3px solid #fff;
    box-shadow:0 8px 22px rgba(0,0,0,.15);
}

.favoritos-page{
    margin-left:100px;
    padding:42px 55px 70px;
}

.favoritos-header{
    background:white;
    border-radius:28px;
    padding:38px;
    box-shadow:0 10px 28px rgba(0,0,0,.07);
    margin-bottom:24px;
}

.badge-fav{
    display:inline-flex;
    gap:8px;
    align-items:center;
    background:#fee2e2;
    color:#b91c1c;
    padding:9px 16px;
    border-radius:999px;
    font-weight:800;
    margin-bottom:16px;
}

.favoritos-header h1{
    font-size:44px;
    margin-bottom:10px;
}

.favoritos-header p{
    color:#4b5563;
    font-size:18px;
    line-height:1.55;
    max-width:780px;
}

.favoritos-toolbar{
    display:flex;
    gap:14px;
    align-items:center;
    justify-content:space-between;
    margin-bottom:24px;
}

.favoritos-search{
    flex:1;
    background:white;
    height:50px;
    border-radius:20px;
    display:flex;
    align-items:center;
    gap:12px;
    padding:0 16px;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
}

.favoritos-search input{
    width:100%;
    border:none;
    outline:none;
    background:transparent;
    font-size:16px;
}

#btnAtualizarFavoritos{
    height:50px;
    border:none;
    border-radius:20px;
    background:#7494ec;
    color:white;
    padding:0 20px;
    font-weight:800;
    cursor:pointer;
}

.favoritos-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(230px, 1fr));
    gap:22px;
}

.favorito-card{
    background:white;
    border-radius:22px;
    padding:22px;
    box-shadow:0 8px 24px rgba(0,0,0,.08);
    display:flex;
    flex-direction:column;
    min-height:285px;
}

.favorito-icon{
    width:64px;
    height:64px;
    border-radius:18px;
    background:#edf2ff;
    color:#5277e8;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:32px;
    margin-bottom:15px;
}

.favorito-card h2{
    font-size:20px;
    margin-bottom:8px;
    overflow:hidden;
    text-overflow:ellipsis;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
}

.favorito-card p{
    color:#6b7280;
    margin-bottom:7px;
    font-size:14px;
}

.favorito-acoes{
    display:flex;
    gap:9px;
    flex-wrap:wrap;
    margin-top:auto;
    padding-top:16px;
}

.favorito-acoes button,
.favorito-acoes a{
    border:none;
    text-decoration:none;
    background:#f3f4f6;
    color:#111827;
    padding:10px 12px;
    border-radius:15px;
    font-weight:800;
    cursor:pointer;
    font-size:14px;
}

.favorito-acoes .btn-ver-fav:hover{
    background:#3498db;
    color:white;
}

.favorito-acoes .btn-download-fav:hover{
    background:#22c55e;
    color:white;
}

.favorito-acoes .btn-remover-fav:hover{
    background:#dc2626;
    color:white;
}

.estado-vazio{
    grid-column:1 / -1;
    background:white;
    padding:30px;
    border-radius:22px;
    text-align:center;
    color:#6b7280;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
}

.modal-fav{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.6);
    z-index:3000;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.modal-fav-conteudo{
    background:white;
    width:min(1000px, 94vw);
    height:min(760px, 90vh);
    border-radius:24px;
    padding:24px;
    position:relative;
}

.fechar-modal-fav{
    position:absolute;
    top:14px;
    right:18px;
    border:none;
    background:none;
    font-size:34px;
    cursor:pointer;
}

#modalFavTitulo{
    margin-bottom:15px;
    padding-right:50px;
}

body.dark-mode{
    background:#121212;
    color:#e0e0e0;
}

body.dark-mode .favoritos-header,
body.dark-mode .favoritos-search,
body.dark-mode .favorito-card,
body.dark-mode .estado-vazio,
body.dark-mode .modal-fav-conteudo{
    background:#1f1f1f;
    color:#e0e0e0;
}

body.dark-mode .favoritos-header p,
body.dark-mode .favorito-card p,
body.dark-mode .estado-vazio{
    color:#cbd5e1;
}

body.dark-mode .favorito-acoes button,
body.dark-mode .favorito-acoes a{
    background:#2a2a2a;
    color:#e0e0e0;
}

@media(max-width:800px){
    .favoritos-page{
        margin-left:80px;
        padding:30px 18px 60px;
    }

    .favoritos-header h1{
        font-size:34px;
    }

    .favoritos-toolbar{
        flex-direction:column;
        align-items:stretch;
    }
}
