/* =============================================================
   NASZA-BIEDRONKA.PL – Custom CSS Design System
   Red:#E30613 | Yellow:#FFD500 | Mobile-first | Dark mode
============================================================= */

/* ---- Base ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #E30613;
    border-radius: 3px;
}

html {
    scroll-behavior: smooth;
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ---- NAVBAR ---- */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.nav-link:hover {
    background: #fff1f2;
    color: #E30613;
}

.dark .nav-link {
    color: #d1d5db;
}

.dark .nav-link:hover {
    background: rgba(227, 6, 19, 0.15);
    color: #f87171;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: background 0.15s;
    text-decoration: none;
}

.mobile-nav-link:hover {
    background: #fff1f2;
    color: #E30613;
}

.dark .mobile-nav-link {
    color: #d1d5db;
}

.dark .mobile-nav-link:hover {
    background: rgba(227, 6, 19, 0.1);
}

/* ---- HERO ---- */
.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.hero-dot.active {
    width: 24px;
    background: #FFD500;
}

.hero-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    background: #E30613;
    color: #fff;
    padding: 0.75rem 1.75rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.9375rem;
    box-shadow: 0 4px 20px rgba(227, 6, 19, 0.4);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-cta:hover {
    background: #b8000e;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(227, 6, 19, 0.5);
}

/* ---- SECTION HEADERS ---- */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.section-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.2;
}

/* Nowy post – prawy górny róg na desktop, wycentrowany na mobile */
.forum-new-post-desktop {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .forum-new-post-desktop {
        width: 100%;
        text-align: center;
        margin-top: 0.75rem;
    }
}

/* ---- CARDS ---- */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.dark .card {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.06);
}

/* ---- AVATAR ---- */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
}

/* ---- RANK BADGES ---- */
.rank-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.rank-admin {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.rank-moderator {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #ffedd5;
}

.rank-supporter {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.rank-friend {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.rank-super {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.rank-engaged {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.rank-active {
    background: #faf5ff;
    color: #9333ea;
    border: 1px solid #e9d5ff;
}

.rank-user {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.rank-wspieram {
    background: linear-gradient(135deg, #fef2f2, #fffbeb);
    color: #dc2626;
    border: 1px solid #fca5a5;
    position: relative;
    overflow: hidden;
}

.rank-wspieram::after {
    /*content: '\2764';*/
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.55rem;
    opacity: 0.6;
}

.rank-admin-text {
    color: #dc2626;
}

.rank-moderator-text {
    color: #9a3412;
}

.rank-supporter-text {
    color: #16a34a;
    background-color: gold;
    padding: 1px;
}

.rank-friend-text {
    color: #059669;
}

.rank-super-text {
    color: #ea580c;
}

.rank-engaged-text {
    color: #2563eb;
}

.rank-active-text {
    color: #9333ea;
}

.rank-wspieram-text {
    color: #dc2626;
    font-weight: 700;
}

/* Gradient nazwy dla rangi Wspieram */
.rank-wspieram-gradient {
    background: linear-gradient(135deg, #dc2626, #f59e0b, #dc2626);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    animation: wspieram-shimmer 3s linear infinite;
}

@keyframes wspieram-shimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* ---- FORUM BUTTONS ---- */
.post-react-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.15s;
    border: none;
    background: none;
    cursor: pointer;
}

.post-react-btn:hover {
    background: #f3f4f6;
    color: #E30613;
}

.post-react-btn.liked {
    color: #E30613;
    font-weight: 600;
}

.dark .post-react-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.post-action-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s;
}

.post-action-btn:hover {
    background: #e5e7eb;
}

.dark .post-action-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #d1d5db;
}

/* ---- FORUM MODERN POST ---- */
.forum-post {
    display: flex;
    gap: 0;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    z-index: 1; /* baseline — niezbędne aby z-index działał przy transform (AOS) */
}

/* Gdy options-menu jest otwarte, unieś post ponad rodzeństwo i paginationControls.
   AOS transform tworzy stacking context na każdym poście, więc bez tego
   kolejne posty w DOM zasłaniają menu poprzedniego. */
.forum-post.menu-open {
    z-index: 200;
}
/* Fallback :has() dla przeglądarek obsługujących CSS4 (Chrome 105+, FF 121+, Safari 15.4+) */
.forum-post:has(.options-menu.show) {
    z-index: 200;
}

.forum-post:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.11);
    transform: translateY(-1px);
}

.dark .forum-post {
    background: #1f2937;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* Vote Column */
.forum-post-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem 0.5rem;
    gap: 0.25rem;
    background: #f9fafb;
    border-right: 1px solid #f3f4f6;
    min-width: 52px;
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
}

.dark .forum-post-vote {
    background: #111827;
    border-right-color: #374151;
}

.vote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    gap: 0.1rem;
}

.vote-btn .vote-count {
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
}

.vote-up {
    color: #9ca3af;
}

.vote-up:hover,
.vote-up.active {
    color: #16a34a;
    background: #f0fdf4;
    transform: scale(1.1);
}

.vote-down {
    color: #9ca3af;
}

.vote-down:hover,
.vote-down.active {
    color: #dc2626;
    background: #fef2f2;
    transform: scale(1.1);
}

.dark .vote-up:hover {
    background: rgba(22, 163, 74, 0.1);
}

.dark .vote-down:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* Post Body */
.forum-post-body {
    flex: 1;
    padding: 0.875rem 1rem;
    min-width: 0;
    overflow: hidden;
}

.forum-post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.forum-post-author {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.forum-post-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.35rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dark .forum-post-title {
    color: #f9fafb;
}

.forum-post-content {
    font-size: 0.8125rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dark .forum-post-content {
    color: #d1d5db;
}

/* ── Blockquote — cytaty w postach i komentarzach ── */
.post-blockquote {
    position: relative;
    margin: 0.75rem 0;
    padding: 0.85rem 1rem 0.85rem 1.25rem;
    background: #f8f9fa;
    border-left: 4px solid #E30613;
    border-radius: 0 10px 10px 0;
    font-style: italic;
    color: #4b5563;
    font-size: 0.8125rem;
    line-height: 1.65;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.post-blockquote::before {
    content: '\201C';
    position: absolute;
    top: -0.15rem;
    left: 0.5rem;
    font-size: 2rem;
    font-style: normal;
    color: #E30613;
    opacity: 0.25;
    line-height: 1;
    font-family: Georgia, serif;
}
.dark .post-blockquote {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: #ef4444;
    color: #d1d5db;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.dark .post-blockquote::before {
    color: #ef4444;
    opacity: 0.3;
}

/* Plakietka Dodano */
.post-added-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 4px;
    margin: 6px 0;
    border-left: 3px solid #d1d5db;
}
.dark .post-added-date {
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    border-left-color: #4b5563;
}

/* BBCode Lista */
.post-list {
    margin: 0.75rem 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.post-list li {
    position: relative;
    padding-left: 1.15rem;
    line-height: 1.5;
}
.post-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #E30613;
}
.dark .post-list li::before {
    background-color: #ef4444;
}

.forum-post-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.dark .forum-post-footer {
    border-top-color: #374151;
}

/* Category Badges */
.forum-category-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.cat-1 {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.cat-2 {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.cat-3 {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.cat-4 {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.cat-5 {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

.cat-6 {
    background: #ecfeff;
    color: #0891b2;
    border: 1px solid #a5f3fc;
}

.cat-7 {
    background: #fdf4ff;
    color: #a21caf;
    border: 1px solid #f0abfc;
}

/* Report Button */
.forum-report-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.forum-report-btn:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* Post Options (Three Dots) */
.forum-post-options {
    position: relative;
    display: flex;
}

.options-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.dark .options-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f9fafb;
}

.options-menu {
    position: absolute;
    top: 100%;
    left: 0;
    /* Start near left edge of the column */
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    min-width: 156px;
    padding: 0.5rem;
    z-index: 50;
    display: none;
    border: 1px solid #f3f4f6;
    transform: translateY(4px);
    /* Simple downward offset */
}

.dark .options-menu {
    background: #1f2937;
    border-color: #374151;
}

.options-menu.show {
    display: block;
    animation: menu-fade-in 0.2s ease-out;
}

@keyframes menu-fade-in {
    from {
        opacity: 0;
        transform: translateY(0);
    }

    to {
        opacity: 1;
        transform: translateY(4px);
    }
}

.menu-item {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4b5563;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s;
}

.dark .menu-item {
    color: #d1d5db;
}

.menu-item:hover {
    background: #f9fafb;
    color: #111827;
}

.dark .menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f9fafb;
}

.menu-item i {
    font-size: 0.9rem;
}

.menu-item.forum-report-btn:hover {
    color: #dc2626;
    background: #fef2f2;
}

.dark .menu-item.forum-report-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* Comment options menu (three-dots per comment) */
.comment-options-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 6px 10px -6px rgba(0, 0, 0, 0.08);
    min-width: 140px;
    padding: 0.4rem;
    z-index: 60;
    display: none;
    border: 1px solid #f3f4f6;
    transform: translateY(-5px);
}

.dark .comment-options-menu {
    background: #1f2937;
    border-color: #374151;
}

.comment-options-menu.show {
    display: block;
    animation: menu-fade-in 0.18s ease-out;
}

/* Filter Bar */
.forum-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    background: #fff;
    padding: 0.5rem 0.875rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.dark .forum-filter-bar {
    background: #1f2937;
}

.forum-filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    margin-right: 0.25rem;
}

.forum-filter-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: none;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s;
}

.forum-filter-btn:hover {
    border-color: #E30613;
    color: #E30613;
    background: #fef2f2;
}

.forum-filter-btn.active {
    background: #E30613;
    color: #fff;
    border-color: #E30613;
}

.dark .forum-filter-btn {
    border-color: #374151;
    color: #9ca3af;
}

.dark .forum-filter-btn.active {
    background: #E30613;
    color: #fff;
    border-color: #E30613;
}

/* Forum Select */
.forum-select {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.6rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.forum-select:focus {
    border-color: #E30613;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

.dark .forum-select {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

/* ---- NEWS SLIDER ---- */
.news-slider-wrapper {
    overflow: hidden;
    position: relative;
}

.news-slider {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
}

.news-slider::-webkit-scrollbar {
    display: none;
}

.news-card {
    flex: 0 0 280px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    scroll-snap-align: start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
}

.dark .news-card {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.06);
}

@media (min-width: 768px) {
    .news-card {
        flex: 0 0 310px;
    }
}

.news-card-img {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.news-category-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 9999px;
}

.news-card-body {
    padding: 1rem;
}

.news-date {
    font-size: 0.7rem;
    color: #9ca3af;
    display: block;
    margin-bottom: 0.4rem;
}

.news-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.dark .news-card-title {
    color: #f9fafb;
}

.news-card-desc {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-arrow-btn {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.news-arrow-btn:hover {
    background: #E30613;
    color: #fff;
    border-color: #E30613;
}

.dark .news-arrow-btn {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

/* ---- EVENTS SLIDER (analogiczny do news-slider) ---- */
.events-slider-wrapper {
    overflow: hidden;
    position: relative;
}

.events-slider {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
}

.events-slider::-webkit-scrollbar {
    display: none;
}

/* Karta wydarzenia — zachowuje oryginalny wygląd, stały flex-basis */
.events-slider .event-slide-card {
    flex: 0 0 300px;
    scroll-snap-align: start;
}

@media (min-width: 640px) {
    .events-slider .event-slide-card {
        flex: 0 0 340px;
    }
}

@media (min-width: 1024px) {
    .events-slider .event-slide-card {
        flex: 0 0 380px;
    }
}

/* Strzałki nawigacji — identyczne jak .news-arrow-btn */
.events-arrow-btn {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.events-arrow-btn:hover {
    background: #E30613;
    color: #fff;
    border-color: #E30613;
}

.dark .events-arrow-btn {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

*/ .rating-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.rating-info {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.rating-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dark .rating-label {
    color: #f9fafb;
}

.rating-desc {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

.dark .rating-desc {
    color: #9ca3af;
}

.rating-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.2rem;
}

.rating-result-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

.dark .rating-result-badge {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

.rating-result-badge.rating-result-empty {
    color: #9ca3af;
    background: transparent;
    border-color: transparent;
}

.rating-bar-track {
    width: 100%;
    height: 10px;
    background: #f3f4f6;
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dark .rating-bar-track {
    background: #374151;
}

.rating-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: #E30613;
    transition: width 1s ease;
}

.rating-status {
    font-size: 0.725rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-1 {
    color: #dc2626;
}

/* niedostateczny */
.status-2 {
    color: #ea580c;
}

/* mierny */
.status-3 {
    color: #ca8a04;
}

/* dostateczny */
.status-4 {
    color: #16a34a;
}

/* dobry */
.status-5 {
    color: #22c55e;
}

/* bardzo dobry */
.recommend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.dark .recommend-grid {
    border-top-color: #374151;
}

.recommend-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.recommend-bar {
    width: 100%;
    height: 6px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

.dark .recommend-bar {
    background: #4b5563;
}

.recommend-fill {
    height: 100%;
    transition: width 1s ease;
}

.rating-score {
    font-size: 0.875rem;
    font-weight: 800;
    color: #1a1a1a;
}

.dark .rating-score {
    color: #f9fafb;
}

.star-input:hover,
.star-input.active {
    color: #FFD500 !important;
}

/* status-6: celujący */
.status-6 {
    color: #ca8a04;
    text-shadow: 0 0 8px rgba(202, 138, 4, 0.3);
}

.status-0 {
    color: #9ca3af;
}

/* ---- SURVEY SWIPE CAROUSEL ---- */
.swipe-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.swipe-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), height 0.3s ease;
    will-change: transform;
    width: 100%;
}

.swipe-slide {
    flex-shrink: 0;
    padding: 0;
    background: var(--color-brand-light, #f0f4f8);
    align-self: flex-start;
}

.dark .swipe-slide {
    background: #1f2937;
}

/* Survey card - skonsolidowany jeden DIV per ankieta */
.survey-card {
    display: flex;
    flex-direction: column;
}

.survey-header {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dark .survey-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.survey-details {
    flex: 1;
}

.swipe-slide-title {
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #E30613;
    margin-bottom: 0.5rem;
}

.swipe-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #374151;
    font-size: 1rem;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.swipe-arrow:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.dark .swipe-arrow {
    background: rgba(55, 65, 81, 0.9);
    color: #e5e7eb;
}

.dark .swipe-arrow:hover {
    background: #4b5563;
}

.swipe-prev {
    left: 6px;
}

.swipe-next {
    right: 6px;
}

.swipe-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0 0.25rem;
}

.swipe-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: transparent;
    cursor: pointer;
    transition: all 0.25s;
    padding: 0;
}

.swipe-dot.active {
    background: #E30613;
    border-color: #E30613;
    transform: scale(1.2);
}

.swipe-dot:hover:not(.active) {
    border-color: #9ca3af;
    background: #f3f4f6;
}

.dark .swipe-dot {
    border-color: #4b5563;
}

.dark .swipe-dot.active {
    background: #E30613;
    border-color: #E30613;
}

.dark .swipe-dot:hover:not(.active) {
    border-color: #6b7280;
    background: #374151;
}

/* ---- GRADE TILES (kafle ocen 1-6 w modalu) ---- */
.grade-selector {
    display: flex;
    gap: 0.375rem;
    flex-wrap: nowrap;
}

.grade-tile {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.5rem 0.25rem;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 0;
}

.grade-tile:hover {
    border-color: #E30613;
    background: #fef2f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.15);
}

.grade-tile-num {
    font-size: 1.1rem;
    font-weight: 900;
    color: #6b7280;
    line-height: 1;
    transition: color 0.2s;
}

.grade-tile-label {
    font-size: 0.5rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-align: center;
    transition: color 0.2s;
}

/* Active grade tile */
.grade-tile.active {
    border-color: #E30613;
    background: linear-gradient(135deg, #E30613, #b8000e);
    box-shadow: 0 4px 16px rgba(227, 6, 19, 0.35);
    transform: translateY(-2px);
}

.grade-tile.active .grade-tile-num {
    color: #fff;
}

.grade-tile.active .grade-tile-label {
    color: rgba(255, 255, 255, 0.85);
}

/* Pop animation on click */
.grade-tile-pop {
    animation: tile-pop 0.3s ease;
}

@keyframes tile-pop {
    0% {
        transform: translateY(-2px) scale(1);
    }

    50% {
        transform: translateY(-4px) scale(1.08);
    }

    100% {
        transform: translateY(-2px) scale(1);
    }
}

/* Dark mode grade tiles */
.dark .grade-tile {
    border-color: #374151;
    background: #1f2937;
}

.dark .grade-tile:hover {
    border-color: #E30613;
    background: rgba(227, 6, 19, 0.1);
}

.dark .grade-tile-num {
    color: #d1d5db;
}

.dark .grade-tile.active {
    background: linear-gradient(135deg, #E30613, #b8000e);
    border-color: #E30613;
}

/* Category error state */
.grade-category-error {
    animation: category-shake 0.4s ease;
}

.grade-category-error .grade-selector {
    border: 2px solid #dc2626;
    border-radius: 0.75rem;
    padding: 0.25rem;
}

@keyframes category-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(3px);
    }
}

/* Rating bar flash (po submicie) */
.rating-bar-flash {
    box-shadow: 0 0 12px rgba(227, 6, 19, 0.4);
}

/* ---- MOBILE GRADE WRAP: 2 rzędy po 3 kafle ---- */
@media (max-width: 575px) {
    .grade-selector--wrap {
        flex-wrap: wrap !important;
        gap: 0.35rem;
    }

    .grade-selector--wrap .grade-tile {
        flex: 0 0 calc(33.333% - 0.25rem);
        min-width: 0;
        padding: 0.6rem 0.2rem;
    }

    .grade-selector--wrap .grade-tile-label {
        font-size: 0.6rem;
    }

    .grade-selector--wrap .grade-tile-num {
        font-size: 1rem;
    }
}

/* ---- RADIO POLL TILES ---- */
.radio-poll-tile {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.radio-poll-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.radio-poll-tile:hover::before {
    opacity: 1;
}

.radio-poll-tile.active {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

/* Rating modal content scrollbar */
.rating-modal-content::-webkit-scrollbar {
    width: 4px;
}

.rating-modal-content::-webkit-scrollbar-thumb {
    background: #E30613;
    border-radius: 2px;
}

/* Rating info notice */
.rating-info-notice {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.rating-info-notice:hover {
    opacity: 1;
}

/* Toast animation */
@keyframes toast-in {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    to {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
}

.animate-toast-in {
    animation: toast-in 0.3s ease-out;
}

.animate-toast-out {
    animation: toast-out 0.3s ease-in forwards;
}

/* ---- CHAT ---- */
.chat-msg {
    display: flex;
    align-items: flex-start;
}

.chat-msg .avatar-circle {
    display: none;
}

.chat-msg-own {
    flex-direction: row-reverse;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
    cursor: pointer;
    transition: opacity 0.2s;
    color: #374151;
}

.dark .chat-meta {
    color: #d1d5db;
}

.chat-meta:hover {
    opacity: 0.7;
}

.chat-user {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
}

.dark .chat-user {
    color: #e5e7eb;
}

.chat-time {
    font-size: 0.65rem;
    color: #9ca3af;
}

.dark .chat-time {
    color: #9ca3af;
}

.chat-bubble {
    display: inline-block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0 12px 12px 12px;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    color: #1a1a1a;
    max-width: 100%;
    width: 100%;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dark .chat-bubble {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.chat-bubble-own {
    background: #E30613;
    border-color: #E30613;
    border-radius: 12px 12px 0 12px;
    color: #fff;
    /* max-width: 80%;  */
    width: auto;
}

.dark .chat-bubble-own {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* ---- ONLINE DOT ---- */
.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 9999px;
    animation: pulse-green 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse-green {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ---- COMMUNITY STATS ---- */
.community-stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.community-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.dark .community-stat-card {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.06);
}

.stat-number {
    font-size: 1.375rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.1;
}

.dark .stat-number {
    color: #f9fafb;
}

.stat-label {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

/* ---- RANK LEGEND ---- */
.rank-legend-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 10px;
    transition: background 0.15s;
}

.rank-legend-row:hover {
    background: #f9fafb;
}

.dark .rank-legend-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ---- ONLINE USERS LIST ---- */
.online-user-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.375rem;
    border-radius: 6px;
    transition: background 0.1s;
}

.online-user-item:hover {
    background: #f9fafb;
}

.dark .online-user-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ---- FOOTER ---- */
.footer-link {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #9ca3af;
    transition: color 0.15s;
    text-decoration: none;
}

.footer-link:hover {
    color: #fff;
}

.footer-social-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #9ca3af;
    transition: all 0.2s;
    text-decoration: none;
}

.footer-social-btn:hover {
    background: #E30613;
    color: #fff;
    transform: translateY(-2px);
}

/* ---- BACK TO TOP ---- */
#backToTop {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: #E30613;
    color: #fff;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(227, 6, 19, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 40;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    border: none;
}

#backToTop.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#backToTop:hover {
    background: #b8000e;
    transform: translateY(-2px);
}

/* ---- SKELETON LOADING ---- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ---- AOS ANIMATIONS ---- */
[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

[data-aos="fade-in"] {
    opacity: 0;
    transition: opacity 0.6s ease;
}

[data-aos="fade-in"].aos-animate {
    opacity: 1;
}

[data-aos="zoom-in"] {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-aos="zoom-in"].aos-animate {
    opacity: 1;
    transform: scale(1);
}

[data-aos-delay="100"] {
    transition-delay: 0.1s !important;
}

[data-aos-delay="200"] {
    transition-delay: 0.2s !important;
}

[data-aos-delay="300"] {
    transition-delay: 0.3s !important;
}

[data-aos-delay="400"] {
    transition-delay: 0.4s !important;
}

/* ---- RESPONSIVE ---- */
@media (min-width: 1024px) {
    .section-title {
        font-size: 1.5rem;
    }
}


/* ================================================================
   POST PAGE – Comments System
   post.php specific styles
================================================================ */

/* ---- Post title link (index.php) ---- */
.post-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.post-title-link:hover {
    color: #E30613;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #6b7280;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: #E30613;
}

.breadcrumb-sep {
    color: #d1d5db;
}

.dark .breadcrumb a {
    color: #9ca3af;
}

.dark .breadcrumb a:hover {
    color: #f87171;
}

/* ---- Full Post Card (rozszerzony forum-post) ---- */
.post-full-card {
    /* Usuwa truncation – pełna treść */
    cursor: default;
}

/* Treść posta nie powinna być obcinana w rozszerzonym widoku */
.post-full-card .forum-post-body {
    overflow: visible;
}

.post-full-card:hover {
    transform: none;
}

.post-full-title {
    /* tytuł nie jest sam w sobie linkiem, ale zawiera <a> wewnątrz */
    cursor: default;
    color: inherit;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-full-title a {
    pointer-events: auto;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.post-full-title a:hover {
    color: #E30613;
    text-decoration: underline;
}

.post-full-content {
    /* Pełna treść bez obcięcia */
    display: block !important;
    overflow: visible !important;
    max-height: none !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    font-size: 0.9rem;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ---- Sort bar ---- */
.comment-sort-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.dark .comment-sort-bar {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.06);
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    transition: all 0.15s;
}

.sort-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.sort-btn.active {
    background: #fff1f2;
    color: #E30613;
    border-color: #fecaca;
    font-weight: 600;
}

.dark .sort-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #d1d5db;
}

.dark .sort-btn.active {
    background: rgba(227, 6, 19, 0.12);
    color: #f87171;
    border-color: rgba(227, 6, 19, 0.3);
}

/* ---- Comment add form ---- */
.comment-composer {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
}

.dark .comment-composer {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.06);
}

.composer-textarea {
    width: 100%;
    resize: none;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.composer-textarea:focus {
    border-color: #E30613;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
    background: #fff;
}

.dark .composer-textarea {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
}

.dark .composer-textarea:focus {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.dark .composer-textarea::placeholder {
    color: #6b7280;
}

.composer-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #E30613;
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 0.6rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(227, 6, 19, 0.35);
    transition: all 0.2s;
}

.composer-submit:hover {
    background: #b8000e;
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(227, 6, 19, 0.45);
}

.composer-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    padding: 0.6rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}

.composer-cancel:hover {
    background: #f3f4f6;
    color: #374151;
}

.dark .composer-cancel {
    border-color: #374151;
    color: #9ca3af;
}

.dark .composer-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ---- Comments List ---- */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---- Single Comment forum edycja margin + linia 1628 ---- */
.comment {
    position: relative;
    /* padding: 1.125rem 1.25rem 0; */
    padding: 5px;
    padding-left: 10px;
}

/* ================================================================
   COMMENT CHILDREN – wcięcia (mobile-first, drastycznie małe)
================================================================ */

/* Poziom 1: dzieci komentarza głównego */
.comment-children {
    /*
    margin-left: 4px;
    padding-left: 6px;
    */
    border-left: 3px solid #d3caca;
    margin-top: 0;

}

.dark .comment-children {
    border-left-color: #374151;
}

/* Poziom 2: dzieci odpowiedzi */
.comment-children .comment-children {
    margin-left: 2px;
    padding-left: 4px;
    border-left: 3px solid #f8d4d6;
}

.dark .comment-children .comment-children {
    border-left-color: rgba(227, 6, 19, 0.2);
}

/* Poziom 3: najgłębszy */
.comment-children .comment-children .comment-children {
    margin-left: 2px;
    padding-left: 4px;
    border-left-color: #fde8e9;
}

/* Tablet+: normalniejsze wcięcia */
@media (min-width: 640px) {
    .comment-children {
        margin-left: 1.25rem;
        padding-left: 1rem;
    }

    .comment-children .comment-children {
        margin-left: 1rem;
        padding-left: 0.75rem;
    }

    .comment-children .comment-children .comment-children {
        margin-left: 0.75rem;
        padding-left: 0.5rem;
    }
}

/* ================================================================
   CZCIONKI I PADDING PER-POZIOM ODPOWIEDZI
================================================================ */

/* Poziom 2 – odpowiedzi: czcionka o 1px mniejsza (13px) */
.comment-children .comment-body {
    padding: 0.5rem 0.6rem 0.45rem;
}

.comment-children .comment-text {
    font-size: 0.8125rem;
    /* 13px */
}

.comment-children .comment-author-name {
    font-size: 0.8125rem;
}

.comment-children .comment-author-row {
    gap: 0.3rem;
    margin-bottom: 0.35rem;
}

/* Poziom 3 – odpowiedzi na odpowiedzi: czcionka o 2px mniejsza (12px) */
.comment-children .comment-children .comment-body {
    padding: 0.4rem 0.55rem 0.4rem;
}

.comment-children .comment-children .comment-text {
    font-size: 0.75rem;
    /* 12px */
}

.comment-children .comment-children .comment-author-name {
    font-size: 0.75rem;
}

.comment-children .comment-children .comment-author-row {
    gap: 0.25rem;
    margin-bottom: 0.3rem;
}

/* Tablet+: wróć do normalnych wartości w zagnieżdżeniu */
@media (min-width: 640px) {
    .comment-children .comment-body {
        padding: 0.875rem 1rem 0.75rem;
    }

    .comment-children .comment-text {
        font-size: 0.85rem;
    }

    .comment-children .comment-author-name {
        font-size: 0.85rem;
    }

    .comment-children .comment-author-row {
        gap: 0.4rem;
        margin-bottom: 0.45rem;
    }

    .comment-children .comment-children .comment-body {
        padding: 0.75rem 0.875rem 0.625rem;
    }

    .comment-children .comment-children .comment-text {
        font-size: 0.8125rem;
    }

    .comment-children .comment-children .comment-author-name {
        font-size: 0.8125rem;
    }

    .comment-children .comment-children .comment-author-row {
        gap: 0.35rem;
        margin-bottom: 0.4rem;
    }
}

.comment-body {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    /* Mobile: mały padding, maksimum miejsca na tekst */
    padding: 0.65rem 0.75rem 0.55rem;
    transition: box-shadow 0.2s;
}

@media (min-width: 480px) {
    .comment-body {
        padding: 0.875rem 1rem 0.75rem;
    }
}

@media (min-width: 640px) {
    .comment-body {
        padding: 1rem 1.125rem 0.75rem;
        border-radius: 14px;
    }
}

.comment-body:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dark .comment-body {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.06);
}

/* OP badge */
.comment-op-badge {
    display: inline-flex;
    align-items: center;
    background: #fff1f2;
    color: #E30613;
    border: 1px solid #fecaca;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 9999px;
}

.comment-author-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.comment-author-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
}

.dark .comment-author-name {
    color: #f9fafb;
}

.comment-date {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-left: auto;
    white-space: nowrap;
}

.comment-text {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.65;
    margin-bottom: 0.625rem;

    /* ── 2026-05-14: Zawijanie długich URL-i / nieprzerywanych ciągów ──
       Bez tych reguł URL typu
       "https://pieniadze.gazeta.pl/Kupujemy/1,124630,12858742,Biedronka_przegrala_..."
       wypycha .comment-body poza kontener (poziomy scroll, łamanie layoutu).
       - overflow-wrap: anywhere — łamie w dowolnym miejscu gdy potrzeba
         (uwzględniane przy obliczaniu min-content, więc nie rozpycha rodzica).
       - word-break: break-word — fallback dla starszych przeglądarek.
       - min-width: 0 — krytyczne gdy .comment-text jest dzieckiem flex/grid,
         bo domyślne min-width: auto blokuje shrink poniżej intrinsic size.
       - max-width: 100% — twarda ochrona przed wystawaniem.                  */
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
    max-width: 100%;
}

/* Linki wewnątrz komentarza — łam jak zwykły tekst (URL bez spacji). */
.comment-text a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dark .comment-text {
    color: #d1d5db;
}

/* ---- Comment actions bar ---- */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    flex-wrap: nowrap;
}

/* Na mobile: tylko ikona, tekst ukryty */
.c-btn-label {
    display: none;
}

@media (min-width: 480px) {
    .c-btn-label {
        display: inline;
    }

    .comment-actions {
        gap: 0.125rem;
    }
}

.c-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    padding: 0.2rem 0.35rem;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

@media (min-width: 480px) {
    .c-action-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.775rem;
    }
}

.c-action-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.dark .c-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #d1d5db;
}

/* Vote buttons */
.c-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* button oceny pozytywnej komentarza */
.c-vote-btn.voted-up {
    color: #1bc56f;
    background: #f6fff1;
}

.c-vote-btn.voted-down {
    color: #6b7280;
    background: #f3f4f6;
}

.dark .c-vote-btn.voted-up {
    color: #f87171;
    background: rgba(227, 6, 19, 0.12);
}

.c-vote-sep {
    width: 1px;
    height: 16px;
    background: #e5e7eb;
    margin: 0 0.125rem;
    flex-shrink: 0;
}

.dark .c-vote-sep {
    background: #374151;
}

/* Reply btn accent */
.c-reply-btn:hover {
    color: #E30613;
    background: #fff1f2;
}

/* Report btn */
.c-report-btn:hover {
    color: #f59e0b;
    background: #fffbeb;
}

/* Deleted comment */
.comment-deleted .comment-body {
    background: #f9fafb;
    border-style: dashed;
    box-shadow: none;
}

.dark .comment-deleted .comment-body {
    background: #111827;
}

.comment-deleted .comment-text {
    color: #9ca3af;
    font-style: italic;
}

/* ---- Load More Replies Button ---- */
.load-more-replies-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0.5rem 0 0.25rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    /* color: #E30613; */
    color: rgb(169, 166, 166);
    /* background: #fff1f2; */
    background: #f9fafb;
    /* border: 1px solid #fecaca; */
    border: 1px solid rgb(231, 228, 228);
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.load-more-replies-btn:hover {
    /* background: #ffe4e6; */
    background: #e5e7eb;
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.15);
}

.dark .load-more-replies-btn {
    background: rgba(227, 6, 19, 0.1);
    border-color: rgba(227, 6, 19, 0.3);
    color: #f87171;
}

.dark .load-more-replies-btn:hover {
    background: rgba(227, 6, 19, 0.18);
}

/* ---- Inline Reply Form ---- */
.reply-form {
    margin-top: 0.625rem;
    margin-bottom: 0.5rem;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.875rem;
    display: none;
    animation: slideDown 0.2s ease;
}

.reply-form.open {
    display: block;
}

.dark .reply-form {
    background: #111827;
    border-color: #374151;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reply-textarea {
    width: 100%;
    resize: none;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.reply-textarea:focus {
    border-color: #E30613;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.08);
}

.dark .reply-textarea {
    background: #1f2937;
    border-color: #4b5563;
    color: #f3f4f6;
}

/* ---- Toast notification ---- */
.toast {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    z-index: 9999;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.625rem 1.125rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.25s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.toast-success {
    background: #16a34a;
}

.toast.toast-error {
    background: #dc2626;
}

.toast.toast-info {
    background: #2563eb;
}

/* ---- Share / Report Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}

.modal-overlay.open .modal-box {
    transform: scale(1) translateY(0);
}

.dark .modal-box {
    background: #1f2937;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.dark .modal-title {
    color: #f9fafb;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    border: none;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 1rem;
    transition: all 0.15s;
}

.modal-close-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.dark .modal-close-btn {
    background: #374151;
    color: #9ca3af;
}

.dark .modal-close-btn:hover {
    background: #4b5563;
    color: #f9fafb;
}

/* Share options grid */
.share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    border: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.15s;
    background: #f9fafb;
    font-size: 0.7rem;
    font-weight: 600;
    color: #374151;
}

.share-item:hover {
    border-color: #E30613;
    background: #fff1f2;
    color: #E30613;
    transform: translateY(-2px);
}

.dark .share-item {
    background: #111827;
    border-color: #374151;
    color: #d1d5db;
}

.dark .share-item:hover {
    border-color: #f87171;
    background: rgba(227, 6, 19, 0.1);
    color: #f87171;
}

.share-item i {
    font-size: 1.5rem;
}

/* Report form */
.report-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1.5px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 0.5rem;
}

.report-option:hover {
    border-color: #fcd34d;
    background: #fffbeb;
}

.report-option input[type="radio"] {
    accent-color: #E30613;
    flex-shrink: 0;
}

.report-option-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
}

.dark .report-option {
    border-color: #374151;
}

.dark .report-option:hover {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
}

.dark .report-option-label {
    color: #d1d5db;
}

/* ---- Page layout ---- */
.post-page-layout {
    max-width: 820px;
    margin: 0 auto;
    /* padding-top uwzględnia fixowany navbar (64px) */
    padding: calc(64px + 1rem) 0.75rem 4rem;
}

@media (min-width: 480px) {
    .post-page-layout {
        padding: calc(64px + 1.25rem) 1rem 4rem;
    }
}

@media (min-width: 768px) {
    .post-page-layout {
        padding: calc(64px + 1.5rem) 1.5rem 5rem;
    }
}

/* Typografia komentarzy – responsywna */
.comment-text {
    font-size: 0.875rem;
    line-height: 1.6;
}

@media (min-width: 640px) {
    .comment-text {
        font-size: 0.925rem;
    }
}

.comment-author-name {
    font-size: 0.8rem;
}

@media (min-width: 480px) {
    .comment-author-name {
        font-size: 0.875rem;
    }
}

.comment-meta-date {
    font-size: 0.7rem;
}

@media (min-width: 480px) {
    .comment-meta-date {
        font-size: 0.75rem;
    }
}

/* ---- BLUR OVERLAY dla niezalogowanych ---- */
.blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 40%, rgba(255, 255, 255, 1) 60%);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.dark .blur-overlay {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0) 0%, rgba(17, 24, 39, 0.95) 40%, rgba(17, 24, 39, 1) 60%);
}

.blur-overlay-content {
    text-align: center;
    padding: 2rem;
    color: #1f2937;
}

.dark .blur-overlay-content {
    color: #f3f4f6;
}

.btn-login-blur {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.625rem 1.5rem;
    background: #E30613;
    color: white;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.3);
}

.btn-login-blur:hover {
    background: #c00510;
    box-shadow: 0 6px 16px rgba(227, 6, 19, 0.4);
    transform: translateY(-2px);
}

/* ---- NOTIFICATIONS MOBILE FIX ---- */
@media (max-width: 640px) {
    .notif-dropdown-mobile {
        position: fixed !important;
        top: 60px !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        max-height: 70vh !important;
        margin-top: 0 !important;
        border-radius: 1rem !important;
    }
}


/* ---- MODERATOR HIDDEN INFO DARK MODE FIX ---- */
.dark .comment-moderator-info {
    background-color: rgba(251, 191, 36, 0.1) !important;
    border-left-color: #f59e0b !important;
    color: #fcd34d !important;
}

.dark .comment-moderator-info i {
    color: #fbbf24 !important;
}

.dark .comment-moderator-info strong {
    color: #f59e0b !important;
}


/* Dodane dla ukrycia backToTop gdy czat jest widoczny */
#backToTop.chat-visible-hide {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(10px) !important;
    pointer-events: none !important;
}

/* ---- PREMIUM CHAT TEMPLATE ---- */
.premium-chat-msg {
    display: flex;
    gap: 0.25rem;
    /* Zmniejszony gap, ale przywrócony by nie kleiło się do avatara */
    margin-bottom: 0.5rem;
    padding-top: 0.5rem;
    align-items: flex-end;
    animation: fadeInMsg 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.premium-chat-msg.chat-msg-own {
    flex-direction: row-reverse;
}

@keyframes fadeInMsg {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.premium-avatar-wrap {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.premium-chat-msg:hover .premium-avatar-wrap {
    transform: scale(1.15) rotate(-3deg);
}

.premium-avatar-wrap .avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.dark .premium-avatar-wrap .avatar-circle {
    border-color: rgba(0, 0, 0, 0.4);
}

.premium-chat-content {
    max-width: 92%;
    /* Zwiększono wykorzystując lukę po prawej/lewej stronie */
    display: flex;
    flex-direction: column;
}

.chat-msg-own .premium-chat-content {
    align-items: flex-end;
}

.premium-chat-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    flex-wrap: wrap;
}

.chat-msg-own .premium-chat-meta {
    flex-direction: row-reverse;
}

.premium-chat-author {
    font-weight: 800;
    font-size: 0.75rem;
    color: #1a1a2e;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.dark .premium-chat-author {
    color: #e2e8f0;
}

.premium-chat-author.rank-wspieram-gradient {
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.premium-chat-rank {
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    gap: 3px;
    background: #f1f5f9;
    color: #64748b;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid #e2e8f0;
}

.dark .premium-chat-rank {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

.premium-chat-time {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 500;
}

.premium-chat-bubble {
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 0.6rem 0.9rem;
    background: #ffffff;
    color: #1e293b;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    word-break: break-word;
    position: relative;
}

.dark .premium-chat-bubble {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-top: none;
}

.chat-msg-own .premium-chat-bubble {
    background: linear-gradient(135deg, #E30613 0%, #a7000b 100%);
    color: #ffffff;
    border: none;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 6px 20px rgba(227, 6, 19, 0.25);
}

.chat-msg-own .premium-chat-rank,
.chat-msg-own .premium-chat-author {
    display: none;
}

.bg-brand-white {
    --tw-bg-opacity: 1;
    background-color: #fff;
}

/* ============================================================
   COMMENT CARD – Global Feed (.comment-card)
   ============================================================ */
.comment-card {
    background: #fff;
    border: 1px solid #f1f3f5;
    border-radius: 16px;
    padding: 14px 16px 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.comment-card:hover {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.dark .comment-card {
    background: #1b2333;
    border-color: rgba(255, 255, 255, 0.06);
}

/* Górna sekcja: lewa kolumna + prawa kolumna */
.cc-main {
    display: flex;
    gap: 12px;
    width: 100%;
}

/* Lewa kolumna:  głosowanie + licznik */
.cc-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 42px;
    gap: 6px;
}

/* Pionowy blok głosowania */
.cc-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    width: 100%;
    padding: 4px 0;
}

.dark .cc-vote {
    background: #252d3e;
    border-color: rgba(255, 255, 255, 0.07);
}

.cc-vote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 100%;
    color: #adb5bd;
    font-size: 14px;
    transition: color 0.15s;
    line-height: 1;
}

.cc-vote-btn:hover,
.cc-vote-btn.active {
    color: #E30613;
}

.dark .cc-vote-btn.active {
    color: #f87171;
}

.cc-vote-btn.vote-up:hover,
.cc-vote-btn.vote-up.active {
    color: #16a34a;
}

.dark .cc-vote-btn.vote-up.active {
    color: #4ade80;
}

.cc-score {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 0;
    color: #6b7280;
    text-align: center;
    width: 100%;
}

.cc-score.positive {
    color: #16a34a;
}

.cc-score.negative {
    color: #E30613;
}

/* Licznik odpowiedzi pod głosowaniem */
.cc-replies {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    width: 100%;
    padding: 4px 2px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
}

.dark .cc-replies {
    background: #252d3e;
    border-color: rgba(255, 255, 255, 0.07);
    color: #9ca3af;
}

/* Prawa kolumna */
.cc-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Nagłówek: autor + czas */
.cc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.cc-author {
    font-size: 13.5px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .cc-author {
    color: #f3f4f6;
}

.cc-time {
    font-size: 10.5px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Dymek treści */
.cc-bubble {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px 16px 16px 16px;
    padding: 12px 14px;
}

.dark .cc-bubble {
    background: #252d3e;
    border-color: rgba(255, 255, 255, 0.07);
}

.cc-text {
    font-size: 13px;
    line-height: 1.65;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    margin: 0;
}

.dark .cc-text {
    color: #d1d5db;
}

/* Dolny wiersz: link do wątku */
.cc-thread {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    width: 100%;
    min-width: 0;
}

.cc-thread-icon {
    flex-shrink: 0;
    font-size: 14px;
    color: #9ca3af;
}

.cc-thread-link {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #E30613;
    text-decoration: none;
    min-width: 0;
    overflow: hidden;
}

.cc-thread-link:hover {
    text-decoration: underline;
}

.cc-thread-link i {
    flex-shrink: 0;
    font-size: 10px;
}

.cc-thread-link span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Brakujące klasy — prawa kolumna karty komentarza (2026-05-18)
   JS używa .cc-body zamiast .cc-right, .cc-meta zamiast .cc-header,
   .cc-content zamiast .cc-bubble/.cc-text. -------------------------*/

/* Prawa kolumna — odpowiednik cc-right */
.cc-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Wiersz: tytuł wątku + timestamp */
.cc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

/* Nazwa autora wewnątrz .cc-author */
.cc-author-name {
    font-weight: 700;
    color: #111827;
}

.dark .cc-author-name {
    color: #f3f4f6;
}

/* Treść komentarza (bez dymka) */
.cc-content {
    font-size: 13px;
    line-height: 1.65;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px 14px 14px 14px;
    padding: 9px 13px;
    margin: 2px 0;
}

.dark .cc-content {
    color: #d1d5db;
    background: #252d3e;
    border-color: rgba(255, 255, 255, 0.07);
}

/* Stopka karty — "Przejdź do wątku" */
.cc-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 4px;
    padding-top: 7px;
    border-top: 1px solid #f0f0f0;
}

.dark .cc-footer {
    border-top-color: rgba(255, 255, 255, 0.07);
}

.cc-go-to-thread {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
    color: #E30613;
    background: rgba(227, 6, 19, 0.08);
    border: 1px solid rgba(227, 6, 19, 0.18);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    white-space: nowrap;
}

.cc-go-to-thread:hover {
    background: rgba(227, 6, 19, 0.15);
    border-color: rgba(227, 6, 19, 0.35);
    text-decoration: none;
    transform: translateX(2px);
}

.cc-go-to-thread i {
    font-size: 11px;
    transition: transform 0.15s;
}

.cc-go-to-thread:hover i {
    transform: translateX(3px);
}

.dark .cc-go-to-thread {
    color: #f87171;
    background: rgba(248, 113, 113, 0.10);
    border-color: rgba(248, 113, 113, 0.22);
}

.dark .cc-go-to-thread:hover {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.40);
}

/* =============================================================
   NEW POST MODAL – Button + Modal + Form
============================================================= */

/* ---- "Nowy temat" Button ---- */
.btn-new-post {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #E30613 0%, #c00510 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(227, 6, 19, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.02em;
}

.btn-new-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(227, 6, 19, 0.45);
    background: linear-gradient(135deg, #ff1a26 0%, #E30613 100%);
}

.btn-new-post:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.3);
}

.btn-new-post i {
    font-size: 1.15rem;
    font-weight: 900;
}

/* ---- Login Prompt (for guests) ---- */
.npm-login-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: rgba(227, 6, 19, 0.04);
    border: 1px dashed rgba(227, 6, 19, 0.25);
    border-radius: 14px;
    color: #6b7280;
    font-size: 0.88rem;
    flex-wrap: wrap;
}

.npm-login-prompt i {
    color: #E30613;
    font-size: 1.1rem;
}

.npm-login-link {
    margin-left: auto;
    color: #E30613;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.npm-login-link:hover {
    color: #c00510;
    text-decoration: underline;
}

/* ---- Modal Overlay ---- */
.npm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
    padding: 16px;
}

.npm-overlay.npm-visible {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
}

/* ---- Modal Container ---- */
.npm-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    transform: translateY(30px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.npm-visible .npm-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ---- Modal Header ---- */
.npm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #E30613 0%, #c00510 100%);
    color: #fff;
}

.npm-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.npm-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 1rem;
}

.npm-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ---- Modal Body ---- */
.npm-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* ---- Form Groups ---- */
.npm-form-group {
    margin-bottom: 16px;
}

.npm-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 6px;
}

.npm-form-group label i {
    color: #E30613;
    margin-right: 4px;
}

.npm-required {
    color: #E30613;
    font-weight: 700;
}

.npm-optional {
    color: #9ca3af;
    font-size: 0.78rem;
    font-weight: 400;
}

/* ---- Inputs ---- */
.npm-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #1f2937;
}

.npm-input:focus {
    outline: none;
    border-color: #E30613;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
    background: #fff;
}

.npm-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.npm-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 36px;
}

/* ---- Char count ---- */
.npm-char-count {
    text-align: right;
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 4px;
    font-weight: 500;
    transition: color 0.2s;
}

.npm-char-count.npm-over {
    color: #E30613;
    font-weight: 700;
}

/* ---- Errors ---- */
.npm-error {
    color: #dc2626;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 4px;
    min-height: 0;
}

/* ---- Hint ---- */
.npm-hint {
    color: #9ca3af;
    font-size: 0.75rem;
    display: block;
    margin-top: 4px;
}

/* ---- Attachments row ---- */
.npm-attachments {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.npm-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.2s;
}

.npm-attach-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.npm-attach-btn.npm-attach-link {
    color: #10b981;
}

.npm-attach-btn.npm-attach-link:hover {
    border-color: #10b981;
    background: #ecfdf5;
}

/* ---- Extra sections (image/link inputs) ---- */
.npm-extra-section {
    animation: npmSlideDown 0.25s ease-out;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

@keyframes npmSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Image preview ---- */
.npm-image-preview {
    margin-top: 8px;
}

.npm-preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    object-fit: contain;
}

/* ---- Modal Footer ---- */
.npm-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

.npm-cancel-btn {
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.npm-cancel-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.npm-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #E30613 0%, #c00510 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 3px 12px rgba(227, 6, 19, 0.25);
}

.npm-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(227, 6, 19, 0.35);
}

.npm-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---- Spinner ---- */
.npm-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: npmSpin 0.6s linear infinite;
}

@keyframes npmSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Dark mode ---- */
.dark .npm-modal {
    background: #1f2937;
}

.dark .npm-body {
    background: #1f2937;
}

.dark .npm-form-group label {
    color: #d1d5db;
}

.dark .npm-input {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .npm-input:focus {
    background: #374151;
    border-color: #E30613;
}

.dark .npm-footer {
    background: #111827;
    border-top-color: #374151;
}

.dark .npm-cancel-btn {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

.dark .npm-extra-section {
    background: #374151;
    border-color: #4b5563;
}

.dark .npm-attach-btn {
    background: #374151;
    border-color: #4b5563;
    color: #60a5fa;
}

.dark .npm-attach-btn.npm-attach-link {
    color: #34d399;
}

.dark .npm-login-prompt {
    background: rgba(227, 6, 19, 0.08);
    border-color: rgba(227, 6, 19, 0.2);
    color: #9ca3af;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .npm-modal {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        max-width: 100%;
    }

    .npm-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .npm-header {
        padding: 14px 18px;
    }

    .npm-body {
        padding: 16px 18px;
    }

    .npm-footer {
        padding: 12px 18px;
    }

    .btn-new-post {
        padding: 10px 24px;
        font-size: 0.88rem;
    }
}

/* =============================================================
   TOAST NOTIFICATIONS (JS-created)
============================================================= */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 90vw;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: #065f46;
    color: #d1fae5;
}

.toast-error {
    background: #991b1b;
    color: #fee2e2;
}

.toast-info {
    background: #1e3a5f;
    color: #dbeafe;
}

/* =============================================================
   POST ATTACHMENTS – Zdjęcie i Link w poście
============================================================= */
.post-attachment {
    margin-top: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
}

.dark .post-attachment {
    background: #1f2937;
    border-color: #374151;
}

.post-attachment-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    padding: 8px 14px 6px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dark .post-attachment-label {
    border-color: #374151;
}

/* ---- Image attachment ---- */
.post-image-attachment .post-attachment-label i {
    color: #3b82f6;
}

.post-image-link {
    display: block;
    padding: 12px;
}

.post-attached-image {
    display: block;
    max-width: 100%;
    max-height: 480px;
    border-radius: 10px;
    object-fit: contain;
    margin: 0 auto;
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.post-attached-image:hover {
    transform: scale(1.01);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

/* ---- Link attachment ---- */
.post-link-attachment .post-attachment-label i {
    color: #10b981;
}

.post-link-href {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    word-break: break-all;
    transition: background 0.2s;
}

.post-link-href:hover {
    background: rgba(37, 99, 235, 0.05);
    text-decoration: underline;
}

.dark .post-link-href {
    color: #60a5fa;
}

.post-link-href i {
    flex-shrink: 0;
    font-size: 1rem;
}

.post-link-href span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =============================================================
   UPLOAD PROGRESS (in new-post modal)
============================================================= */
.npm-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
}

.npm-upload-area:hover,
.npm-upload-area.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.dark .npm-upload-area {
    border-color: #4b5563;
}

.dark .npm-upload-area:hover {
    background: rgba(59, 130, 246, 0.08);
}

.npm-upload-icon {
    font-size: 2rem;
    color: #9ca3af;
    margin-bottom: 8px;
    display: block;
}

.npm-upload-text {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.npm-upload-limit {
    font-size: 0.72rem;
    color: #9ca3af;
}

.npm-upload-progress {
    height: 4px;
    background: #e5e7eb;
    border-radius: 999px;
    margin-top: 10px;
    overflow: hidden;
    display: none;
}

.npm-upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #E30613, #ff6b6b);
    border-radius: 999px;
    transition: width 0.3s ease;
    width: 0%;
}

.npm-upload-filename {
    font-size: 0.78rem;
    color: #374151;
    margin-top: 8px;
    font-weight: 600;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.dark .npm-upload-filename {
    color: #d1d5db;
}

.npm-upload-success {
    color: #10b981;
}

.npm-upload-error {
    color: #dc2626;
}

/* Tabs w sekcji zdjęcia */
.npm-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.npm-tab-btn {
    flex: 1;
    padding: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.npm-tab-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #2563eb;
}

.dark .npm-tab-btn {
    background: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

.dark .npm-tab-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #60a5fa;
    color: #60a5fa;
}

/* ================================================================
   DARK MODE — rankForum / customForum filter bar & discovery grid
================================================================ */

/* Nieaktywne przyciski filtrów (Top, Ostatni komentarz) */
html.dark .sf-filter-inactive {
    background: #1f2937 !important;
    color: #9ca3af !important;
    border-color: #374151 !important;
}

html.dark .sf-filter-inactive:hover {
    background: #374151 !important;
    color: #e5e7eb !important;
}

/* Filter bar tło — nadpisz inline style w dark */
html.dark #rankFilterBar,
html.dark .customFilterBar {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

/* Posts feed tło — nadpisz inline style */
html.dark #rankPostsFeed,
html.dark [id^="customPostsFeed_"] {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

/* Pagination tło */
html.dark #rankPaginationControls,
html.dark [id^="customPaginationControls_"] {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

/* Discovery grid karty — nadpisz inline background:white na kartach z body */
html.dark #usfDiscoveryGrid>div>div:last-child {
    background: #1f2937 !important;
}

html.dark #usfDiscoveryGrid>div {
    border-color: #374151 !important;
}

html.dark #usfDiscoveryGrid p {
    color: #9ca3af !important;
}

html.dark #usfDiscoveryGrid .usf-member-count {
    color: #6b7280 !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — override inline style="background:white"
   Inline styles mają specyficzność 1,0,0,0 — klasy Tailwind
   dark:bg-gray-800 (0,0,2,0) nie mogą ich nadpisać.
   Używamy !important TYLKO w kontekście .dark/.html.dark
   ═══════════════════════════════════════════════════════════════ */

/* Subforum: city, rank, custom — filter bars, feeds, pagination */
html.dark #cityFilterBar,
html.dark #cityPostsFeed,
html.dark #cityPaginationControls,
html.dark #rankFilterBar,
html.dark #rankPostsFeed,
html.dark #rankPaginationControls,
html.dark .customFilterBar,
html.dark [id^="customPostsFeed_"],
html.dark [id^="customPaginationControls_"] {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

/* Modals z inline background:white */
html.dark #usfCreateModal>div>div,
html.dark #sfJoinModal>div>div,
html.dark #sfNewPostModal>div>div {
    background: #1f2937 !important;
    color: #f3f4f6;
}

html.dark #sfNewPostModal>div>div input,
html.dark #sfNewPostModal>div>div textarea,
html.dark #sfNewPostModal>div>div select {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #f3f4f6 !important;
}

html.dark #sfNewPostModal>div>div label {
    color: #d1d5db !important;
}

html.dark #sfNewPostModal>div>div h3 {
    color: #f9fafb !important;
}

/* Przyciski z inline background:white + onmouseover/onmouseout */
html.dark #sfModalCancelBtn {
    background: #374151 !important;
    color: #d1d5db !important;
    border-color: #4b5563 !important;
}

/* Sekcja oceny pracodawcy */
html.dark .rating-section-wrapper>div[style*="background:white"] {
    background: #1f2937 !important;
}

/* Input fields z inline background:#f3f4f6 */
html.dark #usfCrName,
html.dark #usfCrColorText,
html.dark #usfCrIcon,
html.dark #usfCrDesc,
html.dark #usfCrVisibility,
html.dark #usfCrAccess {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #f3f4f6 !important;
}

/* ---- Dark mode: elementy z hardcoded color w CSS ---- */
html.dark .section-title {
    color: #ffffff !important;
}

/* ---- Zwijanie długich komentarzy rozszerzone ---- */
.comment-text-limiter {
    max-height: 150px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease-out;
}

.comment-text-limiter::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #ffffff);
    pointer-events: none;
}

html.dark .comment-text-limiter::after {
    background: linear-gradient(to bottom, transparent, #1f2937);
    /* Zgodne z .forum-post i bg-gray-800 */
}

.comment-expanded {
    max-height: none !important;
}

.comment-expanded::after {
    display: none;
}

.expand-comment-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    padding: 8px 0;
    color: #E30613;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.2s;
    margin-top: 5px;
}

.expand-comment-btn:hover {
    color: #b8000e;
}

/* ====================================================================
   BBCode inline-styles (2026-05-14)
   ====================================================================
   Klasy generowane przez ContentFormatter::renderInlineStyles() (PHP)
   oraz renderInlineStyles() (JS w post.js).

   Każdy kolor MUSI mieć osobną wartość dla trybu jasnego i ciemnego
   — kontrast względem tła komentarza/posta jest inny. Trzymamy się
   palet z dobrym kontrastem na białym (700-600) oraz przyjemnym
   na ciemnym tle (300-400). Sprawdzono kontrast AA dla typowego
   rozmiaru tekstu komentarza (~14px).

   UWAGA: lista nazw MUSI być zsynchronizowana z:
     - includes/ContentFormatter.php: const ALLOWED_COLORS
     - assets/js/post.js: var BB_ALLOWED_COLORS                       */

/* ── Wspólne właściwości stylów inline ── */
.bb-bold      { font-weight: 700; }
.bb-italic    { font-style: italic; }
.bb-underline { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* ── Bazowa klasa kolorów (defensywnie) ── */
.bb-color {
    /* sam wrapper bez koloru — kolory dochodzą przez bb-color-NAZWA;
       trzymamy puste, żeby przyszłe modyfikacje (np. padding, border)
       miały jeden punkt edycji */
}

/* ── Tryb jasny (default) ── */
.bb-color-red    { color: #dc2626; }
.bb-color-blue   { color: #2563eb; }
.bb-color-green  { color: #16a34a; }
.bb-color-orange { color: #ea580c; }
.bb-color-purple { color: #9333ea; }
.bb-color-pink   { color: #db2777; }
.bb-color-cyan   { color: #0891b2; }
.bb-color-teal   { color: #0d9488; }
.bb-color-gray   { color: #6b7280; }
.bb-color-yellow { color: #ca8a04; } /* unikamy czystego #ffd500 — nieczytelny na białym */
.bb-color-brown  { color: #8b5a2b; }

/* ── Tryb ciemny — jaśniejsze odpowiedniki ── */
.dark .bb-color-red    { color: #f87171; }
.dark .bb-color-blue   { color: #60a5fa; }
.dark .bb-color-green  { color: #4ade80; }
.dark .bb-color-orange { color: #fb923c; }
.dark .bb-color-purple { color: #c084fc; }
.dark .bb-color-pink   { color: #f472b6; }
.dark .bb-color-cyan   { color: #22d3ee; }
.dark .bb-color-teal   { color: #2dd4bf; }
.dark .bb-color-gray   { color: #9ca3af; }
.dark .bb-color-yellow { color: #facc15; }
.dark .bb-color-brown  { color: #d6a878; }

/* ── BBCode [linkbgl] — bezpieczny link zewnętrzny ──
   Renderowany przez ContentFormatter::renderExternalLinks() z atrybutami
   target="_blank" rel="noopener noreferrer nofollow". Styl podkreśla że
   to link wychodzący poza portal (ikona strzałki + kolor brand). */
.bb-extlink {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2563eb;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    word-break: break-all;          /* długie URL-e łamią się w środku */
    overflow-wrap: anywhere;
}
.bb-extlink:hover {
    color: #1d4ed8;
    text-decoration-thickness: 2px;
}
.bb-extlink:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 2px;
}
.bb-extlink > i {
    font-size: 0.85em;
    flex-shrink: 0;
    opacity: 0.75;
}
.dark .bb-extlink         { color: #60a5fa; }
.dark .bb-extlink:hover   { color: #93c5fd; }

/* ── BBCode [{you}] — dynamiczny placeholder z username czytelnika ──
   Server- i klient-side BBCode tworzy <span data-bbcode-you>…</span>, a JS
   (fillBbYouPlaceholders w post.js) podstawia tu nazwę użytkownika
   (lub "Niezalogowany" dla gości). Dlatego placeholder MA być wizualnie
   wyróżniony — żeby admin pisząc tekst wiedział że to placeholder
   personalizowany dla każdego czytelnika.                                       */
.bb-you-placeholder {
    display: inline-block;
    color: #2563eb;
    font-weight: 600;
    background: rgba(37, 99, 235, 0.08);
    padding: 1px 8px;
    border-radius: 4px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    font-size: 0.95em;
    line-height: 1.4;
    transition: background 0.15s ease;
}
.bb-you-placeholder:hover {
    background: rgba(37, 99, 235, 0.15);
}
.dark .bb-you-placeholder {
    color: #93c5fd;
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.25);
}
.dark .bb-you-placeholder:hover {
    background: rgba(96, 165, 250, 0.22);
}