
:root {
    --bg-color: #050005;
    --card-bg: rgba(20, 0, 25, 0.9);
    --text-main: #e0e0e0;
    --text-muted: #888;
    
    /* Nexus Palette */
    --magenta: #ff00ff;
    --magenta-dim: #990099;
    
    --orange: #ff9d00;
    --orange-dim: #b36b00;
    
    --red: #ff3333;
    --green: #00ffaa;
    
    --border: #440044;
    --glow: 0 0 10px var(--magenta);
    --glow-orange: 0 0 10px var(--orange);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #333; border: 1px solid var(--magenta-dim); }
::-webkit-scrollbar-thumb:hover { background: var(--magenta-dim); }

#background-grid {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255, 0, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
}

/* Typography & Utils */
h1, h2, h3 { font-weight: 300; letter-spacing: 2px; margin: 0; text-transform: uppercase; }
.glow-text { text-shadow: var(--glow); color: var(--magenta); }
.orange-text { color: var(--orange); text-shadow: var(--glow-orange); }
.magenta-text { color: var(--magenta); }
.small { font-size: 0.8rem; color: var(--text-muted); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }

/* View Management */
.view { display: none; height: 100vh; box-sizing: border-box; }
.view.active { display: block; animation: fadeInView 0.5s ease-out; }

@keyframes fadeInView { from { opacity: 0; } to { opacity: 1; } }

/* Inputs & Buttons */
input, select, textarea {
    background: rgba(0,0,0,0.5);
    border: none;
    border-bottom: 1px solid var(--magenta-dim);
    color: white;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    transition: 0.3s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-bottom-color: var(--orange);
    box-shadow: 0 4px 10px -4px var(--orange);
}

button { cursor: pointer; border: none; font-family: inherit; transition: 0.3s; }

.btn-neon {
    background: transparent;
    border: 1px solid var(--magenta);
    color: var(--magenta);
    padding: 12px 30px;
    font-size: 1rem;
    letter-spacing: 2px;
    box-shadow: inset 0 0 10px rgba(255,0,255,0.1);
}
.btn-neon:hover {
    background: var(--magenta);
    color: white;
    box-shadow: 0 0 20px var(--magenta);
}
.btn-neon.small { padding: 8px 15px; font-size: 0.8rem; }
.btn-small { background: #222; color: #aaa; padding: 5px 10px; font-size: 0.8rem; }
.btn-small:hover { color: white; }

.btn-action {
    padding: 8px 12px;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    background: #444; 
    color: #ccc;
    flex-grow: 1;
    text-align: center;
}
.btn-action:hover { background: #666; color:white; }

.btn-action.success { background: var(--green); color: black; box-shadow: 0 0 5px var(--green); }
.btn-action.success:hover { background: #ccffee; }
.btn-action.danger { background: var(--red); color: white; box-shadow: 0 0 5px var(--red); }
.btn-action.danger:hover { background: #ffaaaa; }
.btn-action.delete { background: #333; color: #777; border: 1px solid #555; }
.btn-action.delete:hover { background: #555; color: white; border-color: #777; }

.btn-comment-submit {
    background: var(--magenta-dim);
    color: white;
    border: 1px solid var(--magenta);
    padding: 5px 12px;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
}
.btn-comment-submit:hover {
    background: var(--magenta);
    box-shadow: 0 0 10px var(--magenta);
}

.btn-delete-mini {
    color: var(--red);
    background: transparent;
    padding: 0 5px;
    font-weight: bold;
    font-family: monospace;
    cursor: pointer;
    opacity: 0.6;
}
.btn-delete-mini:hover { opacity: 1; text-shadow: 0 0 5px var(--red); }

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}
.login-box {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.1);
    text-align: center;
    backdrop-filter: blur(5px);
}
.subtitle { 
    color: var(--orange); 
    text-shadow: var(--glow-orange);
    letter-spacing: 5px; 
    font-size: 0.8rem; 
    margin-bottom: 40px; 
    opacity: 0.9; 
}
.input-group { margin-bottom: 20px; position: relative; }

/* Role Buttons */
.role-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}
.role-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.2rem;
    letter-spacing: 2px;
}
.role-btn .icon { font-size: 1.5rem; }
.role-btn:hover {
    background: rgba(255,0,255,0.1);
    border-color: var(--magenta);
    box-shadow: 0 0 15px var(--magenta-dim);
    transform: translateY(-2px);
}
.form-actions { display: flex; justify-content: space-between; margin-top: 30px; }

/* Layout Main */
header.nexus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(10, 0, 10, 0.9);
    border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: center; gap: 15px; }
.separator { color: #333; font-size: 1.5rem; }

.points-display {
    text-align: right;
    margin-right: 20px;
    display: inline-block;
}
.points-display .label { display: block; font-size: 0.7rem; color: var(--text-muted); }
.points-display #points-total { font-size: 1.8rem; font-family: 'Courier New', monospace; font-weight: bold; }

/* Navigation */
.nexus-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    background: rgba(0,0,0,0.5);
    padding: 10px 0;
}
.nav-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 10px 20px;
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    letter-spacing: 1px;
}
.nav-btn:hover { color: white; }
.nav-btn.active {
    color: var(--magenta);
    border-bottom-color: var(--magenta);
    text-shadow: 0 0 8px var(--magenta);
    background: rgba(255,0,255,0.05);
}

.nexus-content {
    padding: 30px;
    max-width: 1100px;
    margin: 0 auto;
    min-height: calc(100vh - 150px);
}

/* Tabs Logic */
.tab-content { 
    display: none; 
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.tab-content.active { 
    display: block; 
    opacity: 1;
    transform: translateY(0);
}

/* Cards & Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } .nexus-content { padding: 15px; } }

.nexus-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 25px;
    position: relative;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
.nexus-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--magenta), transparent);
    opacity: 0.5;
}
.nexus-card.compact { padding: 15px; margin-bottom: 20px; }
.card-title { font-size: 0.9rem; color: var(--orange); margin-bottom: 20px; border-bottom: 1px solid #222; padding-bottom: 10px; text-align: center;}

/* Logs */
.log-list { list-style: none; padding: 0; margin: 0; max-height: 400px; overflow-y: auto; }
.log-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}
.log-list li:hover { background: rgba(255,255,255,0.02); }
.log-list li.positive span:last-child { color: var(--green); text-shadow: 0 0 5px var(--green); }
.log-list li.negative span:last-child { color: var(--red); text-shadow: 0 0 5px var(--red); }

/* Status */
.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}
.status-ring {
    width: 10px; height: 10px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--green);
    animation: pulse 2s infinite;
}
@keyframes pulse { 0% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0.5; transform: scale(0.9); } }

/* Task Styling (Card Look - Redesigned) */
.section-header {
    color: var(--orange);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--orange-dim);
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.task-item {
    background: #111; /* Darker bg for cards */
    border: 1px solid var(--magenta); /* Neon border base */
    border-radius: 8px;
    padding: 0; /* Reset padding, managed by inner sections */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.2), inset 0 0 10px rgba(255, 0, 255, 0.05);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--magenta), inset 0 0 20px rgba(255, 0, 255, 0.1);
}

/* Status variants */
.task-item.pending { 
    border-color: yellow; 
    box-shadow: 0 0 8px rgba(255, 255, 0, 0.2);
}
.task-item.pending:hover { box-shadow: 0 0 15px yellow; }

.task-item.schikane { 
    border-color: var(--red); 
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.2);
    background: rgba(20, 0, 0, 0.8);
}
.task-item.schikane:hover { box-shadow: 0 0 15px var(--red); }

.task-item.overdue { 
    border-color: red; 
    box-shadow: 0 0 10px red, inset 0 0 20px rgba(255,0,0,0.3); 
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder { 0% { border-color: red; } 50% { border-color: #880000; } 100% { border-color: red; } }

/* Inner Layout */
.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
}

.task-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #f0abfc; /* Lighter magenta */
    text-shadow: 0 0 5px var(--magenta-dim);
    display: block;
    line-height: 1.2;
}

.task-meta {
    font-size: 0.75rem;
    color: #888;
    display: block;
    margin-top: 4px;
}

.task-card-points {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.val-plus { color: var(--green); text-shadow: 0 0 3px var(--green); }
.val-minus { color: var(--red); text-shadow: 0 0 3px var(--red); }

.task-body {
    flex-grow: 1;
    padding: 15px;
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.5;
}

.task-desc {
    margin-bottom: 10px;
    color: #d1d5db; /* Gray-300 */
}

.task-footer {
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.task-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* Countdown & Timers */
.countdown { 
    font-family: 'Courier New'; 
    font-weight: bold; 
    color: var(--orange); 
    font-size: 0.8rem; 
    margin-top: 10px; 
    padding: 4px 8px;
    background: rgba(255, 165, 0, 0.1);
    border-radius: 4px;
    display: inline-block;
    border: 1px solid rgba(255, 165, 0, 0.3);
}
.countdown.overdue { color: red; animation: blink 1s infinite; background: rgba(255, 0, 0, 0.1); border-color: red; }

/* Progress Bar for Streaks */
.task-progress-bar {
    width: 100%;
    height: 6px;
    background: #222;
    margin-top: 10px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #333;
}
.task-progress-fill {
    height: 100%;
    background: var(--green);
    transition: width 0.3s;
    box-shadow: 0 0 5px var(--green);
}

/* Missteps Grid */
.missteps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.misstep-card {
    background: rgba(50, 0, 0, 0.6);
    border: 1px solid var(--red);
    padding: 15px;
    border-radius: 4px;
    color: #fff;
    text-align: left;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
}
.misstep-card:hover {
    background: var(--red);
    box-shadow: 0 0 15px var(--red);
    transform: translateY(-2px);
}
.misstep-card .title { font-weight: bold; margin-bottom: 5px; }
.misstep-card .desc { font-size: 0.75rem; color: #ccc; margin-bottom: 10px; flex-grow: 1; }
.misstep-card .points { font-family: 'Courier New'; font-weight: bold; text-align: right; color: #ff9999; }


/* Task Comments */
.task-comments-section {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}
.comment-toggle { font-size: 0.75rem; color: #888; cursor: pointer; text-decoration: underline; }
.comment-list {
    margin-bottom: 10px;
    max-height: 120px;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    padding: 8px;
    border-radius: 4px;
    display: none;
    border: 1px solid #333;
}
.comment-list.visible { display: block; }
.task-comment { font-size: 0.8rem; margin-bottom: 6px; padding: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; }
.task-comment .author { font-weight: bold; color: var(--magenta); margin-right: 5px; }
.task-comment.sub .author { color: var(--green); } /* Make Sub distinct */
.comment-form { display: flex; gap: 0; }
.comment-input { padding: 8px; font-size: 0.8rem; background: #222; border: 1px solid #444; color: white; flex-grow: 1; border-radius: 4px 0 0 4px; }
.comment-input:focus { border-color: var(--magenta); }

/* Chat / Journal */
.chat-container {
    height: 400px;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.chat-msg { padding: 10px 15px; border-radius: 4px; max-width: 80%; animation: fadeInMsg 0.3s; }
@keyframes fadeInMsg { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.chat-msg.msg-dom {
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid var(--magenta-dim);
    align-self: flex-end; /* Gebieter rechts oder hervorgehoben */
    box-shadow: 0 0 5px rgba(255,0,255,0.2);
}
.chat-msg.msg-sub { background: rgba(255, 255, 255, 0.05); border: 1px solid #333; align-self: flex-start; }
.chat-msg.msg-system { background: transparent; border-bottom: 1px solid #333; align-self: center; text-align: center; font-style: italic; color: var(--orange); width: 90%; }

.msg-header { font-size: 0.7rem; color: #aaa; margin-bottom: 5px; }
.msg-dom .msg-header { color: var(--magenta); }

/* Archive Timeline */
.timeline-list { position: relative; padding-left: 20px; border-left: 2px solid var(--border); margin-left: 10px; }
.timeline-item { position: relative; margin-bottom: 30px; background: rgba(0,0,0,0.5); border: 1px solid #333; padding: 15px; }
.timeline-item::before {
    content: ''; position: absolute; left: -26px; top: 15px; width: 10px; height: 10px;
    border-radius: 50%; background: var(--text-muted); box-shadow: 0 0 5px var(--text-muted);
}
.timeline-item.completed::before { background: var(--green); box-shadow: 0 0 5px var(--green); }
.timeline-item.failed::before { background: var(--red); box-shadow: 0 0 5px var(--red); }

.timeline-header { display: flex; justify-content: space-between; margin-bottom: 10px; border-bottom: 1px solid #222; padding-bottom: 5px; }
.timeline-title { font-weight: bold; color: var(--text-main); }
.timeline-date { font-family: 'Courier New'; font-size: 0.8rem; color: var(--text-muted); }
.timeline-notes { font-size: 0.85rem; color: #aaa; margin-top: 10px; background: rgba(0,0,0,0.3); padding: 10px; border-radius: 3px; font-style: italic; }

/* Rules */
#rules-list { padding-left: 20px; }
#rules-list li { padding: 10px; margin-bottom: 10px; border-bottom: 1px solid #222; color: #ccc; font-weight: 300; }
#rules-list li::marker { color: var(--magenta); font-weight: bold; }

.flex-form { display: flex; gap: 10px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-group-inline { display: flex; align-items: center; gap: 5px; }

@keyframes blink { 50% { opacity: 0.5; } }

/* Strafen (Punishments) */
.punishment-card {
    background: rgba(100, 0, 0, 0.4);
    border: 2px solid var(--red);
    padding: 15px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
    animation: pulseRed 2s infinite;
}
@keyframes pulseRed { 0% { box-shadow: 0 0 5px rgba(255,0,0,0.2); } 50% { box-shadow: 0 0 15px rgba(255,0,0,0.5); } 100% { box-shadow: 0 0 5px rgba(255,0,0,0.2); } }

/* Simple Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: #111;
    border: 2px solid var(--magenta);
    padding: 30px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 0 30px rgba(255,0,255,0.2);
}

/* Requirements List */
.req-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.req-item {
    background: #333;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #555;
}
