.profile-page {

    max-width: 1100px;

    margin: 0 auto;

    padding: 60px 20px 100px;

}


/* PERFIL */

.profile-card {

    display: flex;

    align-items: center;

    gap: 30px;

    padding: 35px;

    margin-bottom: 30px;

    background:
        linear-gradient(
            135deg,
            rgba(124, 58, 237, 0.18),
            rgba(236, 72, 153, 0.08)
        );

    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 20px;

}


.profile-avatar {

    width: 110px;
    height: 110px;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 50px;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #7c3aed,
            #ec4899
        );

}


.profile-label {

    font-size: 12px;

    font-weight: 700;

    letter-spacing: 2px;

    color: #a78bfa;

}


.profile-info h1 {

    margin: 8px 0;

    font-size: 36px;

}


.profile-info p {

    margin: 0;

    color: #94a3b8;

}


/* DETALHES */

.profile-details {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 20px;

    margin-bottom: 30px;

}


.detail-card {

    display: flex;

    align-items: center;

    gap: 15px;

    padding: 22px;

    background: #111827;

    border: 1px solid rgba(255,255,255,0.06);

    border-radius: 16px;

}


.detail-card > span {

    font-size: 25px;

}


.detail-card small {

    display: block;

    color: #64748b;

    margin-bottom: 5px;

}


.detail-card strong {

    color: #f8fafc;

}


/* SEÇÕES */

.profile-sections {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 20px;

    margin-bottom: 30px;

}


.empty-section {

    padding: 35px;

    text-align: center;

    background: #111827;

    border: 1px solid rgba(255,255,255,0.06);

    border-radius: 18px;

}


.empty-icon {

    font-size: 38px;

    margin-bottom: 10px;

}


.empty-section h2 {

    margin: 5px 0 10px;

}


.empty-section p {

    color: #64748b;

    line-height: 1.6;

}


/* LOGOUT */

.logout-button {

    width: 100%;

    padding: 16px;

    border: 1px solid rgba(239,68,68,0.3);

    border-radius: 12px;

    background: rgba(239,68,68,0.08);

    color: #f87171;

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;

    transition: 0.2s;

}


.logout-button:hover {

    background: rgba(239,68,68,0.15);

}


/* VOLTAR */

.back-button {

    text-decoration: none;

    color: #c4b5fd;

    font-weight: 600;

}


/* FOOTER */

.main-footer {

    padding: 40px 20px;

    border-top: 1px solid rgba(255,255,255,0.06);

}


.footer-container {

    max-width: 1100px;

    margin: auto;

}


.footer-logo {

    font-size: 22px;

    font-weight: 800;

}


.footer-logo span {

    color: #a855f7;

}


.footer-container p {

    color: #64748b;

}


.footer-container small {

    color: #475569;

}


/* MOBILE */

@media (max-width: 700px) {

    .profile-card {

        flex-direction: column;

        text-align: center;

    }


    .profile-details {

        grid-template-columns: 1fr;

    }


    .profile-sections {

        grid-template-columns: 1fr;

    }


    .profile-info h1 {

        font-size: 28px;

    }

}
/* =========================
   EDITAR PERFIL
========================= */

.profile-card {
    position: relative;
}

.profile-bio {
    margin-top: 10px !important;
    color: #94a3b8;
    max-width: 600px;
}

.edit-profile-button {
    margin-left: auto;

    padding: 12px 18px;

    border: 1px solid rgba(167, 139, 250, 0.3);

    border-radius: 10px;

    background: rgba(124, 58, 237, 0.12);

    color: #c4b5fd;

    font-weight: 700;

    cursor: pointer;

    transition: 0.2s;
}

.edit-profile-button:hover {
    background: rgba(124, 58, 237, 0.25);
}


/* MODAL */

.profile-modal {
    position: fixed;

    inset: 0;

    display: none;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.75);

    z-index: 9999;
}

.profile-modal.active {
    display: flex;
}

.profile-modal-content {
    position: relative;

    width: 100%;

    max-width: 500px;

    padding: 35px;

    background: #111827;

    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 20px;

    box-shadow: 0 25px 80px rgba(0,0,0,0.5);
}

.profile-modal-content h2 {
    margin: 8px 0 25px;
}

.profile-modal-content label {
    display: block;

    margin: 18px 0 8px;

    color: #cbd5e1;

    font-weight: 600;
}

.profile-modal-content input,
.profile-modal-content textarea {
    width: 100%;

    box-sizing: border-box;

    padding: 13px 14px;

    border: 1px solid rgba(255,255,255,0.1);

    border-radius: 10px;

    background: #0f172a;

    color: white;

    font-size: 15px;

    outline: none;
}

.profile-modal-content input:focus,
.profile-modal-content textarea:focus {
    border-color: #8b5cf6;
}

.profile-modal-content textarea {
    min-height: 120px;

    resize: vertical;
}

.close-modal {
    position: absolute;

    top: 15px;

    right: 18px;

    border: none;

    background: none;

    color: #94a3b8;

    font-size: 30px;

    cursor: pointer;
}

.close-modal:hover {
    color: white;
}


/* BOTÕES */

.modal-actions {
    display: flex;

    gap: 12px;

    margin-top: 25px;
}

.cancel-button,
.save-button {
    flex: 1;

    padding: 13px;

    border-radius: 10px;

    font-weight: 700;

    cursor: pointer;
}

.cancel-button {
    border: 1px solid rgba(255,255,255,0.1);

    background: transparent;

    color: #94a3b8;
}

.save-button {
    border: none;

    background: linear-gradient(
        135deg,
        #7c3aed,
        #ec4899
    );

    color: white;
}

.edit-message {
    margin-top: 15px;

    text-align: center;

    font-size: 14px;
}


/* MOBILE */

@media (max-width: 700px) {

    .edit-profile-button {
        margin-left: 0;

        width: 100%;
    }

    .profile-modal-content {
        padding: 25px;
    }

    .modal-actions {
        flex-direction: column;
    }

}
/* =========================
   MINHA BIBLIOTECA
========================= */

.profile-library {
    margin-top: 30px;
    margin-bottom: 30px;

    padding: 30px;

    background: #111827;

    border: 1px solid rgba(255,255,255,0.06);

    border-radius: 18px;
}


/* CABEÇALHO */

.library-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 25px;
}


.section-label {
    font-size: 12px;

    font-weight: 700;

    letter-spacing: 2px;

    color: #a78bfa;
}


.library-header h2 {
    margin: 6px 0 0;

    font-size: 26px;

    color: #f8fafc;
}


/* ABAS */

.library-tabs {
    display: flex;

    gap: 8px;

    margin-bottom: 25px;

    padding-bottom: 5px;

    overflow-x: auto;
}


.library-tab {
    flex-shrink: 0;

    padding: 10px 15px;

    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 10px;

    background: #0f172a;

    color: #94a3b8;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}


.library-tab:hover {
    border-color: rgba(139,92,246,0.5);

    color: white;
}


.library-tab.active {
    background: #7c3aed;

    border-color: #7c3aed;

    color: white;

    box-shadow:
        0 0 15px rgba(124,58,237,0.25);
}


/* GRID */

.profile-library-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}


/* CARD */

.library-card {
    position: relative;

    overflow: hidden;

    background: #0f172a;

    border: 1px solid rgba(255,255,255,0.07);

    border-radius: 14px;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.library-card:hover {
    transform: translateY(-5px);

    border-color: rgba(139,92,246,0.6);

    box-shadow:
        0 12px 30px rgba(0,0,0,0.3);
}


/* CAPA */

.library-cover {
    position: relative;

    width: 100%;

    aspect-ratio: 2 / 3;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #1e1b4b,
            #312e81
        );
}


.library-cover img {
    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;

    transition:
        transform 0.3s ease;
}


.library-card:hover .library-cover img {
    transform: scale(1.05);
}


/* FAVORITO */

.library-favorite {
    position: absolute;

    top: 10px;

    right: 10px;

    width: 32px;

    height: 32px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: rgba(15,23,42,0.85);

    color: #ec4899;

    font-size: 17px;

    box-shadow:
        0 4px 12px rgba(0,0,0,0.3);
}


/* INFORMAÇÕES */

.library-card-info {
    padding: 14px;
}


.library-card-info h3 {
    margin: 0 0 10px;

    color: #f8fafc;

    font-size: 15px;

    line-height: 1.4;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* STATUS */

.library-status {
    display: inline-block;

    padding: 5px 8px;

    border-radius: 6px;

    background: rgba(124,58,237,0.12);

    color: #c4b5fd;

    font-size: 12px;

    font-weight: 600;
}


/* NOTA */

.library-rating {
    display: block;

    margin-top: 9px;

    color: #fbbf24;

    font-size: 13px;

    font-weight: 600;
}


/* CARREGANDO */

.library-loading {
    grid-column: 1 / -1;

    padding: 40px 20px;

    text-align: center;

    color: #64748b;
}


/* VAZIO */

.library-empty {
    grid-column: 1 / -1;

    padding: 50px 20px;

    text-align: center;

    border: 1px dashed rgba(255,255,255,0.08);

    border-radius: 14px;

    background: rgba(15,23,42,0.5);
}


.library-empty .empty-icon {
    font-size: 42px;

    margin-bottom: 12px;
}


.library-empty h3 {
    margin: 0 0 8px;

    color: #f8fafc;

    font-size: 18px;
}


.library-empty p {
    margin: 0;

    color: #64748b;

    line-height: 1.6;
}


/* =========================
   RESPONSIVO
========================= */

@media (max-width: 900px) {

    .profile-library-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


@media (max-width: 650px) {

    .profile-library {
        padding: 20px;
    }


    .library-header h2 {
        font-size: 22px;
    }


    .profile-library-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 12px;
    }


    .library-card-info {
        padding: 11px;
    }


    .library-card-info h3 {
        font-size: 14px;
    }


    .library-tabs {
        margin-right: -5px;
    }

}


@media (max-width: 380px) {

    .profile-library-grid {
        grid-template-columns: 1fr 1fr;

        gap: 8px;
    }

}

/* Perfil v5: organização, avatar e conta */
.profile-card{align-items:flex-start;display:grid;grid-template-columns:120px minmax(0,1fr) auto;gap:24px;}
.profile-avatar{overflow:hidden;padding:0;background:#161524;border:2px solid rgba(167,139,250,.45);box-shadow:0 10px 30px rgba(124,58,237,.2);}
.profile-avatar img{width:100%;height:100%;object-fit:cover;display:block;}
.profile-card>.edit-profile-button{margin-left:0;white-space:nowrap;}
.profile-modal-content select{width:100%;box-sizing:border-box;padding:13px 14px;border:1px solid rgba(255,255,255,.1);border-radius:10px;background:#0f172a;color:#fff;font-size:15px;}
.profile-field-help{font-size:12px!important;margin-top:7px!important;color:#7f8aa1!important;}
.avatar-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;}
.avatar-picker button{min-width:0;border:1px solid rgba(167,139,250,.2);border-radius:14px;background:#0f172a;color:#cbd5e1;padding:8px;cursor:pointer;}
.avatar-picker button[aria-pressed="true"]{border-color:#a78bfa;background:rgba(124,58,237,.22);box-shadow:0 0 0 2px rgba(124,58,237,.18);} 
.avatar-picker img{display:block;width:min(72px,100%);height:auto;aspect-ratio:1;object-fit:cover;border-radius:50%;margin:0 auto 6px;}
.profile-account-actions{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:30px 0 0;padding:18px;background:#11111b;border:1px solid rgba(255,255,255,.08);border-radius:18px;}
.account-action-button{min-height:54px;border-radius:13px;display:flex;align-items:center;justify-content:center;gap:9px;text-decoration:none;font-weight:800;font-size:15px;cursor:pointer;}
.account-action-button.security{border:1px solid rgba(167,139,250,.35);background:rgba(124,58,237,.11);color:#d8c7ff;}
.account-action-button.logout{border:1px solid rgba(248,113,113,.32);background:rgba(239,68,68,.09);color:#fda4af;}
@media(max-width:700px){.profile-card{grid-template-columns:1fr;text-align:center;}.profile-avatar{margin:auto}.profile-card>.edit-profile-button{width:100%}.profile-account-actions{grid-template-columns:1fr}.avatar-picker{grid-template-columns:1fr 1fr 1fr}.avatar-picker img{width:58px;height:58px}}
.detail-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    flex-shrink: 0;

    border-radius: 12px;

    background:
        rgba(139, 92, 246, 0.08);

    border:
        1px solid rgba(139, 92, 246, 0.15);
}

.profile-calendar-icon {
    width: 27px;
    height: 27px;

    object-fit: contain;

    filter:
        drop-shadow(
            0 0 8px rgba(139, 92, 246, 0.25)
        );
}

:root[data-msx-theme="light"] body[data-msx-page="library"] .profile-account-actions {
    background: var(--msx-panel-alt);
    border-color: var(--msx-border);
}

:root[data-msx-theme="light"] body[data-msx-page="library"] .avatar-picker button {
    background: var(--msx-panel);
    border-color: var(--msx-border);
    color: var(--msx-text);
}

:root[data-msx-theme="light"] body[data-msx-page="library"] .avatar-picker button[aria-pressed="true"] {
    background: color-mix(in srgb, var(--msx-purple) 14%, var(--msx-panel));
    border-color: var(--msx-purple);
}

:root[data-msx-theme="light"] body[data-msx-page="library"] .profile-field-help {
    color: var(--msx-muted) !important;
}

:root[data-msx-theme="light"] body[data-msx-page="library"] :is(.library-loading, .library-empty) {
    color: var(--msx-muted);
    background: var(--msx-panel-alt);
    border-color: var(--msx-border);
}

:root[data-msx-theme="light"] body[data-msx-page="library"] .library-empty h3 {
    color: var(--msx-text);
}

@media (max-width: 380px) {
    body[data-msx-page="library"] .profile-modal-content {
        padding: 20px !important;
    }

    .avatar-picker {
        gap: 6px;
    }

    .avatar-picker button {
        padding: 6px 3px;
        overflow-wrap: anywhere;
    }
}