/* Responsive Styles for Community Feed */

/* Estado compacto da sidebar */
#cf-sidebar.compact {
    width: 43px !important;
    transition: width 0.3s ease;
}

#cf-sidebar.compact .cf-sidebar-header h3 {
    display: none;
}

#cf-sidebar.compact .cf-categories {
    display: none;
}

#cf-sidebar.compact .cf-collapse-btn {
    margin-left: -18px;
    margin-right: 8px;
}

#cf-sidebar.compact .cf-collapse-btn svg {
    transform: rotate(180deg);
}

/* Botão de colapso */
.cf-collapse-btn {
    background: none;
    border: none;
    color: var(--cf-text-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    transform: rotate(180deg);
    margin-right: -10px;
}

.cf-collapse-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Tablets e telas médias */
@media screen and (max-width: 1200px) {
    .cf-discord-layout {
        grid-template-columns: var(--cf-sidebar-width) 1fr;
    }

    .cf-chat-widget {
        position: fixed;
        right: -var(--cf-chat-width);
        top: 0;
        bottom: 0;
        width: var(--cf-chat-width);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .cf-chat-widget.active {
        transform: translateX(-100%);
    }

    /* Botão de chat para mobile */
    .cf-chat-toggle {
        display: block;
        position: fixed;
        right: 20px;
        bottom: 20px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--cf-primary-color);
        color: var(--cf-text-color);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--cf-shadow);
        z-index: 1001;
        cursor: pointer;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    :root {
        --cf-sidebar-width: 43px;
        --cf-chat-width: 100%;
    }
    
    #cf-sidebar.compact .cf-collapse-btn {
            margin-left: -18px;

    }
    
    .cf-discord-layout {
        grid-template-columns: var(--cf-sidebar-width) 1fr;
        height: auto;
        min-height: 100vh;
    }

    #cf-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        transition: width 0.3s ease;
        z-index: 10;
        background: var(--cf-background);
    }

    #cf-sidebar:not(.compact) {
        width: 280px;
                overflow-y: auto;

    }

    #cf-sidebar.compact {
        width: 43px;
    }

    /* Ajustes no header */
    .cf-sidebar-header {
        height: var(--cf-header-height);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Botão de colapso sempre visível no mobile */
    .cf-collapse-btn {
        display: block !important;
    }

    /* Ajustes nos posts */
    article.post-community_post {
        margin: 10px;
        border-radius: var(--cf-border-radius);
    }

    .entry-header {
        flex-direction: column;
    }

    .entry-meta {
        margin-top: 10px;
    }

    /* Chat em tela cheia no mobile */
    .cf-chat-widget {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        transform: translateX(100%);
    }

    .cf-chat-widget.active {
        transform: translateX(0);
    }

    /* Formulários e inputs */
    .cf-message-composer {
        padding: 10px;
    }

    textarea {
        font-size: 16px; /* Evita zoom em iOS */
    }

    /* Melhorias de touch */
    .cf-channel-item,
    .cf-category-title {
        padding: 12px 15px;
        min-height: 44px; /* Mínimo para touch targets */
    }
}

/* Small phones */
@media screen and (max-width: 480px) {
    .entry-title {
        font-size: 1.1rem;
    }

    .entry-content {
        font-size: 0.95rem;
    }

    .cf-message-composer {
        flex-direction: column;
        gap: 10px;
    }
}

/* Landscape mode fixes */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .cf-discord-layout {
        height: auto;
        min-height: 100vh;
    }

    #cf-sidebar,
    .cf-chat-widget {
        position: absolute;
    }
}