/* Camada final de consistência visual do Conecting.
   Carregada depois das folhas antigas. */

:root {
    --app-bg: #f5f5f2;
    --app-surface: #fff;
    --app-ink: #0d0d0d;
    --app-muted: #74746f;
    --app-line: #e6e6e0;
    --app-soft: #f0f0ec;
    --app-radius-sm: 12px;
    --app-radius: 18px;
    --app-radius-lg: 24px;
    --app-shadow: 0 14px 42px rgba(14, 14, 14, .07);
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    background: var(--app-bg);
    color: var(--app-ink);
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button {
    transition:
        transform .16s ease,
        background-color .16s ease,
        border-color .16s ease,
        box-shadow .16s ease,
        opacity .16s ease;
}

button:not(:disabled):active {
    transform: scale(.98);
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}


/* =========================================================
   ANIMAÇÕES
   ========================================================= */

@keyframes connecting-text-light {
    0%, 100% {
        color: #111;
    }

    42% {
        color: #686868;
    }

    68% {
        color: #262626;
    }

    82% {
        color: #505050;
    }
}

@keyframes connecting-brand-light {
    0%, 100% {
        color: #fff;
    }

    45% {
        color: #929292;
    }

    72% {
        color: #f5f5f5;
    }
}

@keyframes connecting-button-breathe {
    0%, 100% {
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }

    50% {
        box-shadow: 0 8px 20px rgba(0, 0, 0, .13);
    }
}

.page-head h1,
.section-title h2,
.section-title h3,
.profile-name h1,
.community-header h1,
.studio-heading h1 {
    animation: connecting-text-light 8s ease-in-out infinite;
}

.sidebar .brand span,
.mobile-header .brand span {
    animation: connecting-brand-light 6s ease-in-out infinite;
}


/* =========================================================
   FOCO
   ========================================================= */

:where(button, a, input, select, textarea):focus-visible {
    outline: 3px solid rgba(0, 0, 0, .26) !important;
    outline-offset: 3px;
}


/* =========================================================
   INPUTS GERAIS
   ========================================================= */

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    color: var(--app-ink);
    box-shadow: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
    border-color: #171717;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .08);
    outline: 0;
}

::selection {
    color: #fff;
    background: #111;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    border-right: 1px solid #222;
    box-shadow: 10px 0 35px rgba(0, 0, 0, .06);
}

.sidebar .brand {
    letter-spacing: -.04em;
}

.main-nav {
    gap: 5px;
}

.nav-item {
    border-radius: 14px;
    min-height: 48px;
    color: #a9a9a9;
    font-weight: 700;
}

.nav-item b {
    font-weight: 750;
}

.nav-item .ui-icon {
    opacity: .9;
}

.nav-item.active {
    background: #292929;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.nav-item:not(.active):hover {
    background: #1a1a1a;
    color: #f2f2f2;
}

.nav-item:not(.active):hover .ui-icon {
    opacity: 1;
}

.nav-item b {
    display: inline-flex;
    overflow: hidden;
}

.nav-item b .nav-letter,
.nav-item b .nav-letter:first-child {
    display: inline-block;
    width: auto;
    min-width: .18em;
    font-size: inherit;
    line-height: inherit;
    text-align: inherit;
    transition: color .16s ease;
}


/* =========================================================
   ANIMAÇÃO DOS MENUS
   ========================================================= */

@keyframes connecting-nav-letter {
    0% {
        color: #aaa;
        transform: translateY(0);
    }

    45% {
        color: #fff;
        transform: translateY(-2px);
        text-shadow: 0 0 10px rgba(255, 255, 255, .32);
    }

    100% {
        color: currentColor;
        transform: translateY(0);
        text-shadow: none;
    }
}

@keyframes connecting-nav-letter-idle {
    0%, 72%, 100% {
        color: #aaa;
        transform: translateY(0);
        text-shadow: none;
    }

    12% {
        color: #fff;
        transform: translateY(-1px);
        text-shadow: 0 0 10px rgba(255, 255, 255, .28);
    }

    25% {
        color: #c8c8c8;
        transform: translateY(0);
        text-shadow: none;
    }
}

@keyframes connecting-nav-icon {
    0% {
        transform: scale(1) rotate(0);
    }

    50% {
        transform: scale(1.14) rotate(-7deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

.nav-item:hover .nav-letter,
.nav-item:focus-visible .nav-letter {
    animation: connecting-nav-letter .5s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--letter-index) * 42ms);
}

.nav-item .nav-letter {
    animation: connecting-nav-letter-idle 5.8s ease-in-out infinite;
    animation-delay: calc(var(--letter-index) * 105ms);
}

.nav-item:hover .ui-icon,
.nav-item:focus-visible .ui-icon {
    animation: connecting-nav-icon .42s ease both;
}

.nav-item.active .nav-letter {
    color: #fff;
}


/* =========================================================
   MOBILE NAV
   ========================================================= */

.mobile-nav > button > span .mobile-letter {
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    min-width: .14em;
    overflow: visible !important;
    font-size: inherit !important;
    line-height: inherit !important;
    white-space: pre !important;
    animation: connecting-nav-letter-idle 5.8s ease-in-out infinite;
    animation-delay: calc(var(--letter-index) * 105ms);
}

.mobile-nav > button:active .mobile-letter,
.mobile-nav > button:focus-visible .mobile-letter {
    animation: connecting-nav-letter .5s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--letter-index) * 42ms);
}

.mobile-nav > button:active .ui-icon,
.mobile-nav > button:focus-visible .ui-icon {
    animation: connecting-nav-icon .42s ease both;
}

.sidebar-footer {
    border-top-color: #252525;
}

.user-chip {
    border-radius: 14px;
}

.logout:hover {
    background: #1c1c1c;
}


/* =========================================================
   PÁGINAS
   ========================================================= */

.page {
    min-width: 0;
}

.standard-page {
    max-width: 1320px;
}

.page-head {
    gap: 20px;
}

.page-head h1,
.section-title h2,
.section-title h3 {
    letter-spacing: -.035em;
}


/* =========================================================
   CARDS
   ========================================================= */

.composer,
.post-card,
.rail-card,
.notification-center,
.platform-card,
.empty-state,
.empty-small,
.people-list,
.help-card,
.privacy-card,
.settings-card {
    border-color: var(--app-line);
}

.composer,
.post-card,
.rail-card,
.platform-card,
.help-card,
.privacy-card,
.settings-card {
    box-shadow: var(--app-shadow);
}

.composer {
    border-radius: var(--app-radius);
}

.composer:hover {
    border-color: #d7d7d0;
}

.post-card {
    border-radius: var(--app-radius);
    overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
    .post-card:hover {
        border-color: #d6d6d0;
        box-shadow: 0 18px 44px rgba(15, 15, 15, .09);
    }
}


/* =========================================================
   TABS
   ========================================================= */

.feed-tabs {
    border-bottom-color: var(--app-line);
    scrollbar-width: none;
}

.feed-tabs::-webkit-scrollbar {
    display: none;
}

.feed-tabs button,
.content-filter button,
.filter-chip {
    border-radius: 999px;
    font-weight: 700;
}

.feed-tabs button:not(.active):hover,
.content-filter button:not(.active):hover,
.filter-chip:not(.active):hover {
    background: var(--app-soft);
    color: var(--app-ink);
}


/* =========================================================
   PESQUISA
   ========================================================= */

/* Caixa exterior da pesquisa */
.right-rail .search,
.search.wide {
    border: 1px solid var(--app-line);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

/* Estado quando a pesquisa está selecionada */
.search:focus-within {
    border-color: #171717;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .07);
}



/* =========================================================
   BOTÕES PRINCIPAIS
   ========================================================= */

.primary,
.publish-btn,
.submit-btn,
.auth-submit,
.black-btn {
    background: #111 !important;
    border-color: #111 !important;
    color: #fff !important;
    border-radius: 999px;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    animation: connecting-button-breathe 4.5s ease-in-out infinite;
}

.primary:hover,
.publish-btn:hover,
.submit-btn:hover,
.auth-submit:hover,
.black-btn:hover {
    background: #2b2b2b !important;
    border-color: #2b2b2b !important;
}

.primary:not(:disabled):hover,
.publish-btn:not(:disabled):hover,
.submit-btn:not(:disabled):hover,
.auth-submit:not(:disabled):hover,
.black-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .19);
}

.primary:not(:disabled):active,
.publish-btn:not(:disabled):active,
.submit-btn:not(:disabled):active,
.auth-submit:not(:disabled):active,
.black-btn:not(:disabled):active {
    transform: translateY(0) scale(.97);
}


/* =========================================================
   AÇÕES DOS POSTS
   ========================================================= */

.post-actions button,
.reaction-button,
.comment-action,
.action-button {
    border-radius: 10px;
}

.post-actions button:hover,
.reaction-button:hover,
.comment-action:hover,
.action-button:hover {
    background: var(--app-soft);
}


/* =========================================================
   COMENTÁRIOS
   ========================================================= */

.comment-form,
.comment-input-wrap {
    gap: 8px;
}

.comment-form input,
.comment-input-wrap input {
    background: var(--app-soft);
    border-color: transparent;
}

.comment-form input:focus,
.comment-input-wrap input:focus {
    background: #fff;
    border-color: #111;
}


/* =========================================================
   PERFIL / COMUNIDADE
   ========================================================= */

.profile-header,
.profile-content,
.profile-tabs,
.community-header {
    border-color: var(--app-line);
}

.profile-header {
    overflow: hidden;
}

.profile-tabs {
    background: rgba(255, 255, 255, .94);
}

.profile-tabs button {
    min-height: 54px;
}

.profile-tabs button:not(.active):hover {
    background: var(--app-soft);
}


/* =========================================================
   MODAIS
   ========================================================= */

dialog,
.modal-card {
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius-lg);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .25);
}

dialog::backdrop {
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(3px);
}

.modal-close,
.close-modal,
.dialog-close {
    border-radius: 999px;
}


/* =========================================================
   NOTIFICAÇÕES
   ========================================================= */

.toast,
.notification-toast {
    border-radius: 999px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, .2);
}

.loading,
.empty-state,
.empty-small {
    color: var(--app-muted);
}


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

.mobile-header {
    border-bottom-color: var(--app-line);
}

.mobile-nav {
    border-top-color: #222;
}

.mobile-nav button {
    border-radius: 12px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1180px) {

    .right-rail {
        display: none;
    }

    .feed-column {
        width: min(700px, calc(100% - 48px));
        margin-left: auto;
        margin-right: auto;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 720px) {

    body {
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    main {
        min-width: 0;
    }

    .standard-page {
        padding: 20px 12px calc(96px + env(safe-area-inset-bottom));
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-head .search.wide {
        width: 100%;
    }

    .feed-column {
        width: 100%;
        margin: 0;
    }

    .composer,
    .post-card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .composer {
        margin-top: 0;
    }

    .feed-tabs {
        display: flex !important;
        grid-template-columns: none !important;
        overflow-x: auto !important;
        overscroll-behavior-x: contain;
        gap: 8px !important;
        height: auto !important;
        padding: 10px 12px !important;
        white-space: nowrap;
    }

    .feed-tabs button {
        flex: 0 0 auto !important;
        min-width: max-content;
        height: 42px !important;
        padding: 0 16px !important;
    }

    .content-filter {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0 12px 10px;
        scrollbar-width: none;
    }

    .content-filter::-webkit-scrollbar {
        display: none;
    }

    .content-filter button {
        flex: 0 0 auto;
    }

    .profile-header,
    .community-header {
        border-radius: 0;
    }

    .profile-tabs {
        overflow-x: auto;
        justify-content: flex-start;
        padding-inline: 10px;
        scrollbar-width: none;
    }

    .profile-tabs::-webkit-scrollbar {
        display: none;
    }

    .profile-tabs button {
        flex: 0 0 auto;
        padding-inline: 14px;
    }

    dialog,
    .modal-card {
        width: min(100% - 20px, 620px);
        max-height: calc(100dvh - 20px);
        border-radius: 22px;
    }

    .mobile-header {
        padding-top: env(safe-area-inset-top);
    }

    .mobile-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}


/* =========================================================
   REDUZIR MOVIMENTO
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}