/* Code Ora - Community Social Media Layout */

.community-body {
    background-color: var(--bg-color); /* Inherits from root style.css */
    margin: 0;
    padding: 0;
}

/* Icon-based Native Navbar */
.community-nav {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* very soft shadow like social apps */
}

.community-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0 20px;
}

.community-icon-links {
    display: flex;
    gap: 15px;
    flex: 1;
    justify-content: center;
}

.nav-icon {
    position: relative;
    color: var(--text-muted);
    font-size: 22px;
    padding: 10px 25px;
    border-radius: 10px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon:hover {
    background-color: var(--bg-color);
    color: var(--text-main);
}

.nav-icon.active {
    color: var(--primary-color);
}

.nav-icon.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 60%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.nav-icon .badge {
    position: absolute;
    top: 2px;
    right: 15px;
    background-color: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
}

.community-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Main Content Padding to prevent underlap */
.community-main {
    min-height: calc(100vh - 60px);
    padding-bottom: 20px;
}

/* Grid Layout */
.community-grid {
    display: grid;
    grid-template-columns: 280px minmax(auto, 600px) 280px; /* Center content restricted */
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    padding: 0 15px;
}

/* Base Cards */
.post-card, .create-post-card, .about-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.create-post-card textarea {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    resize: none;
    color: var(--text-main);
}
.create-post-card textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Reset specific overrides from main style.css if they exist */
.community-main .container {
    max-width: 1200px;
    padding: 0;
}

/* Mobile PWA Styling */
@media (max-width: 992px) {
    /* Global Mobile Rules */
    * {
        box-sizing: border-box;
    }

    img, video, iframe {
        max-width: 100%;
        height: auto;
    }

    /* Hide Sidebars */
    .community-sidebar {
        display: none !important;
    }
    
    /* Community Home Layout constraints */
    .community-main .container {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        box-sizing: border-box;
    }

    .community-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        margin-top: 5px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .feed-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }

    /* Navbar snaps to the bottom like real mobile apps */
    .community-nav {
        position: fixed; /* Must be fixed */
        top: auto;
        bottom: 0;
        width: 100%;
        background-color: var(--surface-color);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05); /* Shadow up */
        border-top: 1px solid var(--border-color);
        border-bottom: none;
        z-index: 1000;
    }

    .community-nav-content {
        padding: 0 5px;
    }

    /* Hide the brand and back buttons on mobile for pure icon navigation */
    .community-brand, .community-actions .back-to-main {
        display: none;
    }

    .community-icon-links {
        justify-content: space-around;
        width: 100%;
        gap: 0;
    }

    .nav-icon {
        padding: 15px 0;
        flex: 1;
        font-size: 24px;
    }

    .nav-icon.active::after {
        bottom: auto;
        top: -1px; /* Top indicator on mobile nav */
        border-radius: 0 0 3px 3px;
        width: 50%;
    }

    /* Prevent content from hiding behind the fixed bottom nav */
    .community-main {
        padding-bottom: 70px; /* Safe spacing */
    }

    /* Tidy cards to full width like FB */
    .post-card, .create-post-card, .about-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin: 0; /* Clear margins because gap is handling spacing */
        width: 100%; /* Full width */
        box-sizing: border-box;
    }

    .post-body {
        padding: 12px 15px; /* Proper padding */
        overflow: hidden; /* No overflow */
    }
}
