/* --- FONTS & THEME VARIABLES --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

/* Light Mode Palette */
:root {
    --primary-color: #e75a7c;
    --background-color: #fff0f5;
    --container-bg: #ffffff;
    --text-color: #5c5c5c;
    --header-color: #d95379;
    --error-color: #d93030;
    --success-color: #28a745;
    --main-font: 'Poppins', sans-serif;
    --star-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffc2d9' fill-opacity='0.6'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41 1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.5-5.05 5.55-.8-4-3.64.94-5.53L20 6.16l-4.95-2.58.94 5.53-4 3.64 5.55.8z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Dark Mode Palette */
html[data-theme="dark"] {
    --primary-color: #6c63ff;
    --background-color: #23222d;
    --container-bg: #2c2b3a;
    --text-color: #dcdcdc;
    --header-color: #ffffff;
    --star-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23e75a7c' fill-opacity='0.1'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41 1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.5-5.05 5.55-.8-4-3.64.94-5.53L20 6.16l-4.95-2.58.94 5.53-4 3.64 5.55.8z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* --- GENERAL STYLES (Applies to everything) --- */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--main-font);
    margin: 0;
    background-image: var(--star-pattern);
    transition: background-color 0.3s ease, color 0.3s ease;
}

button {
    background-color: var(--primary-color);
    border: none;
    border-radius: 12px;
    color: white;
    padding: 12px 20px;
    font-weight: 700;
    font-family: var(--main-font);
    font-size: 1.1rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease-in-out;
    letter-spacing: 1px;
}
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hidden { display: none; }

/* --- LOGIN PAGE SPECIFIC STYLES --- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.login-page .container {
    background-color: var(--container-bg);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    text-align: center;
    min-width: 400px;
}
.login-page h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--header-color);
    margin-bottom: 0.5rem;
}
.login-page input {
    background-color: #f9f9f9;
    border: 2px solid #eeeeee;
    border-radius: 12px;
    color: #5c5c5c;
    padding: 12px;
    margin-bottom: 1rem;
    width: 90%;
}
html[data-theme="dark"] .login-page input {
    background-color: #23222d;
    border-color: #4a4863;
    color: var(--text-color);
}
.login-page .toggle-link {
    color: var(--primary-color);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    margin-top: 1rem;
    display: inline-block;
}

#coinContainer {
    margin-bottom: 2rem;
}

#coinLogo {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    border: 3px solid transparent;
}

#coinLogo:active {
    transform: scale(0.95);
}

/* --- DASHBOARD  --- */

.dashboard-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 2rem;
    box-sizing: border-box;
}

#app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    width: 100%;
    max-width: 1800px;
    height: 100%;
    max-height: 95vh;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.sidebar {
    background-color: var(--container-bg);
    border-right: 1px solid #eee;
}
html[data-theme="dark"] .sidebar {
    background-color: var(--background-color);
    border-right-color: #4a4863;
}

#chat-container {
    position: relative; 
    background-color: var(--container-bg);
}

#chat-header {
    padding: 0rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
html[data-theme="dark"] #chat-header { border-bottom-color: #4a4863; }
#chat-header h1 { font-size: 1.5rem; margin: 0; }

ul#posts-container {
    position: absolute;
    top: 67px;
    bottom: 78px;
    left: 0;
    right: 0;
    overflow-y: auto;
    padding: 0 1.5rem;
    margin: 0;
    list-style-type: none;
    display: flex;
    flex-direction: column-reverse;
}

#post-form-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    background-color: var(--container-bg); 
}
html[data-theme="dark"] #post-form-container { 
    border-top-color: #4a4863;
    background-color: var(--container-bg);
}

li.post {
    display: flex;
    padding: 0.75rem 0.5rem;
    gap: 1rem;
}
li.post:hover { background-color: #f9f9f9; }
html[data-theme="dark"] li.post:hover { background-color: #333142; }

.post-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: #ddd;
    border-radius: 50%;
}
html[data-theme="dark"] .post-avatar { background-color: #555; }
.post-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.post-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.post-author { font-weight: bold; color: var(--header-color); }
.post-date { font-size: 0.8rem; color: #aaa; }
.post-content p { 
    margin: 0; 
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.info-message { text-align: center; padding: 2rem; color: #999; }

#newPostForm { display: flex; gap: 10px; }
#newPostForm input {     flex-grow: 1;
    margin: 0;
    font-family: var(--main-font);
    font-size: 1rem;
    color: #333;
    background-color: #ffffff;
    border: 2px solid #d16e99;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 0 0 2px #fff, 0 0 10px rgba(209, 110, 153, 0.5);
    transition: all 0.2s ease-in-out; }
html[data-theme="dark"] #newPostForm input {
    color: var(--text-color);
    background-color: #2c2b3a;
    border: 2px solid #5a5870;
    box-shadow: 0 0 0 2px #2c2b3a, 0 0 10px rgba(108, 99, 255, 0.5);
}

#newPostForm button { margin: 0; }
html[data-theme="dark"] #newPostForm input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px #2c2b3a, 0 0 15px var(--primary-color);
}
/* --- Sidebar and Online List Styles --- */
.sidebar-content {
    padding: 1rem;
}
.sidebar-content h2 {
    font-size: 1.2rem;
    color: var(--header-color);
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

    /*
        --- SYSTEM ARCHIVE NOTE ---
        Grundstellung: D O D
        --- END NOTE ---
    */

html[data-theme="dark"] .sidebar-content h2 {
    border-bottom-color: #4a4863;
}

#online-users-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
#online-users-list li {
    padding: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-color);
}
html[data-theme="dark"] #online-users-list li {
    border-bottom-color: #333142;
}
.post[data-author="SYSTEM"] {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
}

html[data-theme="dark"] .post[data-author="SYSTEM"] {
    background-color: #3e3828;
    border-color: #7a6c47;
}

.post[data-author="SYSTEM"] .post-author {
    color: #d48806;
    font-weight: bold;
}

.post[data-author="SYSTEM"] .post-content p {
    font-style: italic;
    color: #595959;
}

html[data-theme="dark"] .post[data-author="SYSTEM"] .post-content p {
    color: #bfbfbf;
}
.sidebar-link {
    display: block;
    padding: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
}
.sidebar-link:hover {
    background-color: rgba(0,0,0,0.1);
    color: var(--primary-color);
}
html[data-theme="dark"] .sidebar-link:hover {
    background-color: #333142;
}
