/* Veći font u SCEditor textarea i iframe */
.sceditor-container iframe,
.sceditor-container textarea {
    font-size: 17px !important;
}

/* Povećanje visine SCEditor textarea */
.sceditor-container textarea {
    height: 350px !important;
    /* nova visina */
    flex-basis: 350px !important;
    /* isto kao početna visina */
}

/* Change shoutbox date/time color to dark gray */
.shoutbox_time {
    color: #444444 !important;
}

/* Styling for HVALA button - Final Fix for centering and shadow removal */
.quickbuttons li.thank_you_button_link,
.quickbuttons li.withdraw_thank_you_button_link {
    display: inline-block !important;
    float: none !important;
    vertical-align: middle !important;
    padding: 0 !important;
    margin: 0 5px 0 0 !important;
}

/* -------------------------- */
/* BASE BUTTON STYLING        */
/* -------------------------- */
.quickbuttons li.thank_you_button_link a,
.quickbuttons li.withdraw_thank_you_button_link a {
    border-radius: 4px !important;
    padding: 0 8px !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-transform: none !important;
    font-size: 11px !important;
    line-height: 22px !important;
    height: 22px !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 50px !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

/* -------------------------- */
/* ACTIVE BUTTON (Hvala)      */
/* -------------------------- */
.quickbuttons li.thank_you_button_link a {
    border: 1px solid #ff0000 !important;
    color: inherit !important;
    transition: all 0.2s ease-in-out !important;
    cursor: pointer !important;
    box-shadow: 0px 0px 6px rgba(255, 0, 0, 0.5) !important;
}

.quickbuttons li.thank_you_button_link a:hover {
    color: #ff0000 !important;
    border-color: #ff0000 !important;
    text-decoration: none !important;
    box-shadow: 0px 0px 10px rgba(255, 0, 0, 0.8) !important;
}

/* -------------------------- */
/* DISABLED BUTTON (Withdraw) */
/* -------------------------- */
.quickbuttons li.withdraw_thank_you_button_link a {
    border: 1px solid #555555 !important;
    color: #777777 !important;
    transition: none !important;
    cursor: default !important;
    /* Makes it look unclickable */
}

.quickbuttons li.withdraw_thank_you_button_link a:hover {
    color: #777777 !important;
    border-color: #555555 !important;
    text-decoration: none !important;
}

/* Neutralisanje ikone i bilo kakvih pseudo-elemenata koji guraju tekst u stranu */
.quickbuttons li.thank_you_button_link a::before,
.quickbuttons li.withdraw_thank_you_button_link a::before,
.quickbuttons li.thank_you_button_link a span.main_icons,
.quickbuttons li.withdraw_thank_you_button_link a span.main_icons {
    display: none !important;
    content: "" !important;
    width: 0 !important;
    margin: 0 !important;
}

.quickbuttons li.thank_you_button_link a span,
.quickbuttons li.withdraw_thank_you_button_link a span {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
    line-height: inherit !important;
    text-align: center !important;
}

/* --- Styling for the Poster area in topic view (Card Design - Dark Theme) --- */

/* 1. Main flex container to allow reordering avatar and details */
.poster {
    display: flex !important;
    flex-direction: column !important;
    background-color: transparent !important;
    /* Keep the forum's black background */
    border: 1px solid #5c5c5c !important;
    /* Medium-dark border */
    border-radius: 6px !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    height: max-content !important;
    height: -moz-max-content !important;
    height: -webkit-max-content !important;
    align-self: flex-start !important;
    /* Prevent stretching if parent is flexing */
}

/* 2. Un-box the UL so LIs become children of the flex container */
.poster ul.user_info {
    display: contents !important;
}

/* 3. Base style for all internal "cards" */
.poster .avatar,
.poster h4,
.poster ul.user_info>li {
    display: block !important;
    background-color: #1a1a1a !important;
    /* Dark gray for cards */
    border: 1px solid #333333 !important;
    /* Slightly lighter border for contrast */
    border-radius: 4px !important;
    margin: 0 0 6px 0 !important;
    padding: 6px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: unset !important;
    color: #dddddd;
    /* Light text for readability (no !important so inline colors work) */
}

/* 4. Username block (Dark gray to fit black background, placed at Top) */
.poster h4 {
    order: 1 !important;
    background-color: #262626 !important;
    /* Slightly more visible dark gray */
    border-color: #363636 !important;
    margin-top: 0 !important;
    font-size: 14px !important;
    padding: 8px !important;
}

.poster h4 a,
.poster h4 a:hover {
    text-shadow: none !important;
}

/* 5. Role Titles (Placed below username) */
.poster ul.user_info .title,
.poster ul.user_info .membergroup,
.poster ul.user_info .postgroup {
    order: 2 !important;
    font-weight: bold !important;
}

/* 6. Group Badges / Icons (Placed below Titles) */
.poster ul.user_info .icons {
    order: 3 !important;
}

/* 7. Avatar (Placed below badges) */
.poster .avatar {
    order: 4 !important;
    padding: 10px !important;
    /* bit more padding for avatar */
    background-color: #111111 !important;
    /* Slightly darker for avatar container */
}

/* 8. Everything Else (Stats, custom fields, placed below Avatar) */
.poster ul.user_info>li:not(.title):not(.membergroup):not(.postgroup):not(.icons) {
    order: 5 !important;
    color: #cccccc !important;
    font-size: 13px !important;
}

/* 9. Ensure images scale well */
.poster .avatar img,
.poster ul.user_info>li img {
    max-width: 100% !important;
    height: auto !important;
    display: inline-block !important;
}

/* 10. Fix profile icons list (PM, WWW, Email) */
.poster ul.user_info .profile ol {
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
    gap: 15px !important;
    list-style: none !important;
}

.poster ul.user_info .profile ol li {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    /* remove inner lis background if any */
}

/* Remove margin from the very last element (usually profile icons) */
.poster ul.user_info .profile {
    margin-bottom: 0 !important;
}

/* Hide empty elements from being rendered as lines/empty boxes */
.poster ul.user_info>li:empty,
.poster ul.user_info>li:not(:first-child):not(:nth-child(n+2)) {
    display: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Specifically hide known wrappers if empty or just containing white-space */
.poster ul.user_info .im_icons:empty,
.poster ul.user_info .im_icons:has(ol:empty),
.poster ul.user_info .profile:empty,
.poster ul.user_info .profile:has(ol:empty),
.poster ul.user_info .profile:has(> *:empty:only-child),
.poster ul.user_info .custom:empty,
.poster ul.user_info .blurb:empty,
.poster ul.user_info .warning:empty,
.poster ul.user_info .poster_ip:empty,
.poster ul.user_info>li:has(> *:empty:only-child),
.poster ul.user_info>li:has(> ol:empty) {
    display: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
}

/* Fallback for items with just empty space (no text/content) */
.poster ul.user_info>li {
    min-height: 0;
}

/* --- Increase spacing between individual posts in a topic --- */
#forumposts .windowbg,
#forumposts .approvebg {
    margin-bottom: 27px !important;
}

/* Povecan font za Zahvale i Poruke */
.user_info li.postcount,
.user_info li.custom.thankscount,
.poster ul.user_info li.custom.thankscount,
.poster ul.user_info li.postcount,
.poster ul.user_info > li.custom.thankscount,
.poster ul.user_info > li.postcount,
.custom.thankscount,
.user_info .postcount {
    font-size: 14px !important;
    font-weight: bold !important;
    color: #ffffff !important;
}

.poster ul.user_info > li.custom.thankscount *,
.poster ul.user_info > li.postcount *,
.user_info li.postcount *,
.user_info li.custom.thankscount * {
    font-size: 14px !important;
    font-weight: bold !important;
    color: #ffffff !important;
    line-height: 1.4em !important;
}

/* Boldiraj HVALA tekst */
.thank_you_button_link, 
.saythanks_label {
    font-weight: bold !important;
}

/* Smanjenje razmaka u Topic List Modu */
#forumposts ul.topics_list_mod li.windowbg,
.bbc_topicslist ul.topics_list_mod li.windowbg {
    margin-bottom: 1px !important;
    padding: 3px 10px !important;
}

/* -------------------------- */
/* UVIJEK PODEBLJANE (BOLD) PODKATEGORIJE NA POCETNOJ */
/* -------------------------- */
.board_children a, .sub_boards a {
    font-weight: bold !important;
}

/* -------------------------- */
/* MODERNIZACIJA SKORASNJIH PORUKA (RECENT POSTS) - GRUPISANO */
/* -------------------------- */

/* Mreza za kartice */
#recent_posts_content ul {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 15px !important;
    padding: 15px 0 !important;
    counter-reset: post-number; /* Za numeraciju */
}

/* Stil za svaku karticu (li) */
#recent_posts_content ul li.windowbg {
    counter-increment: post-number;
    display: flex !important;
    flex-direction: column !important;
    background: var(--windowbg-bg) !important;
    border: 1px solid var(--catbg-bg) !important;
    border-radius: 10px !important;
    padding: 15px !important;
    margin: 0 !important;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.08) !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
    position: relative !important; /* Za pozicioniranje broja */
}

#recent_posts_content ul li.windowbg:hover {
    transform: translateY(-3px) !important;
    box-shadow: 5px 8px 15px rgba(0,0,0,0.12) !important;
    background: var(--windowbg-bg-hover) !important;
}

/* Naslov teme u kartici */
#recent_posts_content ul li h6 {
    margin: 0 0 10px 0 !important;
    font-size: 1.1em !important;
    line-height: 1.3 !important;
    padding-right: 25px !important; /* Da ne prekriva broj */
}

#recent_posts_content ul li h6 a {
    color: var(--body-link-color) !important;
}

/* Redni broj u uglu (#1, #2...) */
#recent_posts_content ul li.windowbg::before {
    content: "#" counter(post-number);
    position: absolute !important;
    top: 5px !important;
    right: 12px !important;
    font-size: 1.25em !important;
    font-weight: 900 !important;
    color: var(--body-link-color) !important;
    opacity: 0.35 !important; /* Malo bolja vidljivost */
    font-family: Arial, sans-serif !important;
}

/* Stilovi za kartice */
#recent_posts_content ul li.windowbg {
    border: 1px solid var(--catbg-bg) !important;
}

/* NAJNOVIJE labela uklonjena po zahtjevu korisnika */

/* Sadrzaj kartice (avatar + info) */
#recent_posts_content ul li > div {
    display: grid !important;
    grid-template-columns: 40px 1fr !important;
    gap: 12px !important;
    align-items: center !important;
}

/* Info tekstovi (poster, vrijeme, bord) */
#recent_posts_content ul li p {
    font-size: 0.85em !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

/* Ikonice u kartici */
#recent_posts_content .fa, 
#recent_posts_content .fas, 
#recent_posts_content .far {
    font-size: 0.9em !important;
    opacity: 0.7 !important;
}

.button_recenttopics a {
    display: inline-flex !important; /* Match theme flex and enable transform */
    align-items: center !important;
    justify-content: center !important;
    height: 35px !important; /* Fix excessive height issue */
    padding: 0 12px !important; /* Match theme padding */
    margin: 0 0 5px 0 !important; /* Match theme margin-block-end */
    line-height: normal !important;
    border: 1px solid #ffd700 !important;
    color: #ffd700 !important;
    box-shadow: 
        0 0 5px #ffd700,
        0 0 10px rgba(255, 215, 0, 0.6),
        inset 0 0 5px rgba(255, 215, 0, 0.4) !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8) !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    background: rgba(255, 215, 0, 0.1) !important;
    transition: all 0.3s ease-in-out !important;
    animation: gold-pulse 2s infinite alternate !important;
}

.button_recenttopics a:hover {
    background: rgba(255, 215, 0, 0.25) !important;
    transform: translateY(-4px) scale(1.05) !important; /* Jump effect */
    box-shadow: 
        0 0 10px #ffd700,
        0 0 20px #ffd700,
        0 0 30px rgba(255, 215, 0, 0.8),
        inset 0 0 10px rgba(255, 215, 0, 0.6) !important;
    color: #fff !important;
    animation: none !important; /* Stop pulse on hover for steady shine */
}

/* Active state for NOVI POSTOVI */
.button_recenttopics a.active {
    background: rgba(255, 215, 0, 0.45) !important; /* Solid gold background */
    border: 1.5px solid #ffffff !important; /* White border for high visibility */
    box-shadow: 
        0 0 15px #ffd700, 
        inset 0 0 10px rgba(255, 215, 0, 0.7) !important;
    color: #ffffff !important;
    animation: none !important; /* Steady glow when active */
}

/* Maintain hover effect when active */
.button_recenttopics a.active:hover {
    background: rgba(255, 215, 0, 0.55) !important;
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 
        0 0 20px #ffd700, 
        0 0 40px #ffd700, 
        inset 0 0 15px rgba(255, 215, 0, 0.9) !important;
}

@keyframes gold-pulse {
    from {
        box-shadow: 0 0 5px #ffd700, 0 0 10px rgba(255, 215, 0, 0.4);
    }
    to {
        box-shadow: 0 0 12px #ffd700, 0 0 20px rgba(255, 215, 0, 0.8);
    }
}