/**
 * FOTOFERIA FORUM - MODERN STYLES
 * Nowoczesny design dla forum w stylu ciemnym
 */

/* ============================================================================
   FORUM CONTAINER
   ============================================================================ */

#f_title {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
}

#f_title a {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-base);
}

#f_title a:hover {
    color: #ffbf00;
}

/* ============================================================================
   FORUM LIST (DZIAŁY)
   ============================================================================ */

.forums {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: center;
}

.forums:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-color: var(--border-light);
}

.forums .icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 191, 0, 0.1);
    border-radius: var(--radius-lg);
}

.forums .icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.forums .title {
    flex: 1;
    min-width: 200px;
}

.forums .title a {
    color: var(--text-light);
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-base);
    display: block;
    margin-bottom: var(--space-2);
}

.forums .title a:hover {
    color: #ffbf00;
}

.forums .descr {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: var(--space-2);
    width: 100%;
}

.forums .stats {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.forums .last {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    width: 100%;
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-color);
}

.forums .last a {
    color: var(--text-primary);
    text-decoration: none;
}

.forums .last a:hover {
    color: #ffbf00;
}

.forums .last_post_date {
    font-weight: 500;
}

/* ============================================================================
   TOPICS LIST (TEMATY)
   ============================================================================ */

.topics {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base), background var(--transition-base);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: 
        "icon title stats"
        "icon title last"
        "icon descr last";
    gap: var(--space-3) var(--space-4);
    align-items: start;
    position: relative;
}

.topics:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.02);
}

/* Przypięte tematy - wyróżnione (gdy jest ikona pin) */
.topics:has(.icon img[src*="pin"]) {
    background: linear-gradient(135deg, rgba(255, 191, 0, 0.08) 0%, var(--bg-card) 100%);
    border-left: 4px solid #ffbf00;
    padding-left: calc(var(--space-5) - 4px);
}

.topics .icon {
    grid-area: icon;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 191, 0, 0.15);
    border-radius: var(--radius-md);
    align-self: start;
}

/* Ukryj pustą ikonę (tematy bez przypięcia) */
.topics .icon:empty {
    display: none;
}

.topics .icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(69%) sepia(100%) saturate(7441%) hue-rotate(359deg) brightness(101%) contrast(101%);
    display: block;
}

.topics .title {
    grid-area: title;
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    flex-direction: column;
}

.topics .title a {
    color: var(--text-light);
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-base);
    display: block;
    line-height: 1.4;
    word-wrap: break-word;
}

.topics .title a:hover {
    color: #ffbf00;
}

.topics .descr {
    grid-area: descr;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    font-style: italic;
    margin-top: var(--space-2);
}

/* Ukryj pusty opis */
.topics .descr:empty {
    display: none;
}

.topics .stats {
    grid-area: stats;
    color: var(--text-muted);
    font-size: 0.8125rem;
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    white-space: nowrap;
    text-align: center;
    line-height: 1.5;
    font-weight: 500;
    align-self: start;
    justify-self: end;
}

.topics .last {
    grid-area: last;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-align: right;
    line-height: 1.5;
    align-self: start;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.topics .last a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-base);
    display: inline-block;
}

.topics .last a:hover {
    color: #ffbf00;
}

.topics .last_post_date {
    font-weight: 500;
    color: var(--text-light);
    display: block;
    margin-bottom: var(--space-1);
}

/* Forum Title Header */
#forum-title.active.forums {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    border-radius: 0;
}

#forum-title.active.forums:hover {
    transform: none;
    box-shadow: none;
}

#forum-title.active.forums .title {
    font-size: 1.5rem;
    color: var(--text-light);
    font-weight: 600;
}

#forum-title.active.forums .stats {
    margin-top: var(--space-2);
}

#forum-title.active.forums .last a {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--text-white);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    display: inline-block;
    text-decoration: none !important;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    font-weight: 500;
    border: none;
}

#forum-title.active.forums .last a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(176, 3, 3, 0.3);
}

/* ============================================================================
   POSTS (POSTY)
   ============================================================================ */

.posts {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    display: flex;
    gap: var(--space-5);
    transition: border-color var(--transition-base);
}

.posts:hover {
    border-color: var(--border-light);
}

.posts .author {
    flex-shrink: 0;
    width: 150px;
    text-align: center;
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
}

.posts .author img {
    border-radius: 50%;
    margin: var(--space-2) 0;
    border: 2px solid var(--border-color);
}

.posts .author .author_username,
.posts .author a {
    color: var(--text-light);
    font-weight: 500;
    text-decoration: none;
    display: block;
    margin-top: var(--space-2);
    font-size: 0.9375rem;
}

.posts .author a:hover {
    color: #ffbf00;
}

.posts .author .date_add {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-bottom: var(--space-2);
}

.posts .author .more_info {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: var(--space-2);
}

.posts .post {
    flex: 1;
    min-width: 0;
}

.posts .post .comments_text {
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.posts .post .comments_text p {
    margin: var(--space-3) 0;
}

.posts .post .comments_text img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--space-2) 0;
}

.posts .quote_comments,
.posts .quote_comments_a {
    display: none !important;
    margin-top: var(--space-3);
    margin-right: var(--space-3);
    padding: var(--space-2) var(--space-4) !important;
    background: linear-gradient(135deg, rgba(255, 191, 0, 0.2) 0%, rgba(255, 191, 0, 0.15) 100%) !important;
    color: #ffbf00 !important;
    text-decoration: none !important;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all var(--transition-base);
    border: 1px solid rgba(255, 191, 0, 0.4);
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.posts .quote_comments:hover,
.posts .quote_comments_a:hover {
    background: linear-gradient(135deg, rgba(255, 191, 0, 0.3) 0%, rgba(255, 191, 0, 0.25) 100%) !important;
    border-color: rgba(255, 191, 0, 0.6);
    color: #ffd700 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 191, 0, 0.3);
}

/* Pokaż przyciski cytowania na hover nad postem */
.posts:hover .quote_comments_a {
    display: inline-block !important;
}

/* Pokaż przycisk "Cytuj zaznaczenie" gdy jest zaznaczony tekst */
.posts .quote_comments.show,
.posts .quote_comments:not([style*="display: none"]) {
    display: inline-block !important;
}

/* Reset starych stylów */
.posts .quote_comments_a,
.posts .quote_comments {
    float: none !important;
    font-size: 0.8125rem !important;
    margin-left: 0 !important;
    margin-right: var(--space-3) !important;
}

.posts .edit {
    display: inline-block;
    margin-top: var(--space-3);
    margin-right: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, rgba(176, 3, 3, 0.25) 0%, rgba(176, 3, 3, 0.2) 100%);
    color: var(--color-primary-light);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition-base);
    border: 1px solid rgba(176, 3, 3, 0.4);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.posts .edit:hover {
    background: linear-gradient(135deg, rgba(176, 3, 3, 0.35) 0%, rgba(176, 3, 3, 0.3) 100%);
    border-color: rgba(176, 3, 3, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(176, 3, 3, 0.3);
}

.posts .mod_info {
    display: block;
    margin-top: var(--space-2);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

/* ============================================================================
   FORMS (FORMULARZE)
   ============================================================================ */

#new_topic {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-6);
    margin-top: var(--space-5);
    margin-bottom: var(--space-5);
}

#new_topic label {
    display: block;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: var(--space-2);
    margin-top: var(--space-4);
}

#new_topic label:first-child {
    margin-top: 0;
}

#new_topic input[type="text"],
#new_topic textarea {
    width: 100%;
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color var(--transition-base), background var(--transition-base);
    box-sizing: border-box;
}

#new_topic input[type="text"]:focus,
#new_topic textarea:focus {
    outline: none;
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.08);
}

#new_topic textarea {
    min-height: 200px;
    resize: vertical;
}

#new_topic input[type="submit"] {
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-6);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

#new_topic input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(176, 3, 3, 0.3);
}

#new_topic div[style*="font-size:10px"] {
    margin-top: var(--space-2);
    color: var(--text-muted);
    font-size: 0.75rem !important;
}

/* ============================================================================
   PAGINATION - NOWOCZESNY STYL Z NADPISANIEM STARYCH STYLÓW
   ============================================================================ */

.paginate {
    display: flex !important;
    align-items: center !important;
    gap: var(--space-2) !important;
    margin: var(--space-6) 0 !important;
    flex-wrap: wrap !important;
    padding: var(--space-4) 0 !important;
    border-top: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-left: none !important;
    border-right: none !important;
    /* Reset starych stylów */
    margin-top: var(--space-6) !important;
    margin-bottom: var(--space-6) !important;
}

.paginate::before,
.paginate::after {
    display: none !important;
    content: none !important;
}

.paginate_title {
    color: var(--text-secondary) !important;
    font-size: 0.875rem !important;
    margin-right: var(--space-3) !important;
    font-weight: 500 !important;
    /* Reset starych stylów */
    float: none !important;
    width: auto !important;
}

.paginate .pg {
    display: inline-block !important;
    position: relative !important;
    margin: 0 !important;
    z-index: 1 !important;
    /* Reset starych stylów z main.css */
    float: none !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
    margin-right: 0 !important;
}

.paginate .pg a {
    display: block !important;
    padding: var(--space-2) var(--space-4) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: #ffde3b !important;
    text-decoration: none !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    transition: all var(--transition-base) !important;
    min-width: 40px !important;
    text-align: center !important;
    line-height: 1.5 !important;
    box-shadow: none !important;
    /* Reset starych stylów */
    border-bottom: none !important;
    border-top: none !important;
    border-left: 1px solid var(--border-color) !important;
    border-right: 1px solid var(--border-color) !important;
    text-decoration-line: none !important;
    text-underline-offset: 0 !important;
    outline: none !important;
}

.paginate .pg a:visited,
.paginate .pg a:link,
.paginate .pg a:active {
    text-decoration: none !important;
    border-bottom: none !important;
    border-top: none !important;
    color: #ffde3b !important;
}

.paginate .pg a:hover {
    background: rgba(255, 222, 59, 0.15) !important;
    border-color: rgba(255, 222, 59, 0.4) !important;
    color: #ffde3b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.paginate .pg.selected,
.paginate .pg.selected a,
.paginate .pg a.selected {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%) !important;
    border-color: var(--color-primary) !important;
    color: var(--text-white) !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(176, 3, 3, 0.4) !important;
    z-index: 2 !important;
    position: relative !important;
}

.paginate .pg.selected a:hover,
.paginate .pg a.selected:hover {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(176, 3, 3, 0.5) !important;
}

/* ============================================================================
   LAST POSTS
   ============================================================================ */

#f_title + div {
    margin-bottom: var(--space-6);
}

.last_posts.topics {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.last_posts.topics:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-color: var(--border-light);
}

.last_posts.topics .title a {
    color: var(--text-light);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-base);
}

.last_posts.topics .title a:hover {
    color: #ffbf00;
}

.last_posts.topics .last {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-color);
}

.last_posts.topics .last a {
    color: var(--text-primary);
    text-decoration: none;
}

.last_posts.topics .last a:hover {
    color: #ffbf00;
}

.last_posts.topics .last_post_date {
    font-weight: 500;
}

/* Nagłówek sekcji ostatnich postów */
#f_title + div:before {
    content: attr(data-title);
    display: block;
    color: var(--text-light);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
}

/* ============================================================================
   RESPONSIVE - MOBILE
   ============================================================================ */

@media (max-width: 767px) {
    .forums {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .forums .icon {
        align-self: center;
    }
    
    .forums .stats {
        width: 100%;
        text-align: center;
    }
    
    .topics {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "title"
            "descr"
            "icon"
            "stats"
            "last";
        gap: var(--space-3);
        padding: var(--space-4);
    }
    
    .topics .icon {
        grid-area: icon;
        width: 40px;
        height: 40px;
        align-self: flex-start;
        justify-self: flex-start;
    }
    
    .topics .icon img {
        width: 24px;
        height: 24px;
    }
    
    .topics .title {
        grid-area: title;
        margin-bottom: var(--space-2);
    }
    
    .topics .title a {
        font-size: 1rem;
    }
    
    .topics .descr {
        grid-area: descr;
        margin-top: 0;
    }
    
    .topics .stats {
        grid-area: stats;
        width: 100%;
        text-align: center;
        justify-self: stretch;
    }
    
    .topics .last {
        grid-area: last;
        text-align: left;
        padding-top: var(--space-2);
        border-top: 1px solid var(--border-color);
        margin-top: var(--space-2);
        min-width: auto;
        width: 100%;
    }
    
    .posts {
        flex-direction: column;
    }
    
    .posts .author {
        width: 100%;
        display: flex;
        align-items: center;
        gap: var(--space-3);
        text-align: left;
        padding: var(--space-3);
    }
    
    .posts .author img {
        margin: 0;
        width: 48px;
        height: 48px;
    }
    
    .posts .author .date_add {
        margin-bottom: 0;
        margin-left: auto;
    }
    
    #new_topic {
        padding: var(--space-4);
    }
    
    .paginate {
        justify-content: center;
        padding: var(--space-3) 0;
    }
    
    .paginate_title {
        width: 100%;
        text-align: center;
        margin-bottom: var(--space-2);
        margin-right: 0;
    }
    
    .paginate .pg a {
        min-width: 36px;
        padding: var(--space-2) var(--space-3);
        font-size: 0.8125rem;
    }
}

/* ============================================================================
   CLEARFIX
   ============================================================================ */

.clear {
    clear: both;
    height: 0;
    line-height: 0;
    font-size: 0;
}

/* ============================================================================
   TOPIC ANSWER FORM
   ============================================================================ */

#topic-answer.topics {
    background: rgba(255, 191, 0, 0.05);
    border-color: rgba(255, 191, 0, 0.3);
}

#topic-answer.topics .answer a {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, #ffbf00 0%, #e6ac00 100%);
    color: #0f0f0f;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

#topic-answer.topics .answer a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 191, 0, 0.3);
}

/* ============================================================================
   NO TOPICS MESSAGE
   ============================================================================ */

.forums .title.tac {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: var(--space-8) 0;
    width: 100%;
}

