/* ============================================================
   COMMUNITY FEATURES — CSS
   Autorenprofil, Feed, Follow-Button, Notification Bell,
   Abzeichen, Profil-Erweiterungen
   ============================================================ */

/* ============================================================
   FOLLOW-BUTTON (universell, Story-Seite + Autorenprofil)
   ============================================================ */

.follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem;
    border: 2px solid var(--accent-color, #3498db);
    border-radius: 999px;
    background: transparent;
    color: var(--accent-color, #3498db);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.follow-btn:hover {
    background: var(--accent-color, #3498db);
    color: #fff;
    transform: translateY(-1px);
}

.follow-btn.following {
    background: var(--accent-color, #3498db);
    color: #fff;
}

.follow-btn.following:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

.follow-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Inline-Version neben dem Autornamen (Story-Seite) */
.story-author-follow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ============================================================
   NOTIFICATION BELL
   ============================================================ */

.notification-bell-wrapper {
    position: relative;
    display: inline-flex;
}

.notification-bell-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--secondary-color, #34495e);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    position: relative;
}

.notification-bell-btn:hover {
    background: var(--accent-color, #3498db);
    transform: translateY(-1px);
}

.notification-bell-btn.has-unread {
    animation: bell-ring 1s ease 0.5s;
}

@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    20%       { transform: rotate(-15deg); }
    40%       { transform: rotate(15deg); }
    60%       { transform: rotate(-10deg); }
    80%       { transform: rotate(10deg); }
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--white, #fff);
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    overflow: hidden;
    display: none;
}

.notification-dropdown.open {
    display: block;
    animation: dropdown-fade 0.15s ease;
}

@keyframes dropdown-fade {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color, #e1e8ed);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color, #333);
}

.notification-mark-all {
    font-size: 0.78rem;
    color: var(--accent-color, #3498db);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-weight: 500;
}

.notification-mark-all:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 340px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color, #e1e8ed);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: var(--text-color, #333);
}

.notification-item:hover {
    background: var(--background, #f8f9fa);
}

.notification-item.unread {
    background: #eff6ff;
    border-left: 3px solid var(--accent-color, #3498db);
}

.notification-item.unread:hover {
    background: #dbeafe;
}

[data-theme="dark"] .notification-item.unread {
    background: #1e3a5f;
    border-left-color: #3498db;
}

.notification-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.notification-text {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
}

.notification-text strong {
    font-weight: 600;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-light, #666);
    margin-top: 0.25rem;
    display: block;
}

.notification-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-light, #666);
    font-size: 0.875rem;
}

/* ============================================================
   AUTORENPROFIL-SEITE
   ============================================================ */

/* Hero-Bereich */
.author-hero {
    background: linear-gradient(135deg, var(--primary-color, #2c3e50) 0%, var(--secondary-color, #34495e) 100%);
    padding: 3rem 0 0;
    margin-bottom: 2rem;
    color: #fff;
}

.author-hero-inner {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding-bottom: 2rem;
}

/* Großer Avatar */
.author-avatar-lg {
    width: 96px;
    height: 96px;
    min-width: 96px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.author-hero-info {
    flex: 1;
    min-width: 0;
}

.author-hero-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.author-hero-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.author-hero-username {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.author-admin-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.8rem;
    color: #fff;
}

.author-bio {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0.75rem 0;
    max-width: 600px;
}

.author-social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.author-social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.author-social-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.author-social-date {
    cursor: default;
}

/* Statistiken-Leiste */
.author-stats-bar {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.author-stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
}

.author-stat-item:last-child {
    border-right: none;
}

.author-stat-item strong {
    font-size: 1.4rem;
    font-weight: 700;
}

.author-stat-item span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.2rem;
}

/* Abschnitte */
.author-section {
    margin-bottom: 3rem;
}

.author-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color, #333);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color, #e1e8ed);
}

/* Abzeichen-Grid */
.badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1rem 1.25rem;
    background: var(--white, #fff);
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 12px;
    text-align: center;
    min-width: 100px;
    cursor: help;
    transition: transform 0.2s, box-shadow 0.2s;
}

.badge-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.badge-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.badge-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color, #333);
}

.badge-desc {
    font-size: 0.72rem;
    color: var(--text-light, #666);
}

/* Geschichten-Grid */
.author-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.author-story-card {
    background: var(--white, #fff);
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text-color, #333);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.author-story-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    color: var(--text-color, #333);
}

.author-story-header {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.author-story-category {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--accent-color, #3498db);
    color: #fff;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.author-story-featured {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #f59e0b;
    color: #fff;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.author-story-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color, #333);
    margin: 0;
    line-height: 1.4;
}

.author-story-excerpt {
    font-size: 0.875rem;
    color: var(--text-light, #666);
    line-height: 1.5;
    flex: 1;
    margin: 0;
}

.author-story-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-light, #666);
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color, #e1e8ed);
}

.author-story-date {
    margin-left: auto;
}

/* Empty State */
.author-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light, #666);
    background: var(--white, #fff);
    border-radius: 12px;
    border: 1px dashed var(--border-color, #e1e8ed);
}

/* Follower-Liste */
.author-followers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.author-follower-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem 0.4rem 0.5rem;
    background: var(--white, #fff);
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-color, #333);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.author-follower-chip:hover {
    border-color: var(--accent-color, #3498db);
    color: var(--accent-color, #3498db);
}

.author-follower-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-color, #3498db);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.author-follower-more {
    color: var(--text-light, #666);
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
}

/* Profil-Seite: Autorenprofil-Link (Story-Seite) */
.author-profile-page .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================
   FEED-SEITE
   ============================================================ */

.feed-page {
    padding: 2rem 0;
}

.feed-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.feed-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color, #333);
    margin: 0 0 0.25rem;
}

.feed-subtitle {
    color: var(--text-light, #666);
    font-size: 0.95rem;
    margin: 0;
}

/* Feed: Leer-Zustand */
.feed-empty {
    text-align: center;
    padding: 4rem 1rem;
    background: var(--white, #fff);
    border-radius: 16px;
    border: 1px dashed var(--border-color, #e1e8ed);
    margin-bottom: 2rem;
}

.feed-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.feed-empty h2 {
    font-size: 1.4rem;
    color: var(--text-color, #333);
    margin-bottom: 0.5rem;
}

.feed-empty p {
    color: var(--text-light, #666);
    margin-bottom: 1.5rem;
}

/* Feed: Story-Grid */
.feed-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.feed-story-card {
    background: var(--white, #fff);
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feed-story-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.feed-story-author {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.feed-author-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color, #333);
    font-size: 0.875rem;
    font-weight: 500;
}

.feed-author-link:hover {
    color: var(--accent-color, #3498db);
}

.feed-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-color, #3498db);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.feed-story-date {
    font-size: 0.78rem;
    color: var(--text-light, #666);
    white-space: nowrap;
}

.feed-story-link {
    text-decoration: none;
    color: var(--text-color, #333);
    flex: 1;
}

.feed-story-category {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    background: var(--accent-color, #3498db);
    color: #fff;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.feed-story-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.4rem;
    color: var(--text-color, #333);
    transition: color 0.2s;
}

.feed-story-link:hover .feed-story-title {
    color: var(--accent-color, #3498db);
}

.feed-story-excerpt {
    font-size: 0.875rem;
    color: var(--text-light, #666);
    line-height: 1.5;
    margin: 0;
}

.feed-story-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-light, #666);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color, #e1e8ed);
}

/* Gefolgte Autoren Übersicht */
.feed-following-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color, #e1e8ed);
}

.feed-following-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color, #333);
    margin-bottom: 1rem;
}

.feed-following-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.feed-following-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem 0.4rem 0.5rem;
    background: var(--white, #fff);
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-color, #333);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.feed-following-chip:hover {
    border-color: var(--accent-color, #3498db);
    color: var(--accent-color, #3498db);
}

.feed-following-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-color, #2c3e50);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================================
   PROFIL-SEITE — ERWEITERUNGEN
   ============================================================ */

/* Community-Stats im Profil-Header */
.profile-community-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.profile-community-stat {
    font-size: 0.875rem;
    color: var(--text-light, #666);
}

.profile-community-stat a {
    color: var(--accent-color, #3498db);
    font-weight: 600;
    text-decoration: none;
}

.profile-community-stat a:hover {
    text-decoration: underline;
}

/* Abzeichen im Profil */
.profile-badges-section {
    margin-top: 1rem;
}

.profile-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    background: var(--background, #f8f9fa);
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-color, #333);
    cursor: help;
}

.profile-badge-chip-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .author-hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-hero-top {
        justify-content: center;
    }

    .author-social-links {
        justify-content: center;
    }

    .author-stats-bar {
        flex-wrap: wrap;
    }

    .author-stat-item {
        flex: 1 1 50%;
        border-right: 1px solid rgba(255, 255, 255, 0.15);
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }

    .author-stories-grid {
        grid-template-columns: 1fr;
    }

    .feed-stories-grid {
        grid-template-columns: 1fr;
    }

    .notification-dropdown {
        width: calc(100vw - 2rem);
        right: -1rem;
    }
}

@media (max-width: 480px) {
    .author-avatar-lg {
        width: 72px;
        height: 72px;
        min-width: 72px;
        font-size: 1.5rem;
    }

    .author-hero-name {
        font-size: 1.4rem;
    }
}
