/**
 * DVZ SHOUTBOX - ODŚWIEŻONA WERSJA
 * Style dla shoutbox'a
 * Zaktualizowana kolorystyka w schemacie niebieskim
 */

/* Kontener shoutboxa - szerokość jak dział + panel boczny */
.top.shoutbox-container {
    display: table;
    width: 100%;
    margin-top: 30px;
    margin-bottom: 0;
}

.shoutbox-wrapper {
    display: table-cell;
    vertical-align: top;
    position: relative;
    width: 100%; /* Zajmuje całą dostępną szerokość (jak div.cont + div.sidebar) */
}

#shoutbox {
    margin-bottom: 10px;
    background: rgba(15, 15, 15, 0.6);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 143, 255, 0.1);
    position: relative;
}

#shoutbox.front {
    background: rgba(15, 15, 15, 0.6);
}

#shoutbox .body {
    display: flex !important;
    flex-direction: column !important;
    background: transparent;
}

#shoutbox .window {
    order: 1 !important;
    flex: 1;
}

#shoutbox .panel {
    order: 2 !important;
    padding: 0;
    margin: 0;
}

#shoutbox .panel form {
    margin: 0;
    padding: 0;
    display: block;
}

#shoutbox.front .head {
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, 
        rgba(0, 82, 163, 0.8) 0%, 
        rgba(0, 143, 255, 0.6) 50%, 
        rgba(0, 212, 255, 0.4) 100%);
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    padding: 0px 45px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    z-index: 0;
    line-height: 28px;
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#shoutbox.front .head::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.2) 50%, 
        transparent 100%);
    animation: shimmer 3s infinite;
    z-index: 1;
    pointer-events: none;
}

#shoutbox.front .head strong {
    position: relative;
    z-index: 2;
    color: #fff;
}

#shoutbox.front .head .right {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
}

#shoutbox.front .head .right a {
    color: #fff;
}

#shoutbox.front .head:hover {
    background: linear-gradient(135deg, 
        rgba(0, 82, 163, 0.9) 0%, 
        rgba(0, 143, 255, 0.7) 100%);
}

#shoutbox.collapsed .head {
    opacity: 0.6;
}

#shoutbox.collapsed .body {
    display: none;
}

/* Input do wpisywania wiadomości */
#shoutbox input.text {
    margin: 0;
    padding: 10px 45px;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-top: 1px solid rgba(0, 143, 255, 0.1);
    outline: 0;
    font-size: 13px;
    color: #fff;
    background: rgba(20, 20, 20, 0.8);
    transition: all 0.3s ease;
}

#shoutbox input.text:focus {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    background: rgba(25, 25, 25, 0.9);
}

#shoutbox input.text::placeholder {
    color: #6a7a90;
}

/* Panele ostrzeżeń */
#shoutbox .minposts,
#shoutbox .blocked {
    padding: 12px 15px;
    font-size: 11px;
    border-radius: 6px;
    margin: 10px;
}

#shoutbox .panel.minposts {
    background: rgba(0, 143, 255, 0.1);
    color: #00d4ff;
    border: 1px solid rgba(0, 143, 255, 0.3);
}

#shoutbox .panel.blocked {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

#shoutbox .panel p {
    margin: 0;
}

/* Okno z wiadomościami */
#shoutbox .window {
    overflow-y: auto;
    margin-top: 0;
    background: transparent;
    min-height: 400px;
    max-height: 400px;
    padding: 0;
}

/* Custom scrollbar dla shoutbox */
#shoutbox .window::-webkit-scrollbar {
    width: 8px;
}

#shoutbox .window::-webkit-scrollbar-track {
    background: rgba(15, 15, 15, 0.5);
    border-radius: 4px;
}

#shoutbox .window::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        rgba(0, 82, 163, 0.6) 0%, 
        rgba(0, 143, 255, 0.4) 100%);
    border-radius: 4px;
}

#shoutbox .window::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, 
        rgba(0, 143, 255, 0.8) 0%, 
        rgba(0, 212, 255, 0.6) 100%);
}

#shoutbox .data {
    width: 100%;
}

/* Pojedynczy wpis w shoutbox */
#shoutbox .entry {
    width: 100%;
    padding: 12px 45px 12px 55px;
    box-sizing: border-box;
    position: relative;
    border-bottom: 1px solid rgba(0, 143, 255, 0.1);
    transition: all 0.3s ease;
}

#shoutbox .entry:hover {
    background-color: rgba(0, 143, 255, 0.03);
}

#shoutbox .entry:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.15);
}

#shoutbox .entry:nth-child(even):hover {
    background-color: rgba(0, 143, 255, 0.05);
}

#shoutbox .entry.new {
    background: linear-gradient(90deg,
        rgba(0, 212, 255, 0.1) 0%,
        transparent 100%);
    border-left: 3px solid rgba(0, 212, 255, 0.6);
}

#shoutbox .entry:target {
    background: linear-gradient(90deg,
        rgba(0, 143, 255, 0.2) 0%,
        rgba(0, 143, 255, 0.05) 100%);
    border-left: 3px solid rgba(0, 143, 255, 0.8);
    animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: inset 0 0 0 rgba(0, 143, 255, 0);
    }
    50% {
        box-shadow: inset 0 0 20px rgba(0, 143, 255, 0.3);
    }
}

/* Avatar użytkownika */
#shoutbox .entry .avatar {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

#shoutbox .avatar img {
    margin: 0 auto;
    vertical-align: middle;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid rgba(0, 143, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    object-fit: cover;
}

#shoutbox .avatar img:hover {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
    transform: scale(1.1);
}

/* Tekst wiadomości */
#shoutbox .text {
    width: 100%;
    color: #a5a5a5;
    word-break: break-word;
    word-wrap: break-word;
    font-size: 13px;
    margin-top: 3px;
    line-height: 20px;
}

#shoutbox .text a {
    color: #00d4ff;
    transition: all 0.3s ease;
    text-decoration: none;
}

#shoutbox .text a:hover {
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* Informacje o wpisie (nick, data) */
#shoutbox .info {
    font-size: 12px;
    color: #00d4ff;
    white-space: nowrap;
    font-weight: 600;
    margin-top: 5px;
}

/* Znacznik nieprzeczytanej wiadomości - USUNIĘTY */
#shoutbox .entry.unread .info:before {
    display: none !important;
}

@keyframes pulseUnread {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

#shoutbox .info a:not(.mod) {
    color: inherit;
    transition: all 0.3s ease;
}

#shoutbox .info a:not(.mod):hover {
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* Przyciski moderatorskie - po prawej, jeden pod drugim */
#shoutbox .mod {
    position: absolute;
    right: 10px;
    padding: 6px 12px;
    font-size: 9px;
    font-weight: bold;
    background: linear-gradient(135deg, 
        rgba(0, 82, 163, 0.6) 0%, 
        rgba(0, 143, 255, 0.4) 100%);
    margin: 0;
    text-decoration: none;
    border-radius: 4px;
    color: #fff;
    border: 1px solid rgba(0, 143, 255, 0.4);
    display: block;
    transition: all 0.3s ease;
    text-transform: uppercase;
    width: 30px;
    text-align: center;
    box-sizing: border-box;
}

#shoutbox .mod.edit {
    top: 12px;
}

#shoutbox .mod.del {
    top: 42px;
}

#shoutbox .mod:hover {
    background: linear-gradient(135deg, 
        rgba(0, 143, 255, 0.8) 0%, 
        rgba(0, 212, 255, 0.6) 100%);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
}

#shoutbox .mod:nth-of-type(2) {
    margin: 0;
    border-left: none;
    border-top: 1px solid rgba(0, 212, 255, 0.3);
}

/* IP użytkownika (dla moderatorów) */
#shoutbox .ip {
    margin-right: 10px;
    color: #6a7a90;
    font-size: 11px;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Emotikony i obrazki w wiadomościach */
#shoutbox .text img {
    max-width: 100%;
    vertical-align: middle;
    border-radius: 4px;
}

#shoutbox .text img.smilie {
    max-height: 20px;
    width: auto;
}

/* Data i czas - po lewej pod wiadomością */
#shoutbox .date {
    color: #6a7a90;
    font-size: 11px;
    margin-left: 0;
    margin-top: 5px;
    display: block;
}

/* Animacja shimmer dla nagłówka */
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Responsywność */
@media (max-width: 768px) {
    #shoutbox .entry {
        padding: 12px 10px 12px 50px;
    }
    
    #shoutbox .avatar img {
        width: 30px;
        height: 30px;
    }
    
    #shoutbox .entry .avatar {
        left: 8px;
    }
    
    #shoutbox input.text {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    #shoutbox .info {
        font-size: 11px;
    }
    
    #shoutbox .text {
        font-size: 12px;
    }
}

/* Loading indicator */
#shoutbox.loading:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.8) 50%, 
        transparent 100%);
    animation: loadingBar 1.5s infinite;
}

@keyframes loadingBar {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Empty state */
#shoutbox .empty {
    padding: 40px 20px;
    text-align: center;
    color: #6a7a90;
    font-size: 14px;
}

#shoutbox .empty:before {
    content: '💬';
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Animacja dla nowych wiadomości */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#shoutbox .entry.new {
    animation: slideIn 0.5s ease-out;
}

/* UKRYCIE NICKU I AVATARA CHAT-BOTA (userid=1) WSZĘDZIE (również w archiwum) */
#shoutbox .entry[data-uid="1"] .avatar,
#shoutbox .entry[data-uid="1"] .user {
    display: none !important;
}

/* Ukrycie przycisku edycji dla Chat-Bota */
#shoutbox .entry[data-uid="1"] .mod.edit {
    display: none !important;
}

/* Zmniejszenie lewego paddingu gdy ukryty jest avatar i dodanie prawego paddingu dla przycisku */
#shoutbox .entry[data-uid="1"] {
    padding-left: 12px !important;
    padding-right: 0px !important;
}

/* Przycisk usuwania dla Chat-Bota - wycentrowany pionowo po prawej stronie */
#shoutbox .entry[data-uid="1"] .mod.del {
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 10px !important;
    position: absolute !important;
}

/* Style dla wiadomości bota - data w tym samym wierszu co tekst, po prawej stronie */
#shoutbox.front .entry[data-uid="1"] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

#shoutbox .entry[data-uid="1"] .text {
    flex: 1;
    min-width: 0;
    margin-top: 0;
    display: inline;
}

#shoutbox .entry[data-uid="1"] .info {
    margin-top: 0;
    margin-left: auto;
    flex-shrink: 0;
    order: 2;
    display: flex;
    align-items: center;
    gap: 10px;
}

#shoutbox .entry[data-uid="1"] .info a {
    display: inline;
}

#shoutbox .entry[data-uid="1"] .date {
    display: inline;
    margin-top: 0;
    margin-left: 0;
    white-space: nowrap;
}

/* Pozycjonowanie przycisku usuwania dla użytkownika ID=1 (gdy edycja jest ukryta) */
#shoutbox .entry[data-uid="1"] .mod.del {
    position: relative;
    top: auto;
    right: auto;
    margin: 0;
}