/* =============================================
   Telegram Deutschland - Verspieltes Design
   Telegram-Blue + Deutschland-Rot Akzente
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --tg-blue: #1e4c9a;
    --tg-blue-dark: #163a7a;
    --tg-blue-light: #eaf0fa;
    --tg-blue-hover: #2558b0;
    --accent-red: #be2028;
    --accent-red-dark: #a01a21;
    --accent-red-light: #fdf0f0;
    --accent-gold: #f0c800;
    --accent-gold-dark: #d4a900;
    --accent-pink: #be2028;
    --accent-green: #4caf50;
    --accent-purple: #6a1b9a;
    --bg-main: #f2f4f7;
    --bg-card: #ffffff;
    --text-dark: #1a2332;
    --text-muted: #6b7280;
    --border-light: #e5e9ef;
    --shadow-card: 0 4px 15px rgba(10, 61, 145, 0.08);
    --shadow-hover: 0 8px 25px rgba(10, 61, 145, 0.15);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    zoom: 1.1;
    background: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
}

/* ── Navbar ─────────────────────────────────── */
.navbar-tg {
    background: linear-gradient(135deg, var(--tg-blue), var(--tg-blue-dark));
    padding: 0.8rem 0;
    box-shadow: 0 4px 20px rgba(0, 136, 204, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar-tg .navbar-brand {
    color: #fff !important;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}
.navbar-tg .navbar-brand span { color: var(--accent-gold); }
.navbar-tg .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem !important;
    transition: all 0.2s;
}
.navbar-tg .nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.15);
}
.navbar-tg .nav-link.active { color: #fff !important; background: rgba(255,255,255,0.2); }
.navbar-toggler { border-color: rgba(255,255,255,0.3); }
.navbar-toggler-icon { filter: invert(1); }

/* ── Hero Section ──────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, var(--tg-blue) 0%, #005f8f 50%, var(--tg-blue-dark) 100%);
    color: #fff;
    padding: 4rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(221,0,0,0.12) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,204,0,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-section h1 {
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}
.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* ── Search Bar ────────────────────────────── */
.search-bar {
    max-width: 600px;
    margin: 1.5rem auto 0;
    position: relative;
    z-index: 1;
}
.search-bar .form-control {
    border: none;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding-right: 60px;
}
.search-bar .btn-search {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    border-radius: 50px;
    background: var(--accent-red);
    border: none;
    color: #fff;
    padding: 0 1.5rem;
    font-weight: 700;
    transition: background 0.2s;
}
.search-bar .btn-search:hover { background: var(--accent-red-dark); }

/* ── Cards ─────────────────────────────────── */
.card-tg {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}
.card-tg.h-100 { height: 100%; }
.card-tg:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.card-tg .card-img-top {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.card-tg .card-body { padding: 1.2rem; }
.card-tg .card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-tg .card-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-tg a { text-decoration: none; color: inherit; }
.card-tg a:hover { color: inherit; }

/* ── Badges ────────────────────────────────── */
.badge-group {
    background: linear-gradient(135deg, var(--tg-blue), var(--tg-blue-dark));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
}
.badge-channel {
    background: linear-gradient(135deg, var(--accent-purple), #7b1fa2);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
}
.badge-featured {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: #333;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}
.badge-members {
    background: var(--tg-blue-light);
    color: var(--tg-blue);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
}

/* ── Category Cards ────────────────────────── */
.cat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.cat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    color: var(--tg-blue);
}
.cat-card .cat-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.cat-card .cat-name { font-weight: 700; font-size: 0.9rem; }
.cat-card .cat-count { font-size: 0.75rem; color: var(--text-muted); }

/* ── Buttons ───────────────────────────────── */
.btn-tg {
    background: linear-gradient(135deg, var(--tg-blue), var(--tg-blue-dark));
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    font-weight: 700;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}
.btn-tg:hover { background: linear-gradient(135deg, var(--tg-blue-hover), var(--tg-blue-dark)); color: #fff; transform: translateY(-1px); }

.btn-like {
    background: #fff;
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-weight: 700;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-like:hover, .btn-like.liked {
    background: var(--accent-red);
    color: #fff;
}
.btn-like.liked { animation: likePopIn 0.3s ease; }

@keyframes likePopIn {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.btn-orange {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-red-dark));
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    font-weight: 700;
    transition: all 0.2s;
}
.btn-orange:hover { background: linear-gradient(135deg, var(--accent-red-dark), #990000); color: #fff; }

/* ── Section Headers ──────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.section-header h2 {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0;
}
.section-header a {
    color: var(--tg-blue);
    font-weight: 600;
    text-decoration: none;
}
.section-header a:hover { text-decoration: underline; }

/* ── Stats bar on cards ────────────────────── */
.card-stats {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.card-stats .stat-item { display: flex; align-items: center; gap: 0.2rem; }

/* ── Filters ───────────────────────────────── */
.filter-bar {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}
.filter-bar select, .filter-bar .form-select {
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-light);
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ── Pagination ────────────────────────────── */
.pagination .page-link {
    border: none;
    border-radius: var(--radius-sm) !important;
    margin: 0 3px;
    color: var(--tg-blue);
    font-weight: 600;
    transition: all 0.2s;
}
.pagination .page-item.active .page-link {
    background: var(--tg-blue);
    color: #fff;
}
.pagination .page-link:hover {
    background: var(--tg-blue-light);
    color: var(--tg-blue);
}

/* ── Flash Messages ────────────────────────── */
.flash-message {
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ── Group Detail Page ─────────────────────── */
.group-detail-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}
.group-detail-header img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--tg-blue-light);
}
.group-detail-header h1 { font-weight: 800; font-size: 1.8rem; }

/* ── Footer ────────────────────────────────── */
.footer-tg {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: rgba(255,255,255,0.7);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}
.footer-tg h5 { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.footer-tg a { color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.2s; }
.footer-tg a:hover { color: var(--accent-gold); }
.footer-tg .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    margin-top: 2rem;
    font-size: 0.85rem;
}

/* ── Admin ─────────────────────────────────── */
.admin-sidebar { background: var(--bg-card); border-radius: var(--radius-md); padding: 1rem; box-shadow: var(--shadow-card); }
.admin-sidebar .nav-link { color: var(--text-dark); border-radius: var(--radius-sm); padding: 0.5rem 1rem; font-weight: 600; }
.admin-sidebar .nav-link:hover { background: var(--tg-blue-light); color: var(--tg-blue); }
.admin-sidebar .nav-link.active { background: var(--tg-blue); color: #fff; }

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.stat-card .stat-number { font-size: 2rem; font-weight: 800; color: var(--tg-blue); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }

/* ── Forms ─────────────────────────────────── */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-light);
    padding: 0.7rem 1rem;
    transition: border-color 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--tg-blue);
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.15);
}
.form-label { font-weight: 700; color: var(--text-dark); }

/* ── Compact spacing (scoped) ──────────────── */
section.py-5 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
.section-header { margin-bottom: 1rem; }
.section-header p { margin-bottom: 0; font-size: 0.9rem; }
.card.card-tg.p-3 { padding: 0.75rem !important; }
.card.card-tg.p-4 { padding: 1rem !important; }

/* ── Misc ──────────────────────────────────── */
.ext-link {
    color: var(--tg-blue);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}
.ext-link:hover { text-decoration-style: solid; }

.text-tg { color: var(--tg-blue) !important; }
.bg-tg { background-color: var(--tg-blue) !important; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
    .hero-section h1 { font-size: 1.8rem; }
    .hero-section { padding: 2.5rem 0 2rem; }
    .card-tg .card-img-top { height: 140px; }
    .filter-bar { flex-direction: column; }
    .section-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
}
