html {
    scrollbar-gutter: stable;
}

:root {
    --primary: #f1c40f;
    --primaryDark: #d4ac0d;
    --textPrimary: #14171a;
    --textMain: #14171a;
    --bgPage: #e6ecf0;
    --bgCard: #eef0e7cc;
    --bgBadge: #f1f3f5;
    --textMuted: #657786;
    --borderColor: #e6ecf0;
    --shadowPostItem: #eeeeee;
    --shadowColor: rgba(0, 0, 0, 0.05);
    --mainColor: #ffffff;
    --error: #e74c3c;
    --bgHover: #edf0f1;
}

/* -------------------- Themes Area-------------------*/
[data-theme='dark'] {
    --mainColor: #1e1e1e;
    --bgPage: #121212;
    --bgCard: #474545;
    --bgBadge: #2c2c2c;
    --textMain: #d6dbd5;
    --textMuted: #8899a6;
    --borderColor: #585e63;
    --shadowColor: #2d2e30;
    --bgHover: #3d4244;
}

.themeLogin {
    --themePrimary: var(--primary);
    --themeHover: var(--primaryDark);
    --themeShadow: var(--primaryDark);
}

.themeTimeline {
    --themePrimary: var(--primary);
    --themeHover: var(--primaryDark);
    --themeShadow: var(--primaryDark);
}

.themeSignup {
    --themePrimary: #27ae60;
    --themeHover: #2ecc71;
    --themeShadow: #1e8449;
}

.themeAbout {
    --themePrimary: #2980b9;
    --themeHover: #3498db;
    --themeShadow: #1c5980;
}

.themeError {
    --themePrimary: #a0a5a2;
    --themeHover: #bdc3c7;
    --themeShadow: #7f8c8d;
}
/*----------------------- End Themes Area-------------- */

/* -------------------- Degub Mode Dev Environment -------------*/
body.debugMode * {
    outline: 1px solid rgba(255, 0, 0, 0.2) !important;
}
body.debugMode div {
    outline-color: rgba(0, 123, 255, 0.4) !important;
}
body.debugMode section {
    outline-color: rgba(40, 167, 69, 0.4) !important;
}
/* ---------------------   End Debug Mode ----------------*/

/*---------------------GLobal Styles-------------------*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bgPage);
    color: var(--textMain);
    line-height: 1.6;
    font-size: 1.05rem;
}
/*----------------------- End Global Styles-------------*/

/*--------------------------Other------------------------------*/

.brandEmoji {
    font-size: 1.4rem;
}

.textMuted {
    color: var(--textMuted);
}
.iconBananaClub {
    stroke: var(--textMuted);
    transition: stroke 0.2s ease;
    vertical-align: middle;
}

/*--------------------------End Other------------------------------*/

/* ------------------------------------ NAVBAR ------------------------- */
.navbar {
    background-color: var(--mainColor);
    border-bottom: 1px solid var(--borderColor);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 9999;
    padding: 5px 5px;
    box-shadow: 0 5px 15px var(--shadowColor);
}

/* Layout of 3 columns to Nav bar */
/* flex Column left, center auto, right flexible */
.navContainer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.navLeft {
    display: flex;
    align-items: center;
    gap: 0px;
}

.navCenter {
    text-align: center;
}

.navRight {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

.navStats {
    display: flex;
    align-items: center;
    /*background: var(--bgCard);*/
    /*  border: 1px solid var(--primary);*/
    /* padding: 2px 2px;*/
    border-radius: 8px;
    margin: 0;
}
.statCount {
    font-weight: 800;
    font-size: 0.9rem;
    margin-right: 0px;
    color: var(--primaryDark);
}

.navBananaClub {
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--primaryDark);
}
@media (max-width: 600px) {
    .navBananaClub {
        display: none;
    }
}

.navUserBadge {
    /*  background-color: var(--bgPage);*/
    padding: 4px 4px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--textMain);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
@media (max-width: 600px) {
    .navUserBadge {
        max-width: 120px;
        padding: 3px 10px;
    }
}

.navItemDebugModeOn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.3;
    transition: 0.3s;
    z-index: 1000;
}
.navItemDebugModeOn:hover {
    opacity: 1;
}

/*  ---------------------------------------- END NAVBAR ------------------------- */

/*---------------------- Main Button Style (Banana Button) ------------------------ */
.btnBanana {
    display: inline-block;
    background-color: var(--primary);
    border: 1px solid var(--primaryDark);
    color: var(--textPrimary);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}
.btnBanana:hover {
    background-color: var(--primaryDark);
}
[class*='theme'] .btnBanana {
    background-color: var(--themePrimary);
    border: var(--themeShadow);
}
[class*='theme'] .btnBanana:hover {
    background-color: var(--themeHover);
    border: var(--themeShadow);
}
/* -------------------------end Main Button Style------------------------- */

/*----------------------Structure of Timeline----------------------*/
.mainContainer {
    max-width: 650px;
    margin: 20px auto;
    padding: 0 15px;
}

.feedTimeline {
    border: 1px solid var(--borderColor);
    border-radius: 8px;
    align-self: start;
    background: transparent;
    border: none;
    padding: 0;
}

.postList {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
/*----------------------End Structure of Timeline----------------------*/

/*---------------------Create Posts--------------------------------------*/
.postCreateBox {
    background: var(--mainColor);
    border: 1px solid var(--borderColor);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.postTextArea {
    resize: none;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 80px;
    height: 80px;
    max-height: 250px;
    overflow-y: hidden;
    transition: height 0.1s ease;
    padding: 10px;
    color: var(--textMain);
    background-color: var(--bgCard);
    border: 1px solid var(--borderColor);
}
.postTextArea::placeholder {
    color: var(--textMuted);
    font-style: italic;
}

.formControl {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--borderColor);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    font-family: inherit;
}
.formControl:focus {
    border-color: var(--primary);
}

.postActions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
/*---------------------Create Posts--------------------------------------*/

/*---------------------Posts--------------------------------------*/
.postContent p {
    cursor: default;
    color: var(--textMain);
    font-size: 1.05rem;
    line-height: 1.6;
    letter-spacing: -0.01em;
    /* SURGICAL MANEUVERS HERE: */
    white-space: pre-wrap; /* Maintains manual line breaks (Enter) */
    overflow-wrap: break-word; /* Breaks long words to prevent overflow */
    word-break: break-word; /* Reinforcement for older browsers */
    word-wrap: break-word; /* Another layer of security */
    max-width: 100%; /* Ensures the paragraph does not grow beyond its parent */
    display: block; /* Ensures block behavior */
}

.postAvatar {
    top: 7px;
    width: 36px;
    height: 36px;
    background-color: transparent;
    color: #14171a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    flex-shrink: 0;
    position: relative;
}
.postAvatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.postAvatar.noTop {
    top: -3px;
}

.postAuthorLink {
    font-weight: 700;
    color: var(--textMain);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.postAuthorLink:hover {
    color: var(--primaryDark);
    text-decoration: underline;
}

.postFooter {
    display: flex;
    justify-content: flex-end;
    margin-top: 0px;
    font-size: 0.72rem;
    border-top: 1px solid var(--borderColor);
    padding-top: 0px;
    text-align: right;
}

.footerActions {
    display: flex;
    align-items: center;
}

.postContainer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0px;
    width: 100%;
}

.postOthers {
    flex-direction: row;
}

.postOwn {
    flex-direction: row-reverse;
}
.postOwn .postItem {
    background-color: var(--bgCard);
    border-color: var(--primary);
}

.postItem {
    background: var(--mainColor);
    border: 1px solid var(--borderColor);
    border-radius: 18px;
    padding: 15px;
    padding-right: 7px;
    padding-top: 7px;
    padding-bottom: 5px;
    max-width: 85%;
    position: relative;
    box-shadow: 0 2px 5px var(--shadowPostItem);
}
.postItem:hover {
    background-color: var(--bgCard);
}

/* --- Protrusion (The "tip" of the balloon) --- */
.postItem::before {
    content: '';
    position: absolute;
    top: 15px;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Protrusion to the left (Others) */
.postOthers .postItem::before {
    left: -10px;
    border-width: 8px 10px 8px 0;
    border-color: transparent var(--primary) transparent transparent;
}

/* Protrusion to the right (Mine) */
.postOwn .postItem::before {
    right: -10px;
    border-width: 8px 0 8px 10px;
    border-color: transparent transparent transparent var(--primary);
}
.postOptions {
    position: relative;
}

.postDate {
    color: var(--textMuted);
    margin-left: auto;
}

.postHeader {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    margin-bottom: 5px;
}
.postOwn .postHeader {
    flex-direction: row-reverse;
}

/*---------------------End--Posts--------------------------------------*/

/*---------------------Login------------------------------*/
.loginLayout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 80px);
    padding: 40px 20px;
}
.loginContent {
    width: 100%;
    max-width: 600px;
    background-color: var(--mainColor);
    border: 1px solid var(--borderColor);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 12px var(--shadowColor);
}
@media (max-width: 600px) {
    .loginLayout {
        padding: 20px 10px;
    }
    .loginContent {
        padding: 30px 15px;
        border: none;
        box-shadow: none;
        background: transparent;
    }
}

.loginBox {
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.logoLogin {
    width: 100px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}

.title {
    font-size: 2.2rem;
    color: var(--textMain);
    margin-bottom: 5px;
    font-weight: 800;
}
[class*='theme-'] .title {
    color: var(--themePrimary);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--textMuted);
    margin-bottom: 30px;
}

.loginForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.btnFull {
    width: 100%;
    font-size: 1.1rem;
    padding: 12px;
}

.errorBox {
    background-color: #fdeaea;
    color: var(--error);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--error);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.iconError {
    stroke: var(--error);
}
/*---------------------End Login------------------------------*/

/*---------------------Signup------------------------------*/
.signupCta {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--borderColor);
}
.signupCta p {
    margin-bottom: 15px;
    color: var(--textMuted);
}

.btnOutline {
    display: inline-block;
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--textMain);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
    width: 100%;
    cursor: pointer;
    line-height: 1.4;
}
.btnOutline:hover {
    background-color: var(--primary);
}

.termsText {
    text-align: left;
    color: var(--textMuted);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 5px 0 10px 0;
}
/*---------------------End Signup------------------------------*/

/* ----------------------------Common Base for Alerts----------------------- */
.clubeAlert {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 10000;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 15px 45px 15px 15px;
    width: auto;
    max-width: 320px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.5s ease-out;
    border: 1px solid;
}

.successStyle {
    background-color: #e8f5e9;
    color: #1b5e20;
    border-color: #4caf50;
    border-left: 6px solid #4caf50;
}

.errorStyle {
    background-color: #ffebee;
    color: #b71c1c;
    border-color: #ef5350;
    border-left: 6px solid #ef5350;
}

.alertIcon {
    font-size: 1.4rem;
    flex-shrink: 0;
}
.alertText strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 3px;
}
.alertText p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.closeAlert {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #66bb6a;
    line-height: 1;
    transition: color 0.2s;
    opacity: 0.5;
}
.closeAlert:hover {
    opacity: 1;
    color: #1b5e20;
}
/*-----------------------------------------------------------------------*/

/* ----------------------Header container to align name and menu----------------- */

.btnOptions {
    background: none;
    border: none;
    color: var(--textMuted);
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}
.btnOptions:hover {
    color: var(--primaryDark);
}

.btnDeleteLink {
    width: 100%;
    background: none;
    border: none;
    color: var(--error);
    padding: 10px 15px;
    text-align: left;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
}
.btnDeleteLink:hover {
    background-color: #fff1f0;
    border-radius: 8px;
}

/*----------------------Dropdown Menu for Post Options and Nav User Menu----------------- */
.dropdownMenu {
    display: none;
    position: absolute;
    top: 60px;
    background-color: var(--mainColor);
    box-shadow: 0px 5px 15px var(--shadowColor);
    border-radius: 8px;
    border: 1px solid var(--borderColor);
    z-index: 1000;
    overflow: hidden;
}
.dropdownMenu.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease-out;
}
.dropdownMenu a {
    display: block;
    padding: 10px 10px;
    text-decoration: none;
    color: var(--textMain);
}
.dropdownMenu a:hover {
    background: var(--bgHover);
}

/* Ensures that the right-hand menu does not go off-screen */
.dropdownMenu.right-aligned {
    right: 20px;
    left: auto;
}

.dropdownMenu.menuPost {
    top: 25px; /* Closer to the 3-dot button */
    right: 0; /* Right-aligned */
    left: auto;
    min-width: 150px;
}
/*----------------------End Dropdown Menu for Post Options and Nav User Menu----------------- */

/*----------------------Header container to align name and menu----------------- */
.navTrigger {
    display: flex;
    flex-direction: row; /* Forces single line */
    align-items: center; /* Aligns the center of the banana with the center of the name */
    gap: 10px; /* Gives some breathing room between the elements */
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: background 0.2s;
}
@media (max-width: 600px) {
    .navTrigger {
        gap: 1px; /* Reduces space on small screens */
        padding: 1px 1px;
        padding-left: 4px;
    }
}
.navTrigger:hover {
    background: var(--shadowColor);
}

.noGap {
    gap: 0px;
    padding-right: 0px;
}

.chevronIcon {
    opacity: 0.6;
}
/*----------------------End Header container to align name and menu----------------- */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.colorBananaGreen {
    background-color: #27ae60 !important;
    border-color: #1b5e20;
}
.colorBananaGreen:hover {
    background-color: #2ecc71;
    border-color: #1e8449;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animatePost {
    animation: slideIn 0.3s ease-out;
}

/* No seu style.css */
.post-pending {
    opacity: 0.5;
    filter: grayscale(50%);
    transition: opacity 0.3s ease;
}

/* Animação de entrada suave */
@keyframes slideInFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.postContainer {
    animation: slideInFade 0.4s ease-out forwards;
}

/* Efeito Piscante (Glow) para posts novos */
@keyframes blinkGlow {
    0% {
        box-shadow: 0 0 5px rgba(255, 204, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 204, 0, 0.6);
        border-color: #ffcc00;
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 204, 0, 0.2);
    }
}

.post-new-alert {
    animation: blinkGlow 1.5s infinite ease-in-out;
    cursor: pointer;
    border: 2px solid transparent;
}

/* Para de piscar ao passar o mouse ou tocar */
.post-new-alert:hover,
.post-new-alert:active {
    animation: none;
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.1); /* ou a cor padrão do seu post */
}

/* ==========================================================================
   ANIMAÇÕES E EFEITOS DE POLIMENTO (Refatorado)
   ========================================================================== */

/* 1. Entrada Suave e Orgânica */
@keyframes softerSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95) rotateX(-10deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

.postContainer {
    /* Animação ultra suave com bezier personalizado */
    animation: softerSlideIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    /* Melhora renderização de animação no mobile */
    backface-visibility: hidden;
    will-change: transform, opacity;
}

/* 2. Efeito Piscante (Glow) ISOLADO no .postItem (Item 1 Resolvido) */
@keyframes blinkGlowBubble {
    0% {
        box-shadow: 0 2px 5px var(--shadowPostItem);
        border-color: var(--borderColor);
        /* background-color: transparent;*/
    }
    50% {
        box-shadow: 0 0 20px rgba(241, 196, 15, 0.7); /* Amarelo Banana */
        border-color: var(--primary); /* Define a borda amarela aqui */
        background-color: rgba(46, 204, 113, 0.08);
    }
    100% {
        box-shadow: 0 2px 5px var(--shadowPostItem);
        border-color: var(--borderColor);
        /* background-color: transparent; */
    }
}

/* Aplicamos a classe de alerta no container, mas miramos o balão (.postItem) */
.postContainer.post-new-alert .postItem {
    animation: blinkGlowBubble 2s infinite ease-in-out;
    border: 1px solid transparent; /* Base para a animação */
    /*cursor: pointer;*/
}

/* Estado Own (Meu Post) ajusta a cor da borda base na animação */
.postOwn.post-new-alert .postItem {
    border-color: var(--primary); /* Mantém a borda padrão enquanto pisca o glow */
}

/* Remove o efeito ao interagir com o balão especificamente */
.postContainer.post-new-alert .postItem:hover,
.postContainer.post-new-alert .postItem:active {
    animation: none !important;
    box-shadow: 0 2px 5px var(--shadowPostItem) !important;
    border-color: var(--borderColor) !important;
}
/* Correção para hover no meu post */
.postOwn.post-new-alert .postItem:hover {
    border-color: var(--primary) !important;
}

/* CSS para manipulação via JS */
.stop-animation .postItem {
    animation: none !important;
    box-shadow: 0 2px 5px var(--shadowPostItem) !important;
}


.badge {
    background-color: var(--bgBadge);
    color: var(--textPrimary);
    align-items: center;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}





/* ----------------------Ranking Menu Styles----------------- */
.ranking-header {
    padding: 3px;
    font-weight: bold;
    text-align: center;
    color: var(--text-color);
}

/* Use uma classe combinada para garantir prioridade */
.dropdownMenu .ranking-item {
    display: flex !important; /* Força o flexbox contra o display:block genérico */
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px; /* Corrigido de 8x para 8px */
    width: 100%;
    min-width: 250px; /* Garante que o menu tenha largura para não esmagar o nome */
    text-decoration: none;
}

.rank-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1; /* Faz a parte do nome ocupar o espaço disponível */
}

.rank-value {
    white-space: nowrap; /* Impede a banana de cair para a linha de baixo */
    font-weight: bold;
    margin-left: 10px;
}

.ranking-item:hover {
    background: var(--hover-bg);
}

.ranking-item:last-child {
    border-bottom: none;
}


.rank-pos {
    font-weight: bold;
    min-width: 25px;
}

.rank-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}
/* ----------------------End Ranking Menu Styles----------------- */


/* ----------------------Google Login Button Styles----------------- */

    .btn-google {
        display: inline-flex;
        align-items: center;
        background-color: #fff;
        color: #757575;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 10px 16px;
        font-family: 'Roboto', sans-serif;
        font-weight: 500;
        text-decoration: none;
        transition: box-shadow 0.2s;
    }
    .btn-google:hover {
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    .btn-google svg {
        margin-right: 12px;
        width: 18px;
        height: 18px;
    }

/* ----------------------End Google Login Button Styles----------------- */