/* ===================================
   COMMUNITIES PAGE STYLES
   =================================== */

/* Mobile Styles (Default) */
.community-content {
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 100px;
}

.communities-container {
    max-width: 480px;
    margin: 0 auto;
}

.communities-title {
    font-family: 'Lilita One', cursive;
    font-size: 32px;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    margin-top: 20px;
}

/* Community List */
.community-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.community-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.community-item:hover {
    background: #f9fafb;
    border-color: #3b82f6;
}

.community-item-number {
    font-size: 18px;
    font-weight: bold;
    color: #6b7280;
    margin-right: 12px;
    min-width: 30px;
}

.community-item-name {
    flex: 1;
    font-size: 16px;
    color: #1f2937;
    font-weight: 500;
    transition: color 0.3s ease;
}

.community-item-name:hover {
    color: #3b82f6;
}

.community-share-btn {
    transition: transform 0.3s ease;
}

.community-share-btn:hover {
    transform: scale(1.1);
}

.community-arrow {
    font-size: 20px;
    color: #9ca3af;
    transition: transform 0.3s ease;
}

.community-item:hover .community-arrow {
    transform: translateX(4px);
    color: #3b82f6;
}

/* Guest Message Box */
.guest-message-box {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    margin: 40px 0;
}

.guest-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.guest-message-box h2 {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 12px;
    font-weight: 600;
}

.guest-message-box p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
}

.btn-login-guest {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-login-guest:hover {
    background: #2563eb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 12px;
    font-weight: 500;
}

/* Action Buttons */
.join-with-code-btn,
.create-group-btn {
    display: block;
    max-width: 480px;
    margin: 0 auto 16px auto;
    padding: 16px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.join-with-code-btn {
    background: #3b82f6;
    color: white;
    border: none;
}

.join-with-code-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.create-group-btn {
    background: white;
    color: #3b82f6;
}

.create-group-btn:hover {
    background: #eff6ff;
    transform: translateY(-2px);
}

/* ===================================
   DESKTOP STYLES
   =================================== */
@media (min-width: 769px) {
    /* Page Container */
    .community-content {
        padding-top: 260px;
        padding-bottom: 180px;
        min-height: calc(100vh - 200px);
    }

    .communities-container {
        max-width: 1200px;
        padding: 0 40px;
    }

    .communities-title {
        font-size: 42px;
        margin-bottom: 50px;
    }

    /* Desktop Grid Layout */
    .communities-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
        margin-bottom: 50px;
    }

    .community-card {
        background: white;
        border: 2px solid #e5e7eb;
        border-radius: 16px;
        padding: 24px;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .community-card:hover {
        border-color: #3b82f6;
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    }

    .community-card-image {
        width: 64px;
        height: 64px;
        object-fit: cover;
        border-radius: 12px;
    }

    .community-card-name {
        font-size: 20px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 8px;
    }

    .community-card-description {
        font-size: 14px;
        color: #6b7280;
        margin-bottom: 16px;
        line-height: 1.5;
    }

    .community-card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 16px;
        border-top: 1px solid #e5e7eb;
    }

    .community-card-members {
        font-size: 14px;
        color: #9ca3af;
    }

    .community-card-view-btn {
        background: #3b82f6;
        color: white;
        padding: 8px 20px;
        border-radius: 8px;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        transition: background 0.3s ease;
    }

    .community-card-view-btn:hover {
        background: #2563eb;
    }

    /* Desktop Action Buttons */
    .join-with-code-btn,
    .create-group-btn {
        display: inline-block;
        max-width: none;
        width: auto;
        margin: 0 10px;
        padding: 14px 40px;
    }

    /* Guest Message - Desktop */
    .guest-message-box {
        max-width: 600px;
        margin: 60px auto;
        padding: 60px 40px;
    }

    /* Empty State - Desktop */
    .empty-state {
        padding: 100px 20px;
    }

    .empty-state-icon {
        font-size: 120px;
    }

    /* ===================================
       HEADER & FOOTER STYLING (DESKTOP)
       =================================== */
    
    /* Header */
    body.page-template-page-communities .site-header-wave {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 120px;
        z-index: 998;
        background: transparent;
    }

    body.page-template-page-communities .header-bg-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 120px;
        z-index: 1;
    }

    body.page-template-page-communities .header-bg-image {
        width: 100%;
        height: 100%;
        object-fit: fill;
    }

    body.page-template-page-communities .header-content-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 120px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 60px;
        z-index: 2;
    }

    body.page-template-page-communities .site-title a {
        font-family: 'Lilita One', cursive;
        font-size: 32px;
        color: #FFFFFF;
        text-decoration: none;
        font-weight: bold;
    }

    body.page-template-page-communities .desktop-nav-menu {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 14px;
        align-items: center;
    }

    body.page-template-page-communities .desktop-nav-menu li a {
        color: #FFFFFF;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        padding: 8px 16px;
        border-radius: 8px;
        transition: background 0.3s ease;
    }

    body.page-template-page-communities .desktop-nav-menu li a:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* Footer */
    body.page-template-page-communities .desktop-footer-content {
        display: block !important;
        position: fixed;
        bottom: 30px;
        right: 60px;
        color: #FFFFFF;
        font-size: 14px;
        z-index: 999;
        text-align: right;
        line-height: 1.8;
    }

    body.page-template-page-communities .desktop-footer-content strong {
        display: block;
        font-size: 16px;
        margin-bottom: 8px;
        font-weight: 600;
    }

    body.page-template-page-communities .desktop-footer-content a {
        color: #FFFFFF;
        text-decoration: none;
        transition: opacity 0.3s ease;
    }

    body.page-template-page-communities .desktop-footer-content a:hover {
        opacity: 0.8;
    }

    body.page-template-page-communities .desktop-footer-left {
        display: block !important;
        position: fixed;
        bottom: 30px;
        left: 60px;
        color: #FFFFFF;
        font-size: 14px;
        z-index: 999;
        line-height: 1.8;
    }

    body.page-template-page-communities .desktop-footer-left .footer-brand {
        font-family: 'Lilita One', cursive;
        font-size: 24px;
        font-weight: bold;
        display: block;
        margin-bottom: 12px;
    }

    body.page-template-page-communities .desktop-footer-left a {
        color: #FFFFFF;
        text-decoration: none;
        margin-right: 12px;
        transition: opacity 0.3s ease;
    }

    body.page-template-page-communities .desktop-footer-left a:hover {
        opacity: 0.8;
    }

    /* Hide mobile nav pseudo-element */
    body.page-template-page-communities .mobile-nav-container:after {
        content: none;
    }

    /* Hide mobile elements on desktop */
    body.page-template-page-communities .mobile-nav-container {
        display: none;
    }
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   =================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .communities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .communities-title {
        font-size: 28px;
    }

    .community-item {
        padding: 14px 16px;
    }

    .community-item-name {
        font-size: 15px;
    }

    .guest-message-box {
        padding: 30px 16px;
    }

    .join-with-code-btn,
    .create-group-btn {
        padding: 14px;
        font-size: 15px;
    }
}

.communities-main-list{
     background: #fff;
    border-radius: 14px;
    padding: 28px 20px 20px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    height: fit-content;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Communities Grid Layout */
.communities-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 32px;
    align-items: center;
    margin-bottom: 32px;
}
.grid-featured {
    grid-column: 1;
}
.grid-list {
    grid-column: 2;
}
.grid-actions {
    grid-column: 3;
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
    padding-top: 40px;
}
.featured-groups-container {
    min-width: 220px;
    max-width: 340px;
    background: #fff;
    border-radius: 14px;
    padding: 28px 20px 20px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    height: fit-content;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.featured-groups-title {
    font-family: 'Lilita One', cursive;
    font-size: 32px;
    color: #00A99D;
    text-align: center;
    margin-bottom: 30px;
    margin-top: 20px;
}

.featured-groups-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.featured-group-item {
    display: flex;
    align-items: center;
    gap: 14px;
}
.featured-group-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #1f2937;
    font-weight: 600;
    font-size: 16px;
}
.featured-group-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    border: 2px solid #00A99D;
}
.featured-group-name {
    font-size: 16px;
    font-weight: 600;
}
.no-featured-groups {
    color: #888;
    font-size: 15px;
    text-align: center;
    margin-top: 18px;
}
/* Responsive: stack on mobile */
@media (max-width: 1100px) {
    .communities-grid {
        grid-template-columns: 1fr 2fr;
    }
    .grid-actions {
        grid-column: 1 / span 2;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding-top: 0;
        gap: 24px;
        margin-top: 24px;
    }
}
@media (max-width: 900px) {
    .communities-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    .featured-groups-container {
        max-width: 100%;
        min-width: 0;
        margin-bottom: 18px;
        box-shadow: none;
        padding: 18px 10px 10px 10px;
    }
    .grid-actions {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 24px;
        margin-top: 18px;
        padding-top: 0;
    }
}