/* ==========================================================================
   MaxiStrike Roadmap – gemeinsames Stylesheet
   Markenfarben abgeleitet von maxistrike.de (Logo-Rot #B5191C)
   ========================================================================== */

:root {
    /* Markenfarben */
    --brand:        #B5191C;
    --brand-dark:   #8E1316;
    --brand-light:  #D8262B;

    /* Neutrale Töne */
    --ink:          #14171c;   /* fast schwarz – Header/Hintergründe */
    --ink-soft:     #232830;
    --page-bg:      #eef0f4;   /* heller Seitenhintergrund */
    --surface:      #ffffff;
    --surface-alt:  #f5f6f8;
    --border:       #e4e7eb;
    --text:         #1f2329;
    --text-muted:   #6b7280;

    /* Statusfarben */
    --todo:         #f0a500;
    --todo-bg:      #fff6e0;
    --progress:     #2563eb;
    --progress-bg:  #e3edff;
    --done:         #1aa260;
    --done-bg:      #e2f6ec;

    /* Prioritätsfarben */
    --prio-high:    #B5191C;
    --prio-medium:  #f0a500;
    --prio-low:     #1aa260;
    --prio-normal:  #8a929e;

    /* Sonstiges */
    --success:      #1aa260;
    --error:        #d22;
    --radius:       12px;
    --radius-sm:    8px;
    --shadow:       0 18px 40px rgba(0,0,0,0.18);
    --shadow-sm:    0 4px 14px rgba(0,0,0,0.10);
    --font:         'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(181,25,28,0.12), transparent 60%),
        linear-gradient(160deg, var(--page-bg) 0%, #dfe3ea 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: var(--text);
}

/* ==========================================================================
   Brand / Logo
   ========================================================================== */
.brand-logo {
    height: 46px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

/* ==========================================================================
   Layout-Container
   ========================================================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    background:
        linear-gradient(135deg, var(--ink) 0%, var(--ink-soft) 100%);
    color: #fff;
    padding: 30px;
    padding-top: 64px;
    text-align: center;
    position: relative;
    border-bottom: 4px solid var(--brand);
}

.header-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.header-logo-wrap .brand-logo {
    height: 60px;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.header h1 .accent {
    color: var(--brand-light);
}

.header > p {
    opacity: 0.8;
    font-size: 0.95em;
}

.header-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.header-btn {
    background: rgba(255,255,255,0.12);
    color: #fff;
    padding: 8px 15px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s;
}

.header-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

.admin-btn      { background: rgba(26,162,96,0.85);  border-color: transparent; }
.admin-btn:hover{ background: #1aa260; }
.password-btn   { background: rgba(240,165,0,0.9);   border-color: transparent; color: #1f2329; }
.password-btn:hover { background: #f0a500; }

.user-info {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 14px;
    opacity: 0.9;
}

.role-badge {
    background: rgba(240,165,0,0.9);
    color: #1f2329;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 5px;
}

.admin-badge {
    background: var(--brand);
    color: #fff;
}

/* ==========================================================================
   Formulare / Eingaben
   ========================================================================== */
.add-section {
    padding: 20px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
}

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

.task-form-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 300px;
}

.task-inputs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

input, select, button, textarea {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(181,25,28,0.12);
}

input[type="text"] {
    flex: 1;
    min-width: 200px;
}

textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
}

select {
    min-width: 150px;
}

button {
    background: var(--brand);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s;
    font-weight: 700;
}

button:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
}

.add-module-btn {
    background: var(--done);
    margin-left: 10px;
}

.add-module-btn:hover {
    background: #15824d;
}

/* ==========================================================================
   Module / Spalten
   ========================================================================== */
.modules-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.module {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    width: 100%;
}

.module-header {
    background: linear-gradient(135deg, var(--ink) 0%, var(--ink-soft) 100%);
    color: #fff;
    padding: 18px 20px;
    position: relative;
    border-left: 5px solid var(--brand);
}

.module-title {
    font-size: 1.35em;
    font-weight: 700;
    margin-bottom: 4px;
}

.task-count {
    font-size: 0.9em;
    opacity: 0.85;
}

.delete-module {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--brand);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.25s;
}

.delete-module:hover {
    background: var(--brand-dark);
}

.status-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    min-height: 300px;
}

.status-column {
    padding: 15px;
    border-right: 1px solid var(--border);
}

.status-column:last-child {
    border-right: none;
}

.status-column h4 {
    text-align: center;
    margin-bottom: 15px;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 700;
}

.todo h4     { background: var(--todo-bg);     color: #8a5d00; }
.progress h4 { background: var(--progress-bg); color: #1741a6; }
.done h4     { background: var(--done-bg);     color: #0f6b40; }

/* Scroll-Container für Aufgaben */
.task-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.task-container::-webkit-scrollbar {
    width: 8px;
}

.task-container::-webkit-scrollbar-track {
    background: var(--surface-alt);
    border-radius: 4px;
}

.task-container::-webkit-scrollbar-thumb {
    border-radius: 4px;
}

.task-container::-webkit-scrollbar-thumb:hover {
    opacity: 0.8;
}

.todo     .task-container::-webkit-scrollbar-thumb        { background: var(--todo); }
.todo     .task-container::-webkit-scrollbar-thumb:hover  { background: #d18f00; }
.progress .task-container::-webkit-scrollbar-thumb        { background: var(--progress); }
.progress .task-container::-webkit-scrollbar-thumb:hover  { background: #1d4fd1; }
.done     .task-container::-webkit-scrollbar-thumb        { background: var(--done); }
.done     .task-container::-webkit-scrollbar-thumb:hover  { background: #15824d; }

/* ==========================================================================
   Aufgaben-Karten
   ========================================================================== */
.task {
    background: var(--surface-alt);
    margin-bottom: 8px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--prio-normal);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.task:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Prioritäts-Styling */
.task.priority-high {
    border-left-color: var(--prio-high);
    background: linear-gradient(135deg, #fff2f2, var(--surface-alt));
    box-shadow: 0 2px 8px rgba(181,25,28,0.18);
}

.task.priority-medium {
    border-left-color: var(--prio-medium);
    background: linear-gradient(135deg, #fffbf0, var(--surface-alt));
    box-shadow: 0 2px 8px rgba(240,165,0,0.18);
}

.task.priority-low {
    border-left-color: var(--prio-low);
    background: linear-gradient(135deg, #f0fff6, var(--surface-alt));
    box-shadow: 0 2px 8px rgba(26,162,96,0.18);
}

.task.priority-normal {
    border-left-color: var(--prio-normal);
}

/* Prioritäts-Badge */
.priority-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.priority-high   .priority-badge { background: var(--prio-high); }
.priority-medium .priority-badge { background: var(--prio-medium); color: #1f2329; }
.priority-low    .priority-badge { background: var(--prio-low); }
.priority-normal .priority-badge { background: var(--prio-normal); }

/* Statusbasierte Standardfarbe (von Priorität überschrieben) */
.todo     .task { border-left-color: var(--todo); }
.progress .task { border-left-color: var(--progress); }
.done     .task { border-left-color: var(--done); }

.todo .task.priority-high,
.progress .task.priority-high,
.done .task.priority-high     { border-left-color: var(--prio-high); }

.todo .task.priority-medium,
.progress .task.priority-medium,
.done .task.priority-medium   { border-left-color: var(--prio-medium); }

.todo .task.priority-low,
.progress .task.priority-low,
.done .task.priority-low      { border-left-color: var(--prio-low); }

.task-text {
    font-weight: 600;
    margin-bottom: 5px;
    margin-top: 15px;
}

.task-description {
    font-size: 0.85em;
    color: #495057;
    background: #eceef1;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
    line-height: 1.4;
}

.task-meta {
    font-size: 0.8em;
    color: var(--text-muted);
}

.task-hint {
    font-size: 0.75em;
    color: var(--brand);
    font-style: italic;
    margin-top: 3px;
}

.task-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 3px;
}

.task-action-btn {
    background: var(--prio-normal);
    color: #fff;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-task   { background: var(--todo); }
.delete-task { background: var(--brand); }

/* ==========================================================================
   Info-Boxen / Legende
   ========================================================================== */
.cycle-info {
    background: #fdeceb;
    padding: 15px;
    margin: 20px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--brand);
}

.cycle-info h3 {
    color: var(--brand);
    margin-bottom: 8px;
}

.cycle-info p {
    color: #424242;
    font-size: 0.9em;
}

.module-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.priority-legend {
    background: var(--surface-alt);
    padding: 15px;
    margin: 20px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--prio-normal);
}

.priority-legend h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.priority-items {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.priority-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
}

.priority-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.priority-color.high   { background: var(--prio-high); }
.priority-color.medium { background: var(--prio-medium); }
.priority-color.low    { background: var(--prio-low); }
.priority-color.normal { background: var(--prio-normal); }

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--surface);
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border-top: 4px solid var(--brand);
}

.modal-content h2 {
    color: var(--ink);
    margin-bottom: 6px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--brand);
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.user-table th,
.user-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.user-table th {
    background-color: var(--surface-alt);
    font-weight: bold;
}

.user-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row input,
.form-row select {
    flex: 1;
}

.password-form,
.edit-task-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ==========================================================================
   Meldungen
   ========================================================================== */
.success {
    background: var(--done-bg);
    color: #0f6b40;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.error {
    background: #fde2e4;
    color: #8a1418;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* ==========================================================================
   Bild-Upload / Vorschau
   ========================================================================== */
.image-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-label {
    background: var(--ink-soft);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.file-label:hover {
    background: var(--ink);
}

.image-upload-row input[type="file"] {
    display: none;
}

.image-preview {
    display: none;
    max-height: 60px;
    max-width: 120px;
    border-radius: 6px;
    border: 1px solid var(--border);
    object-fit: cover;
}

.image-preview.visible {
    display: inline-block;
}

.remove-image-btn {
    display: none;
    background: var(--brand);
    font-size: 13px;
    padding: 8px 12px;
}

.remove-image-btn.visible {
    display: inline-block;
}

.remove-image-btn:hover {
    background: var(--brand-dark);
}

.task-image {
    margin: 8px 0;
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 6px;
    cursor: zoom-in;
    border: 1px solid var(--border);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* ==========================================================================
   Login-Seite
   ========================================================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    border-top: 5px solid var(--brand);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .brand-logo {
    height: 50px;
    margin: 0 auto 18px;
}

.login-header h1 {
    color: var(--ink);
    margin-bottom: 10px;
    font-size: 1.5em;
}

.login-header p {
    color: var(--text-muted);
}

.login-container label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.login-container .form-group {
    display: block;
    margin-bottom: 20px;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s;
}

.login-btn:hover {
    background: var(--brand-dark);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .form-group     { flex-direction: column; }
    .task-inputs    { flex-direction: column; }
    .module-section { flex-direction: column; align-items: stretch; }
    .status-columns { grid-template-columns: 1fr; }

    .status-column {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .header-controls {
        position: static;
        justify-content: center;
        margin-top: 15px;
    }

    .user-info {
        position: static;
        text-align: center;
        margin-bottom: 15px;
    }

    .priority-items { justify-content: center; }

    .task-container { max-height: 300px; }
}
