/* ===== CSS VARIABLES - DARK DEFAULT ===== */
:root {
    /* Base Colors */
    --color-white: #ffffff;
    --color-black: #000000;
    --color-accent: #33cc33;

    /* Dark Mode (default) */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --border-color: #222222;

    /* Header (dark) */
    --header-bg: #000000;
    --header-text: #ffffff;
    --header-icon-color: #ffffff;
    --header-icon-border: rgba(255, 255, 255, 0.3);
    --header-icon-hover-bg: rgba(255, 255, 255, 0.1);
    --header-sep: rgba(255, 255, 255, 0.2);

    --chat-message-own: #0d1f0d;
    --chat-message-other: #0a0a0a;
    --modal-overlay: rgba(0, 0, 0, 0.8);

    /* Article theme */
    --primary: #2f8f2f;
    --secondary: #1f6f1f;
    --card-bg: #0a0a0a;
    --avatar-size: 48px;
    /* default avatar size */

    color-scheme: dark;
}

html {
    background-color: #000;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Add brighter, colorful diffuse spots in lower area */
[data-theme="dark"] body {
    background:
        radial-gradient(440px 260px at 10% 115%, rgba(90, 227, 139, 0.20), transparent 60%),
        radial-gradient(440px 260px at 90% 120%, rgba(54, 194, 255, 0.20), transparent 60%),
        radial-gradient(360px 220px at 50% 130%, rgba(255, 128, 191, 0.16), transparent 60%),
        radial-gradient(560px 260px at -10% 98%, rgba(255, 217, 90, 0.14), transparent 60%),
        var(--bg-primary);
    background-attachment: fixed, fixed, fixed, fixed, fixed;
    background-repeat: no-repeat;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: 15px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 4px solid var(--color-accent);
}

.modal-content h2 {
    color: var(--color-accent);
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.8em;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    text-align: center;
}

/* Auth Modal Specific */
.auth-modal .auth-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Auth Buttons */
.auth-btn {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
}

/* ===== MAINTENANCE BANNER ===== */
.maintenance-banner {
    background: linear-gradient(90deg, #d32f2f, #f44336);
    color: white;
    text-align: center;
    padding: 12px 0;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(0.75em, 2vw, 0.9em);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1001;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.maintenance-banner .container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.auth-btn.btn-loading {
    pointer-events: none;
    opacity: 0.8;
    position: relative;
    color: transparent !important;
}

.auth-btn.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: calc(50% - 10px);
    left: calc(50% - 10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: auth-spin 0.8s linear infinite;
}

/* Spinner animation */
@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-btn-secondary.btn-loading::after {
    border-top-color: var(--color-accent);
}

.auth-btn svg {
    flex-shrink: 0;
}

.auth-btn span {
    flex: 1;
    text-align: left;
}

.auth-btn small {
    position: absolute;
    bottom: 4px;
    right: 12px;
    font-size: 0.75em;
    opacity: 0.7;
    font-weight: 400;
}

/* Primary Button (Passkey) */
.auth-btn-primary {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.auth-btn-primary:hover {
    background: #2eb82e;
    border-color: #2eb82e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 204, 51, 0.3);
}

/* Google Button */
.auth-btn-google {
    background: white;
    color: #333;
    border-color: #ddd;
}

.auth-btn-google:hover {
    background: #f8f8f8;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Secondary Button */
.auth-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.auth-btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--color-accent);
}

/* Auth Divider */
.auth-divider {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin: 10px 0;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

/* Magic Link Section */
.magic-link-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.magic-link-section input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.magic-link-section input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Auth Switch */
.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.auth-switch a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Legacy styles (can be removed later) */
.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.switch-form {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

.switch-form a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

.switch-form a:hover {
    text-decoration: underline;
}


/* ===== HEADER - MINIMALISTIC ===== */
header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: hidden;
    /* for background effects */
}

.header-top {
    position: relative;
    display: flex;
    justify-content: center;
    /* center logo */
    align-items: center;
    padding: 20px 0 16px;
    gap: 12px;
}

/* Ensure header content sits above decorative layer */
header .container {
    position: relative;
    z-index: 1;
}

/* Dark mode: blurred, diffuse bubbles in header background */
[data-theme="dark"] header::before {
    content: "";
    position: absolute;
    inset: 0;
    /* cover full header area */
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(420px 220px at 10% 10%, rgba(56, 189, 248, 0.30), transparent 60%),
        radial-gradient(420px 220px at 90% 20%, rgba(90, 227, 139, 0.30), transparent 60%),
        radial-gradient(360px 200px at 20% 100%, rgba(255, 196, 46, 0.25), transparent 60%),
        radial-gradient(320px 180px at 85% 90%, rgba(236, 72, 153, 0.20), transparent 60%);
    filter: blur(18px) saturate(120%);
    transform: translateZ(0);
    /* hint for perf */
}

/* Subtle animated shimmer behind transparent logo */
header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(1200px 200px at 50% -20%, rgba(255, 255, 255, 0.06), transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
    0% {
        opacity: 0.2;
        transform: translateX(-5%) translateZ(0);
    }

    50% {
        opacity: 0.4;
        transform: translateX(0%) translateZ(0);
    }

    100% {
        opacity: 0.2;
        transform: translateX(5%) translateZ(0);
    }
}

.logo {
    display: none;
}

.site-logo {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    z-index: 1;
    width: 100%;
}

.site-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(32px, 8vw, 64px);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin: 0;
    text-decoration: none;
    background: linear-gradient(135deg, #fceabb 0%, #fccd4d 50%, #f8b500 51%, #fbdf93 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
    position: relative;
    display: inline-block;
    animation: logoFloat 6s ease-in-out infinite, logoShine 10s linear infinite;
    background-size: 200% auto;
}

/* Green leaf accent color variant or highlight if needed */
.site-title::first-letter {
    background: linear-gradient(135deg, #96e072 0%, #38ef7d 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-3px) rotate(0.5deg);
    }
}

@keyframes logoShine {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.site-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.8;
}

@keyframes titleShift {
    0% {
        background-position: 0% 50%
    }

    50% {
        background-position: 100% 50%
    }

    100% {
        background-position: 0% 50%
    }
}

.site-subtitle {
    color: var(--header-text);
    font-size: 0.95em;
    opacity: 0.85;
}

/* Dark mode: stronger header text glow for contrast */
[data-theme="dark"] .tagline {
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.header-actions {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

/* Round layout toggle button */
#layoutToggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    line-height: 1;
    font-size: 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

#layoutToggle:hover {
    border-color: var(--color-accent);
}

/* Removed theme toggle .icon-btn styles as dark-only mode */

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    padding: 8px 15px;
    border-radius: 25px;
    border: 2px solid var(--border-color);
}

#userEmblem {
    border-radius: 50%;
    border: 2px solid var(--color-accent);
}

/* header avatar image alternative */
#userEmblemImg {
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.user-info span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Truncate long usernames in header for clean layout */
#username {
    max-width: 160px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.logout-btn {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: var(--color-accent);
}

/* ===== AVATAR (global) ===== */
.avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    display: inline-block;
    flex-shrink: 0;
}

/* For image avatars */
img.avatar {
    object-fit: cover;
}

/* For canvas avatars */
canvas.avatar {
    display: block;
}

/* Reusable back button (user dashboard, etc.) */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.back-btn:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

.back-btn i {
    width: 18px;
    height: 18px;
}

/* Small inline save indicator */
.save-indicator {
    display: none;
    /* hidden by default, no layout space */
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    font-size: 0.85em;
    color: var(--color-accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.save-indicator.visible {
    display: inline-flex;
    opacity: 1;
}

.date-bar {
    background: transparent;
    padding: 12px 0;
    text-align: center;
    font-family: 'Times New Roman', Times, serif;
    font-size: 0.95em;
    color: var(--header-text);
    border-top: 1px solid var(--header-sep);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    padding: 30px 20px;
}

/* ===== NEWS SECTION ===== */
.news-section {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.news-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.news-header h2 {
    font-size: 1.5em;
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'Times New Roman', Times, serif;
}

/* News Filters */
.news-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 12px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 6px 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-chip:hover {
    border-color: var(--color-accent);
}

.filter-chip.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* Small hint below filter chips */
.filter-hint {
    display: block;
    margin-top: 8px;
    margin-left: 2px;
    color: var(--text-secondary);
    opacity: 0.7;
    font-size: 0.85em;
}

.news-header #currentDate {
    font-family: 'Times New Roman', Times, serif;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Featured News */
.news-featured {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 4px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-accent);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 25px;
}

.news-image {
    width: 100%;
}

.placeholder-image {
    width: 100%;
    height: 150px;
    background: var(--color-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
}

.news-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-category {
    display: inline-block;
    background: var(--color-accent);
    color: white;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.news-featured h2 {
    font-size: 2em;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 10px 0;
}

.news-excerpt {
    color: var(--text-secondary);
    font-size: 1.1em;
    line-height: 1.6;
}

.news-meta {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.author {
    font-weight: 600;
}

/* Link zur Quelle im Board */
.source-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    width: fit-content;
    padding: 8px 12px;
    border: 1px solid var(--color-accent);
    border-radius: 8px;
    color: var(--color-accent);
    background: transparent;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.source-link:hover {
    background: var(--color-accent);
    color: #ffffff;
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

[data-theme="dark"] .source-link {
    border-color: var(--color-accent);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.news-card {
    background: var(--bg-primary);
    padding: 0;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    border-color: var(--color-accent);
}

.news-card-image {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5em;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card-image div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent) 100%);
}

.news-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card h3 {
    font-size: 1.2em;
    margin: 10px 0;
    color: var(--text-primary);
    line-height: 1.3;
}

.news-card p {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.5;
    flex: 1;
}

.news-card .news-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Feed-spezifische Hintergrundfarben - Knall bunt! */
.news-card.feed-events .news-card-image,
.news-featured.feed-events .news-image .placeholder-image {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.news-card.feed-event-faqs .news-card-image,
.news-featured.feed-event-faqs .news-image .placeholder-image {
    background: linear-gradient(135deg, #8A2BE2 0%, #9370DB 100%);
}

.news-card.feed-news .news-card-image,
.news-featured.feed-news .news-image .placeholder-image {
    background: linear-gradient(135deg, #1E90FF 0%, #00BFFF 100%);
}

.news-card.feed-tipps .news-card-image,
.news-featured.feed-tipps .news-image .placeholder-image {
    background: linear-gradient(135deg, #FF8C00 0%, #FF6347 100%);
}

.news-card.feed-community .news-card-image,
.news-featured.feed-community .news-image .placeholder-image {
    background: linear-gradient(135deg, #22C55E 0%, #10B981 100%);
}

.news-card.feed-support .news-card-image,
.news-featured.feed-support .news-image .placeholder-image {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

/* Dark Mode: Gleiche knallige Farben */
[data-theme="dark"] .news-card.feed-events .news-card-image,
[data-theme="dark"] .news-featured.feed-events .news-image .placeholder-image {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

[data-theme="dark"] .news-card.feed-event-faqs .news-card-image,
[data-theme="dark"] .news-featured.feed-event-faqs .news-image .placeholder-image {
    background: linear-gradient(135deg, #8A2BE2 0%, #9370DB 100%);
}

[data-theme="dark"] .news-card.feed-news .news-card-image,
[data-theme="dark"] .news-featured.feed-news .news-image .placeholder-image {
    background: linear-gradient(135deg, #1E90FF 0%, #00BFFF 100%);
}

[data-theme="dark"] .news-card.feed-tipps .news-card-image,
[data-theme="dark"] .news-featured.feed-tipps .news-image .placeholder-image {
    background: linear-gradient(135deg, #FF8C00 0%, #FF6347 100%);
}

[data-theme="dark"] .news-card.feed-community .news-card-image,
[data-theme="dark"] .news-featured.feed-community .news-image .placeholder-image {
    background: linear-gradient(135deg, #22C55E 0%, #10B981 100%);
}

[data-theme="dark"] .news-card.feed-support .news-card-image,
[data-theme="dark"] .news-featured.feed-support .news-image .placeholder-image {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

/* Feed-spezifische Hintergrundbilder (Image Teaser) */
.news-card.feed-events .news-card-image,
.news-featured.feed-events .news-image .placeholder-image {
    background-image: url('img/theme/teaserbg_1.png') !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

.news-card.feed-event-faqs .news-card-image,
.news-featured.feed-event-faqs .news-image .placeholder-image {
    background-image: url('img/theme/teaserbg_2.png') !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

.news-card.feed-news .news-card-image,
.news-featured.feed-news .news-image .placeholder-image {
    background-image: url('img/theme/teaserbg_3.png') !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

.news-card.feed-tipps .news-card-image,
.news-featured.feed-tipps .news-image .placeholder-image {
    background-image: url('img/theme/teaserbg_4.png') !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

.news-card.feed-community .news-card-image,
.news-featured.feed-community .news-image .placeholder-image {
    background-image: url('img/theme/teaserbg_5.png') !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

/* Reuse an image for support (falls nur 5 vorhanden) */
.news-card.feed-support .news-card-image,
.news-featured.feed-support .news-image .placeholder-image {
    background-image: url('img/theme/teaserbg_3.png') !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

/* ===== MUSIC PLAYER ===== */
.music-player {
    background: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 20px;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.player-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.player-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-primary);
}

.player-btn:hover {
    border-color: var(--color-accent);
    background: var(--bg-secondary);
}

.player-btn:hover svg {
    color: var(--color-accent);
}

.play-btn {
    width: 50px;
    height: 50px;
    border-width: 2px;
}

.play-btn svg {
    width: 22px;
    height: 22px;
}

.player-track {
    margin-bottom: 10px;
}

.track-name {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: var(--text-secondary);
}

.progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-secondary);
    outline: none;
    border-radius: 2px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--color-accent);
    cursor: pointer;
    border-radius: 50%;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--color-accent);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.playlist {
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.playlist-item {
    padding: 8px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.85em;
    color: var(--text-primary);
    transition: background 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item:hover {
    background: var(--bg-secondary);
}

.playlist-item.active {
    background: var(--color-accent);
    color: white;
}

/* ===== CHAT SECTION ===== */
.chat-section {
    position: sticky;
    top: 160px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chat Maximized State */
.chat-section.maximized {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    gap: 0;
}

.chat-section.maximized .chat-container {
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: chatExpand 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-section.maximized .music-player {
    display: none;
}

@keyframes chatExpand {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-container {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    flex-direction: column;
    height: 600px;
    border: 3px solid var(--border-color);
}

.chat-header {
    background: var(--color-accent);
    color: var(--color-white);
    padding: 15px 20px;
    border-radius: 9px 9px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--color-white);
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-maximize-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--color-white);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-maximize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.chat-maximize-btn i {
    width: 18px;
    height: 18px;
}

.online-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 4px;
}

.chat-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own {
    flex-direction: row-reverse;
}

.chat-message canvas {
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    flex-shrink: 0;
}

.chat-message img {
    object-fit: cover;
}

.message-content {
    background: var(--chat-message-other);
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 70%;
}

.chat-message.own .message-content {
    background: var(--chat-message-own);
}

.message-content .username {
    font-weight: 700;
    color: var(--color-accent);
    font-size: 0.85em;
    margin-bottom: 3px;
    display: block;
}

.message-content .text {
    color: var(--text-primary);
    word-wrap: break-word;
}

.message-content .time {
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-top: 5px;
    display: block;
}

.chat-message.system {
    justify-content: center;
}

.chat-message.system .message-content {
    background: var(--bg-tertiary);
    text-align: center;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-style: italic;
}

.chat-input-container {
    padding: 15px;
    border-top: 2px solid var(--border-color);
    display: flex;
    gap: 10px;
}

#chatInput {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#chatInput:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Fixed chat status bar (overwrites last join/leave) */
.chat-status-bar {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 20px;
    font-size: 0.9em;
}

/* Typing Indicator */
.typing-indicator {
    padding: 8px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.typing-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.send-btn {
    padding: 12px;
    min-width: 48px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn i {
    width: 20px;
    height: 20px;
}

.send-btn:hover {
    background: var(--color-accent);
    transform: scale(1.05);
}

/* ===== FOOTER ===== */
footer {
    background: var(--bg-primary);
    border-top: 2px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .chat-section {
        position: static;
    }

    .chat-container {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .logo h1 {
        font-size: 1.3em;
    }

    .tagline {
        font-size: 0.8em;
    }

    .news-featured {
        grid-template-columns: 1fr;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }
}

/* ===== ADMIN PANEL ===== */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
}

#usersTable th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
}

#usersTable tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}