:root {
    --primary: #229ED9; /* Telegram blue */
    --primary-dark: #1C8BBF;
    --bg-color: #f4f9fc;
    --text-main: #334155;
}
body { margin: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: var(--bg-color); color: var(--text-main); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* Header */
.main-header { background: var(--primary); padding: 15px 0; color: white; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.header-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.logo { margin: 0; font-size: 22px; cursor: pointer; white-space: nowrap; }

.header-actions { display: flex; align-items: center; gap: 15px; flex-grow: 1; justify-content: flex-end; }

.search-bar { display: flex; width: 100%; max-width: 400px; }
.search-bar input { flex: 1; padding: 8px 12px; border: none; border-radius: 4px 0 0 4px; outline: none; font-size: 14px; }
.search-bar button { padding: 8px 15px; background: var(--primary-dark); color: white; border: none; border-radius: 0 4px 4px 0; cursor: pointer; font-weight: bold; }

/* Add Group App Install Button */
.add-group-btn {
    background-color: #f59e0b; /* Attention-grabbing Amber color */
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: transform 0.2s, background-color 0.2s;
    white-space: nowrap;
}
.add-group-btn:hover { background-color: #d97706; transform: translateY(-2px); }

/* Mobile Responsiveness for the new Header */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    .search-bar { max-width: 100%; }
    .add-group-btn { width: 100%; padding: 12px; font-size: 16px; }
}

/* Ad Container */
.ad-container { margin: 20px auto; text-align: center; background: #e2e8f0; min-height: 90px; display: flex; align-items: center; justify-content: center; border-radius: 8px;}

/* Detail Page Redesign */
.detail-box { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-top: 20px; }

.detail-header { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; border-bottom: 1px solid #e2e8f0; padding-bottom: 20px; }
.detail-icon-placeholder { width: 80px; height: 80px; border-radius: 12px; background: var(--primary); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 36px; flex-shrink: 0; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.detail-icon-img { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; flex-shrink: 0; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.detail-header-text h1 { margin: 0 0 8px 0; color: var(--text-main); font-size: 26px; line-height: 1.2;}
.detail-date { color: #64748b; font-size: 14px; font-weight: 500;}

.detail-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat-item { display: flex; align-items: center; gap: 12px; background: #f8fafc; padding: 12px 15px; border-radius: 8px; border: 1px solid #e2e8f0; cursor: pointer; transition: background 0.2s;}
.stat-item:hover { background: #f1f5f9; }
.stat-icon { font-size: 24px; }
.stat-item div { display: flex; flex-direction: column; overflow: hidden;}
.stat-item small { color: #64748b; font-size: 12px; }
.stat-item strong { color: var(--primary-dark); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}

.detail-description { background: #f8fafc; padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0; margin-bottom: 20px; }
.detail-description h3 { margin-top: 0; margin-bottom: 10px; color: var(--primary-dark); font-size: 18px; }
.detail-description p { margin: 0; font-size: 16px; line-height: 1.6; color: #475569; white-space: pre-wrap; }

.detail-action-buttons { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 20px;}
.join-huge-btn { flex: 1; text-align: center; border: none; padding: 16px 20px; border-radius: 8px; font-size: 18px; font-weight: bold; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.join-huge-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-join-now { background: var(--primary); color: white; }
.btn-copy-link { background: #e2e8f0; color: #334155; }

/* Related Groups Section */
.related-section { margin-top: 40px; }
.related-section h2 { color: var(--text-main); font-size: 22px; margin-bottom: 15px; border-left: 4px solid var(--primary); padding-left: 10px; }

@media (max-width: 600px) {
    .detail-action-buttons { flex-direction: column; }
    .detail-header { flex-direction: column; align-items: flex-start; gap: 15px;}
}

/* Footer */
.main-footer { background: #1e293b; color: white; padding: 40px 0 20px 0; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.footer-col h3 { color: #cbd5e1; border-bottom: 1px solid #334155; padding-bottom: 10px; margin-bottom: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-links span { background: #334155; padding: 5px 10px; border-radius: 4px; font-size: 13px; cursor: pointer; transition: 0.2s;}
.footer-links span:hover { background: var(--primary); }
.footer-bottom { text-align: center; margin-top: 30px; color: #64748b; font-size: 14px; border-top: 1px solid #334155; padding-top: 20px;}


/* Container forces mobile browsers to calculate the height and pushes the footer down */
/* Container forces mobile browsers to calculate the height and pushes the footer down */
.load-more-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0 40px 0;
    clear: both;
}

.load-more-btn {
    display: inline-block;
    padding: 14px 40px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: background 0.3s, transform 0.2s;
    text-align: center;
}

.load-more-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* New Footer Show More Toggle styling */
.footer-show-more {
    color: #38bdf8; /* Light blue that looks good on dark backgrounds */
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
    padding: 5px 0;
    transition: color 0.2s;
}

.footer-show-more:hover {
    color: white;
    text-decoration: underline;
}