:root {
    --primary-purple: #8A2BE2;
    --dark-bg: #0d0d0d;
    --text-color: #f0f0f0;
    --card-bg: rgba(25, 25, 25, 0.4);
    --border-color: rgba(138, 43, 226, 0.2);
    --glow-color: rgba(138, 43, 226, 0.5);
    --error-color: #ff7675;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="10" stroke="%238A2BE2" stroke-width="2" fill="none"/><circle cx="16" cy="16" r="3" fill="white"/></svg>') 16 16, auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-purple) #181818;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    overflow-x: hidden;
}

body::-webkit-scrollbar { width: 12px; }
body::-webkit-scrollbar-track { background: #181818; }
body::-webkit-scrollbar-thumb {
    background-color: var(--primary-purple);
    border-radius: 20px;
    border: 3px solid #181818;
}
body::-webkit-scrollbar-thumb:hover { background-color: #9b4dff; }

a, button, .cta-button, .nav-button {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="12" fill="%238A2BE2" opacity="0.7"/><circle cx="16" cy="16" r="4" fill="white"/></svg>') 16 16, pointer;
}

#blob {
    background: linear-gradient(to right, var(--primary-purple), #c471ed);
    height: 300px;
    width: 300px;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: rotate 20s infinite;
    opacity: 0.7;
    filter: blur(120px);
    z-index: -2;
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

#blur {
    height: 100%;
    width: 100%;
    position: fixed;
    z-index: -1;
    backdrop-filter: blur(150px);
}

header {
    position: fixed;
    width: 100%;
    top: 0;
    padding: 20px 50px;
    z-index: 10;
    background: transparent;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-button, .cta-button {
    background: var(--primary-purple);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    border: none;
    box-shadow: 0 0 25px var(--glow-color);
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
}

.nav-button:hover, .cta-button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 40px var(--glow-color);
}

.cta-button:disabled {
    background-color: #555;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}


.cta-button i { margin-right: 8px; }

main { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; }

.hero-content { display: flex; flex-direction: column; gap: 20px; align-items: center; }
.hero h1 { font-size: 4.5em; line-height: 1.1; }
.hero p { font-size: 1.2em; max-width: 600px; color: #b3b3b3; }

section { padding-bottom: 100px; }
#main-content > section:not(.hero) { padding-top: 140px; }

section h2 { font-size: 3em; text-align: center; margin-bottom: 60px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.feature-card { background: var(--card-bg); border-radius: 20px; border: 1px solid var(--border-color); backdrop-filter: blur(15px); transition: transform 0.4s ease, border-color 0.4s ease; will-change: transform; }
.feature-card:hover { border-color: rgba(138, 43, 226, 0.6); }
.card-content { padding: 40px; text-align: center; }
.card-content i { font-size: 2.5em; color: var(--primary-purple); margin-bottom: 20px; }
.card-content h3 { font-size: 1.6em; margin-bottom: 10px; }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; text-align: center; }
.value-item i { font-size: 3em; color: var(--primary-purple); margin-bottom: 20px; transition: transform 0.3s ease; }
.value-item h3 { font-size: 1.8em; margin-bottom: 15px; }
.value-item p { color: #b3b3b3; line-height: 1.6; }
.value-item:hover i { transform: scale(1.1) translateY(-5px); }
footer { text-align: center; padding: 40px; color: #666; }
.reveal-text { opacity: 0; transform: translateY(30px); animation: reveal 1s forwards; animation-delay: calc(var(--delay, 0) * 1ms); }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
.reveal-text[data-delay] { animation-delay: calc(var(--d, 1) * 1ms); }
.scroll-reveal { opacity: 0; transform: translateY(50px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; transition-delay: calc(var(--delay, 0) * 1ms); }
.scroll-reveal.visible { opacity: 1; transform: translateY(0); }

/* --- Style Partnera --- */
.partner-card { background: var(--card-bg); border-radius: 20px; border: 1px solid var(--border-color); backdrop-filter: blur(15px); padding: 40px; text-align: left; transition: border-color 0.4s ease, transform 0.4s ease; will-change: transform;}
.partner-card:hover { border-color: rgba(138, 43, 226, 0.6); }
.partner-header { text-align: center; margin-bottom: 30px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.partner-header h3 { font-size: 2.5em; font-weight: 700; margin-bottom: 10px; }
.partner-header h4 { font-size: 1.2em; color: var(--primary-purple); font-weight: 600; letter-spacing: 1px; }
.partner-header h4 i { margin-right: 8px; }
.partner-body .intro-text { font-size: 1.1em; line-height: 1.6; text-align: center; margin-bottom: 40px; color: #c7c7c7; }
.partner-body .intro-text i { color: var(--primary-purple); }
.partner-body h5 { font-size: 1.5em; margin-top: 30px; margin-bottom: 20px; color: var(--text-color); border-left: 3px solid var(--primary-purple); padding-left: 15px; }
.partner-body h5 i { margin-right: 10px; color: var(--primary-purple); }
.partner-body ul { list-style: none; padding-left: 10px; }
.partner-body li { display: flex; align-items: flex-start; margin-bottom: 15px; font-size: 1em; color: #b3b3b3; line-height: 1.5; }
.partner-body li i { color: var(--primary-purple); margin-right: 15px; font-size: 1.2em; width: 20px; text-align: center; margin-top: 3px; }
.partner-footer { text-align: center; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.partner-footer .cta-button i { margin-right: 10px; }

/* --- Style Modali --- */
.modal-container { display: none; position: fixed; z-index: 20; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.7); backdrop-filter: blur(5px); justify-content: center; align-items: center; }
.modal-content { background: var(--card-bg); margin: auto; padding: 40px; border: 1px solid var(--border-color); width: 90%; max-width: 500px; border-radius: 20px; position: relative; box-shadow: 0 5px 30px rgba(0,0,0,0.4); animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.close-btn { color: #aaa; position: absolute; top: 15px; right: 25px; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-btn:hover, .close-btn:focus { color: white; text-decoration: none; }
.modal-content h2 { text-align: center; margin-bottom: 20px; font-size: 2em; }
.modal-content form { display: flex; flex-direction: column; gap: 20px; }
.modal-content input, .modal-content textarea { padding: 15px; background: rgba(0,0,0,0.3); border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-color); font-family: 'Poppins', sans-serif; font-size: 1em; }
.modal-content input:focus, .modal-content textarea:focus { outline: none; border-color: var(--primary-purple); }
.modal-content .cta-button { width: 100%; margin-top: 10px; }
.form-switch { text-align: center; margin-top: 15px; color: #b3b3b3; }
.form-switch a { color: var(--primary-purple); font-weight: 600; text-decoration: none; }
.form-switch a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* Style dla komunikatów o błędach */
.error-message {
    color: var(--error-color);
    margin: -10px 0 10px 0;
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
}

/* --- Style przycisków i nawigacji po zalogowaniu --- */
.auth-buttons { display: flex; align-items: center; gap: 15px; }
.profile-link { background: transparent; border: 2px solid var(--primary-purple); }
.profile-link:hover { background: var(--primary-purple); }

/* --- Style dla modalu profilu --- */
.modal-content h3 { font-size: 1.4em; margin-bottom: 10px; font-weight: 600; text-align: left; }
.modal-divider { border: none; height: 1px; background-color: var(--border-color); margin: 40px 0; }

/* --- STYLE CZATU GLOBALNEGO Z ANIMACJĄ --- */
.chat-container { position: fixed; bottom: 20px; right: 20px; width: 350px; max-width: 90vw; z-index: 1000; font-size: 0.9em; }
.chat-header { background-color: var(--primary-purple); color: white; padding: 12px 15px; border-radius: 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 600; box-shadow: 0 5px 20px rgba(0,0,0,0.3); transition: border-radius 0.4s ease; }
.chat-header .chat-icon-toggle { transition: transform 0.3s ease; }
.chat-container.active .chat-header { border-radius: 15px 15px 0 0; }
.chat-container.active .chat-icon-toggle { transform: rotate(180deg); }
.chat-window { display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 15px 15px; backdrop-filter: blur(10px); overflow: hidden; max-height: 0; opacity: 0; transition: max-height 0.4s ease-out, opacity 0.3s ease-out; }
.chat-container.active .chat-window { max-height: 450px; opacity: 1; }
.chat-messages { flex-grow: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-messages::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background-color: rgba(138, 43, 226, 0.5); border-radius: 10px; }

.chat-message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 15px;
    background-color: rgba(50, 50, 50, 0.7);
    line-height: 1.4;
    word-wrap: break-word;
    color: #f0f0f0;
}

.chat-message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.chat-message .author { font-weight: 600; font-size: 0.9em; }

.chat-message.my-message {
    align-self: flex-end;
}

.chat-message.my-message .author { color: #f0f0f0; }
.chat-input-form { display: flex; border-top: 1px solid var(--border-color); }
.chat-input-form input { flex-grow: 1; background: transparent; border: none; padding: 15px; color: var(--text-color); outline: none; }
.chat-input-form button { background: transparent; border: none; color: var(--primary-purple); padding: 0 20px; font-size: 1.2em; cursor: pointer; transition: color 0.2s; }
.chat-input-form button:hover { color: #9b4dff; }

/* --- STYLE RANG NA CZACIE --- */
.chat-message .rank {
    font-weight: bold;
    font-size: 0.85em;
}

.gradient-text {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.6);
}

.role-helper { background-image: linear-gradient(to right, #ffeb3b, #ffc107); }
.role-sr-helper { background-image: linear-gradient(to right, #03a9f4, #3f51b5); }
.role-moderator { background-image: linear-gradient(to right, #8bc34a, #cddc39); }
.role-sr-moderator { background-image: linear-gradient(to right, #009688, #4caf50); }
.role-admin { background-image: linear-gradient(to right, #2196f3, #00bcd4); }
.role-sr-admin { background-image: linear-gradient(to right, #ff9800, #ffeb3b); }
.role-head-admin { background-image: linear-gradient(to right, #b71c1c, #ff5722); }
.role-co-owner { background-image: linear-gradient(to right, #e91e63, #9c27b0); }
.role-owner { background-image: linear-gradient(to right, #e91e63, #9c27b0); }
.role-partner { background-image: linear-gradient(to right, #05ff5c, #ffffff); }

/* Domyślny styl dla zwykłego użytkownika */
.role-user {
    color: #cccccc;
    font-weight: 600;
}

/* STYLE DLA PANELU ADMINISTRACYJNEGO */
.admin-panel-content {
    background: var(--card-bg);
    margin: auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 90vw;
    max-width: 1400px;
    height: 85vh;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 5px 30px rgba(0,0,0,0.4);
    animation: fadeIn 0.5s ease;
    display: flex;
    flex-direction: column;
}

.admin-panel-content h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2em;
    flex-shrink: 0;
}

.admin-panel-body {
    display: flex;
    gap: 20px;
    height: 100%;
    overflow: hidden;
}

.admin-user-list-container {
    flex: 1;
    min-width: 250px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.admin-user-list-container h3 {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.admin-user-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.admin-chat-container {
    flex: 3;
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 15px;
}

#admin-user-list, #partner-user-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
    height: 50%;
}
#admin-user-list::-webkit-scrollbar, #partner-user-list::-webkit-scrollbar {
    width: 8px;
}
#admin-user-list::-webkit-scrollbar-track, #partner-user-list::-webkit-scrollbar-track {
    background: transparent;
}
#admin-user-list::-webkit-scrollbar-thumb, #partner-user-list::-webkit-scrollbar-thumb {
    background-color: rgba(138, 43, 226, 0.5);
    border-radius: 10px;
}

.chat-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    flex-shrink: 0;
}
.chat-tab-btn {
    padding: 10px 15px;
    background: transparent;
    border: none;
    color: #aaa;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}
.chat-tab-btn:hover {
    color: white;
}
.chat-tab-btn.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
}
.chat-content {
    display: none;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}
.chat-content.active {
    display: flex;
}

/* Style dla sekcji Pomoc */
#help-post-form {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
}
#help-post-form textarea {
    background: transparent;
    border: none;
    padding: 10px;
    color: var(--text-color);
    outline: none;
    resize: vertical;
    min-height: 40px;
    font-family: 'Poppins', sans-serif;
}
#help-post-form input {
    background: transparent;
    border: none;
    padding: 10px;
    color: var(--text-color);
    outline: none;
    border-bottom: 1px solid var(--border-color);
}
#help-post-form button {
    align-self: flex-end;
}
.help-post {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 3px solid var(--primary-purple);
}
.help-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.help-post-title {
    font-size: 1.2em;
    font-weight: 600;
    word-break: break-word;
}
.help-post-meta {
    font-size: 0.8em;
    color: #aaa;
    text-align: right;
    flex-shrink: 0;
}
.help-post-meta .author {
    font-weight: bold;
}
.help-post-content {
    color: #ddd;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.help-post-actions {
    display: flex;
    gap: 10px;
    align-self: flex-end;
    margin-top: 10px;
}
.post-action-btn {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8em;
}
.post-action-btn.edit:hover {
    border-color: #f1c40f;
    color: #f1c40f;
}
.post-action-btn.delete:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* ========================================================== */
/* ========= RESPONSIVE DESIGN (MEDIA QUERIES) ======== */
/* ========================================================== */

@media (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: touch; 
    }

    #blob { 
        display: none; 
    }

    header { 
        padding: 15px 20px; 
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .logo {
        font-size: 1.3em;
        width: 100%;
        text-align: center;
    }

    .auth-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-button, .cta-button {
        padding: 10px 18px;
        font-size: 0.9em;
    }

    main {
        padding: 0 15px;
    }

    section { 
        padding-bottom: 80px; 
    }

    #main-content > section:not(.hero) { 
        padding-top: 150px;
    }

    .hero h1 { 
        font-size: 2.8em; 
    }

    section h2 {
        font-size: 2.2em;
        margin-bottom: 40px;
    }

    .card-content {
        padding: 30px;
    }

    .partner-card {
        padding: 25px;
    }

    /* === ZMODYFIKOWANY I BARDZIEJ AGRESYWNY PANEL ADMINISTRACYJNY === */
    .admin-panel-content {
        padding: 10px; /* Mniej paddingu wewnątrz */
        height: 95vh; /* Panel zajmuje prawie całą wysokość */
        width: 98vw; /* Panel zajmuje prawie całą szerokość */
    }

    .admin-panel-content h2 {
        font-size: 1.5em; /* Mniejszy tytuł panelu */
        margin-bottom: 10px;
    }

    .admin-panel-body {
        flex-direction: column;
        gap: 10px;
        overflow-y: auto; /* KLUCZOWA ZMIANA: Całe ciało panelu jest przewijane */
    }

    .admin-user-list-container {
        flex-shrink: 0; /* Zapobiega kurczeniu się kontenera z listami */
        padding: 10px;
    }

    .admin-user-list-container h3 {
        font-size: 1.1em; /* Mniejsze nagłówki list */
        margin-bottom: 10px;
    }

    #admin-user-list, #partner-user-list {
        height: 100px; /* Stała, niska wysokość dla list, wymusza przewijanie wewnątrz */
    }

    .admin-chat-container {
        padding: 10px;
        flex-shrink: 0;
    }

    .chat-tabs {
        flex-wrap: wrap;
        justify-content: flex-start; /* Zakładki zaczynają się od lewej */
        gap: 5px; /* Mniejszy odstęp */
    }

    .chat-tab-btn {
        font-size: 0.8em; /* Znacznie mniejsza czcionka zakładek */
        padding: 8px;
    }
    
    .chat-messages, #help-posts-container {
        padding: 10px;
    }
}
/* ZMIANA: Ukrywa globalny czat, gdy jakikolwiek modal jest otwarty */
body.modal-open .chat-container {
    display: none;
}
/* ========================================================== */
/* ==== NOWE Style dla POZIOMEJ sekcji specjalnych użytkowników === */
/* ========================================================== */

.tiers-container {
    display: flex; /* Układa tiery (diamentowy, złoty, srebrny) obok siebie */
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap; /* Na małych ekranach tiery spadną jeden pod drugi */
}

.user-tier {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column; /* Elementy wewnątrz tieru (tytuł, odznaki) układają się pionowo */
    gap: 15px;
    min-width: 280px; /* Minimalna szerokość dla każdego tieru */
    flex: 1; /* Pozwala tierom rosnąć i zajmować dostępną przestrzeń */
}

.user-tier h3 {
    font-size: 1.3em;
    padding-bottom: 10px;
    margin-bottom: 5px;
    border-bottom: 2px solid; /* Kolor zdefiniowany poniżej */
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Kolory dla poszczególnych tierów */
.user-tier.tier-diamond { border-color: #00e5ff; }
.user-tier.tier-diamond h3 { border-color: #00e5ff; color: #00e5ff; }
.user-tier.tier-diamond .user-badge img { border-color: #00e5ff; }

.user-tier.tier-gold { border-color: #ffd700; }
.user-tier.tier-gold h3 { border-color: #ffd700; color: #ffd700; }
.user-tier.tier-gold .user-badge img { border-color: #ffd700; }

.user-tier.tier-silver { border-color: #c0c0c0; }
.user-tier.tier-silver h3 { border-color: #c0c0c0; color: #c0c0c0; }
.user-tier.tier-silver .user-badge img { border-color: #c0c0c0; }


/* Styl dla pojedynczej odznaki użytkownika ("prostokąt") */
.user-badge {
    display: flex; /* Układa avatar i nazwę obok siebie */
    align-items: center; /* Centruje w pionie */
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.user-badge:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Styl dla avatara ("malutka kuleczka") */
.user-badge img {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Tworzy kółko */
    object-fit: cover;
    margin-right: 15px; /* Odstęp od nazwy */
    border: 2px solid; /* Kolor dziedziczony z .tier-* */
}

.user-badge .user-name {
    font-weight: 600;
    font-size: 1.1em;
}