/* ============================================================================
   TABLICA OGŁOSZEŃ - STYLE CSS
   Style fantasy spójne z resztą aplikacji Sala Tronowa
   ============================================================================ */

:root {
    /* Główne kolory zielone */
    --primary-dark: #1B5E20;
    --primary-green: #388E3C;
    --primary-light: #4CAF50;
    
    /* Tła */
    --bg-main: #E9F7EF;
    --bg-sidebar-header: #D4E6D9;
    --bg-card: #F4FDF4;
    --bg-sidebar-item-inactive: #C8E6C9;
    
    /* Tekst */
    --text-primary: #212121;
    --text-on-primary: #FFFFFF;
    --text-secondary: #666666;
    
    /* Kolory akcji */
    --danger-color: #D32F2F;
    --warning-bg: #FFF8E1;
    --warning-text: #8D6E63;
    
    /* Pozostałe */
    --board-border: #C8E6C9;
    --board-shadow: rgba(0, 0, 0, 0.08);
    --board-shadow-hover: rgba(0, 0, 0, 0.12);
}

/* ============================================================================
   LAYOUT GŁÓWNY
   ============================================================================ */

#board-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-main);
    overflow: hidden;
}

/* ============================================================================
   TOP NAVIGATION BAR
   ============================================================================ */

#board-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-sidebar-header);
    border-bottom: 3px solid #2ecc71;
    box-shadow: 0 2px 8px var(--board-shadow);
    flex-wrap: wrap;
    gap: 10px;
}

.board-nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-back {
    padding: 10px 20px;
    background: #333;
    color: #fff;
    border: 2px solid #2ecc71;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.btn-back:hover {
    background: #2ecc71;
    color: #000;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
    transform: translateY(-2px);
}

.btn-back.active {
    background: #2ecc71;
    color: #000;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
}

.board-title {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin: 0;
    text-shadow: none;
    font-weight: bold;
}

.board-nav-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    position: relative;
    padding: 10px 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--board-border);
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: var(--bg-sidebar-item-inactive);
    border-color: var(--primary-green);
}

.filter-btn.active {
    background: var(--primary-dark);
    color: var(--text-on-primary);
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(27, 94, 32, 0.3);
}

.board-nav-right {
    display: flex;
    align-items: center;
}

.btn-add-post {
    padding: 12px 25px;
    background: var(--primary-dark);
    color: var(--text-on-primary);
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(27, 94, 32, 0.2);
}

.btn-add-post:hover {
    background: var(--primary-green);
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.3);
    transform: translateY(-2px);
}

/* ============================================================================
   MAIN CONTENT AREA
   ============================================================================ */

#board-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================================================
   SIDEBAR (przedmioty dla widoku KLASOWA)
   ============================================================================ */

#board-sidebar {
    width: 250px;
    background: var(--bg-sidebar-header);
    border-right: 2px solid var(--primary-green);
    padding: 20px;
    overflow-y: auto;
}

#board-sidebar h3 {
    color: var(--text-primary) !important;
}

/* Kategorie w sidebarze (tylko dla rodzica) */
.sidebar-categories-parent {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-green);
}

.sidebar-category-btn {
    padding: 10px 14px;
    background: var(--bg-sidebar-item-inactive);
    color: var(--text-primary);
    border: 1px solid var(--board-border);
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 0.95rem;
}

.sidebar-category-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary-green);
}

.sidebar-category-btn.active {
    background: var(--primary-dark);
    color: var(--text-on-primary);
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(27, 94, 32, 0.3);
}

#subjects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subject-btn {
    padding: 12px 15px;
    background: var(--bg-sidebar-item-inactive);
    color: var(--text-primary);
    border: 1px solid var(--board-border);
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 1rem;
}

.subject-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary-green);
    box-shadow: 0 2px 8px var(--board-shadow);
}

.subject-btn.active {
    background: var(--primary-dark);
    color: var(--text-on-primary);
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(27, 94, 32, 0.3);
}

/* Kolory przedmiotów w sidebarze (jak w komnacie) */
.subject-btn.color-purple { border-color: #9b59b6; background: rgba(155, 89, 182, 0.15); }
.subject-btn.color-red { border-color: #e74c3c; background: rgba(231, 76, 60, 0.15); }
.subject-btn.color-blue { border-color: #3498db; background: rgba(52, 152, 219, 0.15); }
.subject-btn.color-green { border-color: #2ecc71; background: rgba(46, 204, 113, 0.15); }

/* ============================================================================
   POSTS CONTAINER
   ============================================================================ */

#board-posts-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

#posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================================================
   POST CARD
   ============================================================================ */

.board-post-card {
    background: var(--bg-card);
    border: 1px solid var(--board-border);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px var(--board-shadow);
    transition: all 0.3s;
}

.board-post-card:hover {
    box-shadow: 0 4px 16px var(--board-shadow-hover);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--board-border);
}

.post-author {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 1rem;
}

.post-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.post-category,
.post-category-tag {
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #fff;
}

/* Kolorowe etykiety kategorii (szkolna / klasa+przedmiot / indywidualna) */
.post-category-tag.post-category-school {
    background: #c9a227;
    border: 1px solid #a08020;
}

.post-category-tag.post-category-class.post-category-purple { background: #9b59b6; border-color: #7d3c98; }
.post-category-tag.post-category-class.post-category-red { background: #e74c3c; border-color: #c0392b; }
.post-category-tag.post-category-class.post-category-blue { background: #3498db; border-color: #2980b9; }
.post-category-tag.post-category-class.post-category-green { background: #2ecc71; border-color: #27ae60; }
.post-category-tag.post-category-class:not([class*="post-category-purple"]):not([class*="post-category-red"]):not([class*="post-category-blue"]):not([class*="post-category-green"]) {
    background: var(--primary-green);
}

.post-category-tag.post-category-individual {
    background: #e67e22;
    border: 1px solid #d35400;
}

/* Zachowanie starych klas (bez post-category-tag) */
.post-category.school { background: #c9a227; }
.post-category.class { background: var(--primary-green); }
.post-category.student { background: #e67e22; }

.post-status {
    padding: 10px;
    background: var(--warning-bg);
    border: 2px solid #FFD54F;
    border-radius: 5px;
    color: var(--warning-text);
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

.post-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.post-content {
    color: #000;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1rem;
    white-space: pre-wrap;
}

/* ============================================================================
   FILES LIST - SIATKA ZDJĘĆ (3 KOLUMNY)
   ============================================================================ */

.post-files {
    margin: 15px 0;
}

.post-files-title {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* SIATKA OBRAZKÓW (Grid 3 kolumny) */
.post-files-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.file-grid-item {
    position: relative;
    aspect-ratio: 1 / 1; /* Kwadraty */
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid var(--board-border);
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.3s;
}

.file-grid-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px var(--board-shadow-hover);
    border-color: var(--primary-green);
}

.file-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Przycisk pobierania (na obrazku) */
.file-grid-item .btn-download-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 6px 12px;
    background: rgba(56, 142, 60, 0.9);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.file-grid-item:hover .btn-download-overlay {
    opacity: 1;
}

.btn-download-overlay:hover {
    background: rgba(76, 175, 80, 1);
}

/* LISTA PLIKÓW NIEGRAFICZNYCH (PDF, DOC, itp.) */
.post-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-main);
    border: 1px solid var(--board-border);
    border-radius: 8px;
    transition: all 0.3s;
}

.file-item:hover {
    background: var(--bg-card);
    box-shadow: 0 2px 8px var(--board-shadow);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon {
    font-size: 1.8rem;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 0.95rem;
}

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

.btn-download {
    padding: 8px 15px;
    background: var(--primary-green);
    color: var(--text-on-primary);
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-download:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 8px rgba(56, 142, 60, 0.3);
    transform: translateY(-2px);
}

/* RESPONSYWNOŚĆ - 2 kolumny na mniejszych ekranach */
@media (max-width: 768px) {
    .post-files-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .post-files-grid {
        grid-template-columns: 1fr; /* 1 kolumna na bardzo małych ekranach */
    }
}

/* ============================================================================
   YOUTUBE PLAYER
   ============================================================================ */

.youtube-container {
    margin: 15px 0;
    padding: 15px;
    background: #000;
    border: 1px solid var(--board-border);
    border-radius: 5px;
}

.youtube-container iframe {
    width: 100%;
    max-width: 560px;
    height: 315px;
    border: none;
    border-radius: 5px;
}

.youtube-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background: var(--danger-color);
    color: var(--text-on-primary);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
}

.youtube-link:hover {
    background: #B71C1C;
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.4);
}

/* ============================================================================
   REACTIONS (emoji)
   ============================================================================ */

.post-reactions {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.reaction-btn {
    padding: 8px 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reaction-btn:hover {
    background: var(--bg-sidebar-item-inactive);
    border-color: var(--primary-green);
    transform: scale(1.05);
}

.reaction-btn.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    box-shadow: 0 0 10px rgba(56, 142, 60, 0.3);
    color: var(--text-on-primary);
}

/* ============================================================================
   POST FOOTER (akcje)
   ============================================================================ */

.post-footer {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--board-border);
    flex-wrap: wrap;
}

.post-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.btn-comments {
    background: var(--primary-green);
    color: var(--text-on-primary);
}

.btn-comments:hover {
    background: var(--primary-light);
}

.btn-edit {
    background: var(--primary-green);
    color: var(--text-on-primary);
}

.btn-edit:hover {
    background: var(--primary-light);
}

.btn-delete {
    background: var(--danger-color);
    color: var(--text-on-primary);
}

.btn-delete:hover {
    background: #B71C1C;
}

.btn-approve {
    background: var(--primary-green);
    color: var(--text-on-primary);
}

.btn-approve:hover {
    background: var(--primary-light);
}

.btn-readers {
    background: #5d4037;
    color: var(--text-on-primary);
}

.btn-readers:hover {
    background: #795548;
}

/* ============================================================================
   MODALS
   ============================================================================ */

.board-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
}

.board-modal.active {
    display: flex;
}

/* Okno potwierdzenia zawsze na wierzchu (ponad innymi modalami) */
#confirm-modal {
    z-index: 10000000;
}

.board-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--board-border);
    border-radius: 15px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.readers-modal-content {
    max-width: 500px;
}

.readers-loading,
.readers-error,
.readers-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-primary);
}

.readers-error {
    color: var(--danger-color);
}

.readers-group {
    margin-bottom: 20px;
}

.readers-group-title {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: var(--primary-green);
}

.readers-list {
    margin: 0;
    padding-left: 24px;
    list-style: disc;
    color: #1a1a1a;
}

.readers-list-item {
    margin-bottom: 4px;
    color: #1a1a1a;
}

.board-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-sidebar-header);
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-green);
}

.board-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.board-modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.board-modal-close:hover {
    color: var(--primary-green);
    transform: scale(1.2);
}

.board-modal-body {
    padding: 20px;
}

/* ============================================================================
   FORM STYLES
   ============================================================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #000000; /* Czarny zamiast szarego - lepsza czytelność */
    font-size: 1rem;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--board-border);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    color: #000000; /* Czarny tekst w polach formularza */
    background: #ffffff;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
}

.btn-primary {
    padding: 12px 30px;
    background: var(--primary-green);
    color: var(--text-on-primary);
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 8px rgba(56, 142, 60, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 12px 30px;
    background: #555;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: #666;
}

/* ============================================================================
   PROGRESS BAR
   ============================================================================ */

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #ddd;
    border: 1px solid var(--board-border);
    border-radius: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--board-green) 0%, #27ae60 100%);
    width: 0%;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

/* ============================================================================
   COMMENTS
   ============================================================================ */

.comments-list {
    max-height: 400px;
    overflow-y: auto;
}

.comment-item {
    padding: 15px;
    background: var(--board-white);
    border: 1px solid var(--board-border);
    border-radius: 5px;
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--board-border);
}

.comment-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-author {
    font-weight: bold;
    color: var(--text-primary);
}

.comment-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.comment-content {
    color: #000;
    line-height: 1.5;
}

/* Przyciski Edytuj/Usuń przy komentarzu (tylko dla autora) */
.comment-actions {
    display: inline-flex;
    gap: 8px;
    margin-left: 8px;
}

.btn-edit-comment,
.btn-delete-comment {
    padding: 4px 10px;
    font-size: 0.8rem;
    border: 1px solid var(--board-border);
    border-radius: 4px;
    background: var(--board-white);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-edit-comment:hover {
    background: var(--bg-sidebar-item-inactive);
}

.btn-delete-comment:hover {
    background: #ffebee;
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Reakcje emoji pod komentarzem */
.comment-reactions {
    display: inline-flex;
    gap: 6px;
    margin-top: 8px;
}

.reaction-btn-comment {
    padding: 4px 10px;
    font-size: 0.85rem;
    min-width: auto;
}

/* Inline edycja komentarza */
.comment-edit-wrapper {
    margin-top: 8px;
}

.comment-edit-inline .comment-edit-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--board-border);
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 8px;
}

.comment-edit-buttons {
    display: flex;
    gap: 10px;
}

.btn-save-comment,
.btn-cancel-comment {
    padding: 6px 14px;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--board-border);
}

.btn-save-comment {
    background: var(--primary-green);
    color: var(--text-on-primary);
    border-color: var(--primary-green);
}

.btn-save-comment:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-cancel-comment {
    background: var(--board-white);
}

.btn-cancel-comment:hover {
    background: var(--bg-sidebar-item-inactive);
}

/* ============================================================================
   PODGLĄD OSTATNIEGO KOMENTARZA POD POSTEM (jak na Facebooku)
   ============================================================================ */

.post-last-comment-preview {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    margin: 0 0 10px 0;
    background: var(--bg-card);
    border: 1px solid var(--board-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.post-last-comment-preview:hover {
    background: var(--bg-sidebar-item-inactive);
}

.last-comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-on-primary);
    background: var(--primary-green);
    border-radius: 50%;
}

.last-comment-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.last-comment-author {
    font-weight: bold;
    color: #1a1a1a;
    font-size: 0.9rem;
}

.last-comment-content {
    color: #333333;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.last-comment-date {
    font-size: 0.8rem;
    color: #666666;
}

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

@media (max-width: 768px) {
    #board-top-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .board-nav-filters {
        justify-content: center;
    }

    .board-title {
        font-size: 1.3rem;
        text-align: center;
    }

    #board-sidebar {
        display: none !important;
    }

    #posts-list {
        padding: 10px;
    }

    .board-post-card {
        padding: 15px;
    }

    .post-title {
        font-size: 1.2rem;
    }

    .youtube-container iframe {
        height: 200px;
    }
}

/* ============================================================================
   LIGHTBOX - POWIĘKSZANIE ZDJĘĆ
   ============================================================================ */

.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-in-out;
}

.image-lightbox.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleIn 0.3s ease-in-out;
}

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

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
    padding: 0;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

#lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7);
}

.lightbox-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    min-width: 300px;
}

.lightbox-filename {
    color: white;
    font-weight: bold;
    font-size: 0.95rem;
    flex: 1;
    text-align: left;
    word-break: break-word;
}

.lightbox-download-btn {
    padding: 10px 20px;
    background: var(--primary-green);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
}

.lightbox-download-btn:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(56, 142, 60, 0.5);
    transform: translateY(-2px);
}

/* Responsywność lightbox */
@media (max-width: 768px) {
    .lightbox-close {
        top: -40px;
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }
    
    #lightbox-image {
        max-height: 70vh;
    }
    
    .lightbox-footer {
        flex-direction: column;
        gap: 10px;
        min-width: auto;
        width: 100%;
    }
    
    .lightbox-filename {
        text-align: center;
    }
}

/* ============================================================================
   NOWE STYLE DLA REAKCJI - TOOLTIPS, MENU, ZABLOKOWANE SLOTY
   ============================================================================ */

/* Tooltip reakcji z scrollem (pokazuje WSZYSTKICH użytkowników) */
.reaction-tooltip {
    display: none;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none; /* Nie blokuj kliknięcia w przycisk */
}

.reaction-tooltip .tooltip-content {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Scrollbar dla tooltipa */
.reaction-tooltip::-webkit-scrollbar {
    width: 6px;
}

.reaction-tooltip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.reaction-tooltip::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

/* Pokaż tooltip przy hover */
.reaction-btn:hover .reaction-tooltip {
    display: block;
}

/* Strzałka tooltipa (opcjonalnie) */
.reaction-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
}

/* Menu customowych reakcji (pod przyciskiem ➕) */
.reaction-menu {
    position: fixed;
    background: white;
    border: 2px solid var(--primary-green);
    border-radius: 12px;
    padding: 12px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    min-width: 180px;
    display: none;
}

.reaction-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: all 0.2s;
    font-weight: 500;
}

.reaction-menu-item:hover {
    background: var(--primary-light);
    color: white;
    transform: translateX(4px);
}

/* Przycisk menu reakcji (➕) */
.reaction-menu-btn {
    position: relative;
    font-size: 1.3rem;
    font-weight: bold;
}

.reaction-menu-btn:hover {
    background: var(--bg-sidebar-item-inactive) !important;
    transform: scale(1.1) !important;
}

/* Zablokowane sloty reakcji (🔒) */
.reaction-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto; /* Pozwól na hover dla tooltipa */
}

.reaction-btn.locked:hover {
    transform: none;
    background: #fff;
    border-color: #ddd;
}

.reaction-btn.locked:active {
    transform: none;
}

/* Tooltip dla zablokowanych slotów */
.reaction-btn.locked .reaction-tooltip {
    min-width: auto;
    white-space: nowrap;
}

/* Responsywność dla tooltipów i menu */
@media (max-width: 768px) {
    .reaction-tooltip {
        max-height: 200px;
        min-width: 150px;
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .reaction-menu {
        min-width: 120px;
    }
    
    .reaction-menu button {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
}

/* ============================================================================
   TOGGLE MODERACJI POSTÓW - Admin Panel
   ============================================================================ */

.moderation-section {
    background: #FFFFFF;
    border: 2px solid #C8E6C9;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.moderation-section h3 {
    color: #1B5E20 !important;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.moderation-toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.moderation-toggle-label {
    font-weight: bold;
    color: #212121 !important;
    font-size: 1.1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #388E3C;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.moderation-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #FFF8E1;
    border: 1px solid #C8E6C9;
    border-radius: 5px;
    font-weight: bold;
    color: #212121 !important;
}

.moderation-status.active {
    background: #C8E6C9;
    border-color: #388E3C;
    color: #1B5E20 !important;
}

.moderation-info {
    background: #F5F5F5;
    border-left: 4px solid #388E3C;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
}

.moderation-info h4 {
    margin: 0 0 10px 0;
    color: #1B5E20 !important;
    font-size: 1rem;
    font-weight: bold;
}

.moderation-info ul {
    margin: 0;
    padding-left: 20px;
}

.moderation-info li {
    margin: 5px 0;
    color: #333333 !important;
    font-weight: 500;
}

/* Responsywność dla toggle moderacji */
@media (max-width: 768px) {
    .moderation-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .moderation-section h3 {
        font-size: 1.1rem;
    }
    
    .moderation-toggle-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .moderation-toggle-label {
        font-size: 1rem;
    }
    
    .moderation-info {
        padding: 12px;
        margin: 10px 0;
    }
    
    .moderation-info h4 {
        font-size: 0.9rem;
    }
    
    .moderation-info li {
        font-size: 0.85rem;
    }
}

/* ============================================================================
   SELEKTORY KLAS I UCZNIÓW (AGORA REDESIGN V2 - INLINE)
   ============================================================================ */

/* Kontenery dropdownów - teraz inline w linii z przyciskami */
#class-selector-container,
#student-selector-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Style dla inline selektorów (dropdownów) */
.inline-selector {
    padding: 10px 15px;
    border: 2px solid #2ecc71;
    border-radius: 5px;
    background: white;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    min-width: 150px;
    transition: all 0.3s ease;
    color: #2c3e50;
}

.inline-selector:hover {
    background: #f0f0f0;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
    transform: translateY(-1px);
}

.inline-selector:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
}

/* Style dla inline tekstów (gdy tylko 1 opcja) */
.inline-text-display {
    font-size: 0.95rem;
    color: #2c3e50;
    padding: 10px 15px;
    background: #e8f5e9;
    border-radius: 5px;
    border: 2px solid #2ecc71;
    font-weight: bold;
    white-space: nowrap;
}

/* Responsywność dla selektorów */
@media (max-width: 1024px) {
    .board-nav-filters {
        flex-wrap: wrap;
        gap: 8px !important;
    }
    
    #class-selector-container,
    #student-selector-container {
        flex: 1 1 auto;
        min-width: 200px;
    }
    
    .inline-selector {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .board-nav-filters {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    #class-selector-container,
    #student-selector-container {
        width: 100%;
        justify-content: space-between;
    }
    
    .inline-selector,
    .inline-text-display {
        flex: 1;
        width: auto;
    }
    
    .filter-btn {
        width: 100%;
    }
}

/* ============================================================================
   CLIPBOARD PASTE - Style dla podglądu wklejonych obrazków
   ============================================================================ */

.clipboard-preview-container {
    background: #f9f9f9;
    border: 2px dashed #2196f3;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.clipboard-preview-container::before {
    content: '📎 Wklejone obrazki:';
    display: block;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.clipboard-preview-item {
    display: inline-block;
    position: relative;
    margin: 5px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    padding: 5px;
    vertical-align: top;
    width: 120px;
    transition: all 0.3s ease;
}

.clipboard-preview-item:hover {
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    transform: translateY(-2px);
}

.clipboard-preview-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
    margin: 0 auto;
}

.clipboard-preview-info {
    margin-top: 5px;
    text-align: center;
}

.clipboard-preview-filename {
    font-size: 0.75em;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

.clipboard-preview-filesize {
    font-size: 0.7em;
    color: #999;
    margin-top: 2px;
}

.clipboard-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.clipboard-preview-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.clipboard-preview-remove:active {
    transform: scale(0.95);
}

/* Responsywność dla małych ekranów */
@media (max-width: 768px) {
    .clipboard-preview-item {
        width: 100px;
    }
    
    .clipboard-preview-image {
        width: 80px;
        height: 80px;
    }
    
    .clipboard-preview-filename {
        max-width: 80px;
    }
}

/* ============================================================================
   WIDOK KAFELKOWY - OSTATNI POST I HISTORIA
   ============================================================================ */

/* Ostatni post (wyróżniony) */
.latest-post-featured {
    border: 3px solid #f39c12;
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.3);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(243, 156, 18, 0.3);
    }
    50% {
        box-shadow: 0 6px 30px rgba(243, 156, 18, 0.5);
    }
}

/* Separator między ostatnim postem a historią */
.posts-separator {
    margin: 30px 0;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    text-align: center;
}

.posts-separator h3 {
    color: #fff;
    margin: 0;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Nagłówek miesiąca */
.month-header {
    margin: 30px 0 15px 0;
    padding: 10px 20px;
    background: #388E3C;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.month-header h3 {
    margin: 0;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff !important;
}

/* Siatka kafelków (4 kolumny) */
.posts-tiles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

/* Kafelek (zwinięty) */
.post-tile {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
    overflow: hidden;
}

.post-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.post-tile.expanded {
    grid-column: span 2;  /* Rozwinięty = 2 kolumny */
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    z-index: 10;
}

.tile-compact {
    padding: 15px;
    border: 3px solid transparent;
}

/* Obramowania PD */
.tile-border-blue {
    border-color: #3498db;  /* Zadana */
}

.tile-border-green {
    border-color: #27ae60;  /* Zrobiona */
}

.tile-date {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-weight: bold;
}

.tile-topic {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.grade-badge {
    display: inline-block;
}

.tile-rune {
    font-size: 1.3rem;
    animation: runeGlow 2s infinite;
}

@keyframes runeGlow {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.1); 
    }
}

.tile-icons {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    color: #95a5a6;
}

/* Kafelek (rozwinięty) */
.tile-expanded {
    padding: 15px;
    border-top: 2px solid #e0e0e0;
    background: #f9f9f9;
    animation: slideDown 0.3s ease-out;
    color: #000 !important; /* ZAWSZE czarny tekst */
}

/* Upewnij się że wszystkie teksty w rozwiniętym kafelku są czarne */
.tile-expanded * {
    color: #000 !important;
}

/* Wyjątki dla przycisków i linków */
.tile-expanded .btn-primary,
.tile-expanded .btn-secondary,
.tile-expanded .btn-comments,
.tile-expanded .btn-readers,
.tile-expanded .btn-edit,
.tile-expanded .btn-delete,
.tile-expanded .btn-approve,
.tile-expanded a {
    color: #fff !important; /* Białe dla przycisków */
}

/* Badge z oceną - zachowaj kolory */
.tile-expanded .grade-badge {
    /* Kolory z board-helpers.js są inline, więc !important nie jest potrzebne */
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

/* ============================================================================
   RESPONSYWNOŚĆ DLA KAFELKÓW
   ============================================================================ */

@media (max-width: 1400px) {
    .posts-tiles-grid {
        grid-template-columns: repeat(3, 1fr);  /* 3 kolumny */
    }
}

@media (max-width: 1024px) {
    .posts-tiles-grid {
        grid-template-columns: repeat(2, 1fr);  /* 2 kolumny */
    }
}

@media (max-width: 768px) {
    .posts-tiles-grid {
        grid-template-columns: 1fr;  /* 1 kolumna */
    }
    
    .post-tile.expanded {
        grid-column: span 1;
    }
    
    .posts-separator h3 {
        font-size: 1.2rem;
    }
    
    .month-header h3 {
        font-size: 1.1rem;
    }
}

/* ============================================================================
   SEKCJA PUNKTACJI DLA RODZICA/UCZNIA W FOOTERZE POSTA
   ============================================================================ */

/* Sekcja punktacji dla rodzica/ucznia w footerze posta */
.post-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.post-footer > div:first-child {
    /* Sekcja punktacji (ocena + runa) */
    flex-shrink: 0;
}

/* ============================================================================
   LISTA CHRONOLOGICZNA POSTÓW (ZAMIAST KAFELKÓW)
   ============================================================================ */

.posts-chronological-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.post-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    background: #fff;
    border: 2px solid #5d4037;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.post-list-item:hover {
    background: #f9f4e8;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Data po lewej stronie */
.list-item-date {
    flex-shrink: 0;
    width: 90px;
    min-width: 90px;
    font-weight: bold;
    font-size: 1rem;
    color: #5d4037;
    text-align: center;
    padding: 8px 6px;
    background: #e1b12c;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    white-space: nowrap;
}

/* Temat - zajmuje maksymalnie miejsca */
.list-item-topic {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Punkty (ocena + runa + PD) – min-width żeby kolumna zawsze była widoczna */
.list-item-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 80px;
}
.list-item-grade-none {
    color: #bdc3c7;
    font-size: 1.1rem;
    font-weight: bold;
}

.list-item-rune {
    font-size: 1.5rem;
}

/* Ikonka PD na pasku (zrobiona / zadana) */
.list-item-pd {
    font-size: 0.8rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.list-item-pd-done {
    background: #27ae60;
    color: #fff;
}
.list-item-pd-pending {
    background: #ecf0f1;
    color: #7f8c8d;
}

/* Ikony (załączniki, YouTube, komentarze) */
.list-item-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    color: #666;
}

/* Obramowanie dla prac domowych */
.list-item-border-blue {
    border-left: 6px solid #3498db;
    background: linear-gradient(90deg, #e3f2fd 0%, #fff 15%);
}

.list-item-border-green {
    border-left: 6px solid #27ae60;
    background: linear-gradient(90deg, #e8f5e9 0%, #fff 15%);
}

/* ============================================================
   LEGENDA KAMPANII (pod nagłówkiem "Poprzednie zajęcia")
   ============================================================ */
.campaign-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 4px 6px;
}

.campaign-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #3d2b1f;
    cursor: default;
    border: 1.5px solid rgba(0,0,0,0.12);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.campaign-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0,0,0,0.25);
    flex-shrink: 0;
}

/* Nagłówek miesiąca */
.month-header {
    margin: 25px 0 15px 0;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.month-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Responsywność dla małych ekranów */
@media (max-width: 768px) {
    .post-list-item {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .list-item-date {
        width: 80px;
        min-width: 80px;
        font-size: 0.85rem;
        padding: 6px 4px;
    }
    
    .list-item-topic {
        flex: 1 1 100%;
        order: 3;
        white-space: normal;
        margin-top: 5px;
    }
    
    .list-item-badges {
        order: 1;
    }
    
    .list-item-icons {
        order: 2;
        margin-left: auto;
    }
}

/* ============================================================================
   WAŻNE POSTY - banner, obramowanie, badge, animacja
   ============================================================================ */

.post-important-banner {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    margin: -15px -20px 15px -20px;
    letter-spacing: 1px;
    animation: importantPulse 2s ease-in-out infinite;
}

.post-card-important {
    border: 2px solid #e74c3c !important;
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.3) !important;
}

.post-tile-important .tile-compact {
    border-left: 4px solid #e74c3c !important;
}

.post-list-item-important {
    border-left: 4px solid #e74c3c !important;
    background: rgba(231, 76, 60, 0.04) !important;
}

.important-badge {
    display: inline-block;
    margin-right: 4px;
    font-size: 1rem;
    animation: importantPulse 2s ease-in-out infinite;
}

@keyframes importantPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Pulsujący alert "WAŻNE" na mapie wioski */
.board-important-alert {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #e74c3c;
    font-weight: bold;
    font-size: 0.9rem;
    animation: importantPulse 1.5s ease-in-out infinite;
}

/* ============================================================================
   MOBILE PORTRAIT (KM-MOBILE-HUB krok 4)
   Kompaktowy header, scrollowane filtry, posty pelnej szerokosci.
   ============================================================================ */
@media (max-width: 768px) and (orientation: portrait) {
    /* Header — kompaktowy, tytul nie na absolute */
    #board-top-nav {
        padding: 10px 8px !important;
        flex-direction: column;
        gap: 8px;
    }

    #board-top-nav > div:first-child {
        flex-wrap: wrap;
        gap: 8px !important;
        margin-bottom: 6px !important;
    }

    .board-title {
        position: static !important;
        transform: none !important;
        font-size: 1.1rem !important;
        order: -1;
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 4px;
    }

    .btn-back,
    .btn-add-post,
    .btn-logout {
        padding: 7px 10px !important;
        font-size: 0.78rem !important;
    }

    #user-info-display {
        display: none !important;
    }

    #student-selector-container {
        font-size: 0.82rem;
    }

    /* Filtry — scrollowane poziomo, wieksze kafelki */
    .board-nav-filters {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start !important;
        gap: 6px !important;
        padding: 4px 8px !important;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .board-nav-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex-shrink: 0 !important;
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
    }

    /* Wybor ucznia w filtrach: do osobnego rzedu */
    #student-selector-inline {
        margin-left: 0 !important;
        flex-basis: 100%;
        margin-top: 4px;
    }

    /* View header — kompaktowy */
    #current-view-header {
        padding: 10px 12px !important;
        font-size: 0.9rem !important;
        margin-bottom: 10px !important;
        border-radius: 8px !important;
    }

    /* Posty pelnej szerokosci, kompaktowy padding */
    #board-main {
        padding: 8px !important;
    }

    #posts-list {
        padding: 0 !important;
    }

    .board-post-card {
        padding: 12px !important;
        margin-bottom: 12px !important;
        border-radius: 10px !important;
    }

    .post-title {
        font-size: 1.05rem !important;
        line-height: 1.3;
    }

    .post-content,
    .post-text {
        font-size: 0.92rem;
        line-height: 1.4;
    }

    .youtube-container iframe {
        height: 180px !important;
    }

    /* Lightbox close — wiekszy touch target */
    .lightbox-close {
        width: 56px;
        height: 56px;
        font-size: 2rem;
        top: -64px;
        right: -4px;
    }

    /* Modal dodawania posta — pelny ekran */
    .board-modal-content {
        width: 96% !important;
        max-width: 96% !important;
        max-height: 92vh !important;
        margin: 4vh auto !important;
        border-radius: 12px !important;
    }

    .board-modal-body {
        padding: 12px !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important; /* iOS zoom prevention */
    }
}
