/* Coret frontend polish layer
   Mantem base.css como fundacao e aplica melhorias visuais progressivas. */

:root {
    --coret-card-bg: linear-gradient(180deg, rgba(18, 25, 32, 0.98), rgba(11, 16, 22, 0.96));
    --coret-glass-bg: rgba(12, 18, 24, 0.92);
    --coret-soft-line: rgba(91, 107, 255, 0.12);
    --coret-danger-soft: rgba(255, 122, 138, 0.12);
}

.app-shell {
    min-height: 100vh;
}

.brand-shell,
.shell-card,
.right-panel-card,
.page-card,
.post-card,
.auth-card,
.landing-panel,
.empty-state,
.toast-card,
.inventory-card,
.chat-card,
.profile-card,
.notification-card {
    background: var(--coret-card-bg);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.post-card {
    position: relative;
    gap: 14px;
    border-color: rgba(210, 225, 236, 0.16);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.post-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(91, 107, 255, 0.06), transparent 34%, rgba(34, 48, 62, 0.18));
    opacity: 0.72;
}

.post-card > * {
    position: relative;
    z-index: 1;
}

.post-card:hover {
    border-color: rgba(91, 107, 255, 0.28);
}

.post-author {
    min-width: 0;
}

.post-author span {
    min-width: 0;
}

.post-author strong,
.post-author small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-text {
    letter-spacing: 0.005em;
}

.post-edited-label {
    width: max-content;
    max-width: 100%;
    padding: 4px 8px;
    border: 1px solid rgba(210, 225, 236, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
}

.post-media,
.post-audio-box,
.post-poll,
.link-preview {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.post-media {
    border: 1px solid rgba(210, 225, 236, 0.08);
}

.post-audio-box {
    background: linear-gradient(90deg, rgba(91, 107, 255, 0.08), rgba(255, 255, 255, 0.035));
}

.post-audio-box > .material-symbols-outlined {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    color: #ffffff;
    background: var(--coret-accent);
}

.post-actions {
    align-items: center;
    padding-top: 4px;
    border-top: 1px solid rgba(210, 225, 236, 0.08);
}

.post-action {
    color: var(--coret-muted);
    background: transparent;
    border-color: transparent;
}

.post-action:hover {
    color: var(--coret-text);
    border-color: rgba(91, 107, 255, 0.18);
    background: rgba(91, 107, 255, 0.08);
}

.post-action.is-active,
.post-menu-item.is-active {
    color: #ffffff;
    border-color: transparent;
    background: var(--coret-accent);
}

.post-menu-list {
    min-width: 220px;
    padding: 10px;
    background: var(--coret-glass-bg);
    border-color: rgba(210, 225, 236, 0.18);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(16px);
}

.post-menu-item {
    min-height: 40px;
}

.post-report-popup {
    position: fixed;
    inset: 0;
    z-index: 6800;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(1, 3, 6, 0.62);
    backdrop-filter: blur(8px);
}

.post-report-popup[hidden] {
    display: none;
}

.post-report-form {
    width: min(460px, 100%);
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(210, 225, 236, 0.18);
    border-radius: var(--radius-panel);
    background: linear-gradient(180deg, rgba(18, 25, 32, 0.98), rgba(8, 12, 17, 0.98));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

.post-report-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.post-report-help {
    margin: 0;
    color: var(--coret-muted);
    font-size: 0.92rem;
}

.post-report-reason-list {
    display: grid;
    gap: 8px;
}

.post-report-reason-list label {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(210, 225, 236, 0.12);
    border-radius: var(--radius);
    color: var(--coret-text);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.post-report-reason-list label:hover {
    border-color: rgba(91, 107, 255, 0.24);
    background: rgba(91, 107, 255, 0.07);
}

.post-report-reason-list input {
    width: 18px;
    height: 18px;
    margin: 0 10px 0 0;
    accent-color: var(--coret-danger);
}

.post-report-note {
    min-height: 86px;
}

.button.danger,
.button-danger,
.post-menu-item.danger:hover {
    color: #260006;
    background: var(--coret-danger);
}

.post-poll {
    background: linear-gradient(180deg, rgba(91, 107, 255, 0.055), rgba(255, 255, 255, 0.032));
}

.post-poll > strong {
    font-size: 1rem;
}

.poll-option {
    text-align: left;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.poll-option:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(91, 107, 255, 0.32);
}

.poll-option.is-active {
    border-color: rgba(91, 107, 255, 0.55);
    background: rgba(91, 107, 255, 0.1);
}

.composer-card {
    position: relative;
    overflow: visible;
    background: linear-gradient(180deg, rgba(20, 28, 36, 0.98), rgba(12, 17, 23, 0.96));
}

.composer-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at 95% 0%, rgba(91, 107, 255, 0.08), transparent 36%);
}

.composer-card > * {
    position: relative;
    z-index: 1;
}

.composer-tools {
    flex-wrap: wrap;
}

.composer-more-panel {
    border-color: rgba(210, 225, 236, 0.18);
}

.store-main-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.store-product-card,
.inventory-card {
    border-color: rgba(210, 225, 236, 0.16);
}

.inventory-card {
    background: linear-gradient(180deg, rgba(18, 25, 32, 0.96), rgba(10, 15, 20, 0.94));
}

.item-preview {
    border: 1px solid rgba(210, 225, 236, 0.12);
    background: radial-gradient(circle at 50% 0%, rgba(91, 107, 255, 0.12), rgba(255, 255, 255, 0.035));
}

.right-panel-card,
.shell-card {
    backdrop-filter: blur(10px);
}

.nav-item {
    position: relative;
}

.nav-item::before {
    content: "";
    position: absolute;
    left: 6px;
    width: 3px;
    height: 0;
    border-radius: 999px;
    background: var(--coret-accent);
    transition: height 160ms ease;
}

.nav-item:hover::before {
    height: 22px;
}

.bottom-nav {
    box-shadow: 0 -14px 46px rgba(0, 0, 0, 0.42);
}

@media (max-width: 767px) {
    .post-card {
        border-inline: 0;
        border-radius: 0;
        margin-inline: -10px;
    }

    .post-actions {
        grid-template-columns: repeat(3, minmax(44px, auto));
        justify-content: space-between;
    }

    .post-action-desktop {
        display: none;
    }

    .post-action-mobile {
        display: grid;
    }

    .post-menu-list-bottom {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(76px + env(safe-area-inset-bottom));
        top: auto;
        width: auto;
        min-width: 0;
        max-height: 60vh;
        overflow: auto;
    }

    .composer-tools {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: stretch;
    }

    .composer-more {
        grid-column: 1 / -1;
    }

    .composer-more-panel {
        position: static;
        width: 100%;
        margin-top: 10px;
    }

    .post-report-popup {
        align-items: end;
        padding: 0;
    }

    .post-report-form {
        width: 100%;
        border-radius: 18px 18px 0 0;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    }

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

    .store-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .store-card__content {
        padding: 1em;
    }
}

@media (max-width: 420px) {
    .store-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .post-audio-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .post-audio-box > .material-symbols-outlined {
        width: 32px;
        height: 32px;
    }
}
