/* Standard Zeichensatz */
body {
    background-color: #121212;
    color: #eeeeee;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
}

/* Login Bereich */
.login-box {
    width: 320px;
    margin: 100px auto;
    background: #1e1e1e;
    padding: 30px;
    border: 1px solid #333;
    border-radius: 5px;
}

.login-box input {
    width: 100%;
}

.login-box .btn-add {
    width: 100%;
    margin-top: 10px;
}

/* Header & Nav */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-settings {
    font-size: 20px;
    text-decoration: none;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.btn-settings:hover {
    opacity: 1;
}

.header .btn-logout {
    margin-left: 0;
}

.breadcrumb {
    background: #252525;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    cursor: pointer;
    color: #00ff88;
    font-weight: bold;
}

/* Item List */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.list-row:hover {
    border-color: #00ff88;
    background: #222;
}

.list-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.list-name {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
}

.btn-del-inline {
    background: transparent;
    color: #666;
    border: 1px solid #444;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
}

.btn-del-inline:hover {
    color: #ff4444;
    border-color: #ff4444;
    background: transparent;
}

.btn-edit-inline {
    background: transparent;
    color: #666;
    border: 1px solid #444;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
}

.btn-edit-inline:hover {
    color: #ffca28;
    border-color: #ffca28;
    background: transparent;
}

/* Typ-Markierungen (Standard Text-Indikatoren) */
.type-indicator {
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}
.type-0 { color: #ffca28; border: 1px solid #ffca28; } /* Ordner */
.type-1 { color: #42a5f5; border: 1px solid #42a5f5; } /* Projekt */
.type-2 { color: #66bb6a; border: 1px solid #66bb6a; } /* Datenbank */

/* Formulare & Buttons */
input, select {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    padding: 8px;
    margin: 5px 0;
    border-radius: 4px;
}

button {
    background: #444;
    color: #fff;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 4px;
}

button:hover {
    background: #555;
}

.btn-add {
    background: #00ff88;
    color: #000;
    font-weight: bold;
}

.btn-del {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #880000;
    font-size: 10px;
    padding: 2px 5px;
}

.create-panel {
    margin-top: 40px;
    padding: 20px;
    background: #1e1e1e;
    border-top: 1px solid #333;
}

/* Create Panel (index.php) */
.create-panel .create-row {
    display: flex;
    gap: 10px;
}

.create-panel .create-row input {
    flex: 2;
}

.create-panel .create-row select {
    flex: 1;
}

.create-panel .create-row .btn-add {
    flex: 1;
}

/* Leerer Ordner-Hinweis */
.empty-notice {
    color: #666;
    padding: 20px;
}

/* ===== DB-Seite (db.php) ===== */
.db-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
    font-size: 13px;
}

.db-table th, .db-table td {
    border: 1px solid #444;
    padding: 6px;
    text-align: left;
    /* Mobile-kompatibel: min-width damit Zellen nicht zu schmal werden */
    min-width: 60px;
    box-sizing: border-box;
}

.db-table th {
    background: #2a2a2a;
    color: #00ff88;
}

.db-toolbar {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.action-btn.active {
    background: #008855;
}

/* Desktop: schmale Inputs默认 */
.db-table input[type="text"] {
    width: 100%;
    min-width: 0;
    background: #111;
    border: 1px solid #444;
    color: #fff;
    padding: 4px;
    box-sizing: border-box;
    display: block;
}

.db-table.wide th, .db-table.wide td {
    min-width: 160px;
}

.db-table.wide input[type="text"] {
    width: 100%;
    min-width: 120px;
}

.action-btn {
    cursor: pointer;
    text-decoration: none;
    padding: 2px 5px;
    background: #444;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
}

.action-btn-save {
    background: #008855;
}

.action-btn-del {
    background: #880000;
}

.db-new-row {
    background: #1a2a1a;
}

.db-field-name {
    width: 150px;
}

/* ===== Projekt-Seite (project.php) ===== */
.file-list {
    width: 100%;
    border-collapse: collapse;
    background: #1e1e1e;
    margin-bottom: 20px;
}

.file-list td, .file-list th {
    padding: 10px;
    border: 1px solid #333;
}

.file-list th {
    background: #2a2a2a;
    color: #00ff88;
}

textarea {
    width: 100%;
    height: 200px;
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #444;
    font-family: monospace;
}

.editor-box {
    background: #1e1e1e;
    padding: 20px;
    border: 1px solid #333;
    border-radius: 8px;
}

.editor-box form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.editor-box hr {
    border: 1px solid #333;
    margin: 10px 0;
}

.btn-delete-file {
    background: #aa0000;
}

.filename-input {
    width: 100%;
}

.btn-back {
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
    padding: 6px 14px;
    margin-bottom: 16px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.btn-back:hover {
    border-color: #00ff88;
    color: #00ff88;
}

/* ===== Settings-Seite (settings.php) ===== */
.settings-panel {
    background: #1e1e1e;
    padding: 20px;
    border: 1px solid #333;
    border-radius: 8px;
    max-width: 500px;
}

.settings-panel h3 {
    margin-top: 0;
}

.settings-panel label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 14px;
    color: #aaa;
}

.settings-panel input[type="password"] {
    width: 100%;
    box-sizing: border-box;
}

.settings-panel .btn-add {
    margin-top: 16px;
    width: 100%;
}

.settings-msg {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
}

.settings-msg.success {
    background: #1a3a1a;
    color: #00ff88;
    border: 1px solid #00ff88;
}

.settings-msg.error {
    background: #3a1a1a;
    color: #ff4444;
    border: 1px solid #ff4444;
}

/* ===== Responsive (Mobile) ===== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        margin: 10px auto;
    }

    /* DB Mobile */
    .db-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }

    .db-table th, .db-table td {
        padding: 4px;
        min-width: 60px;
    }

    .db-table input[type="text"] {
        width: 100%;
        min-width: 0;
    }

    h2 {
        font-size: 1.2em;
    }

    h4 {
        font-size: 0.95em;
    }

    .create-panel {
        padding: 12px;
    }

    .create-panel form {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .create-panel input, .create-panel select {
        width: 100%;
    }

    /* Projekt Mobile */
    .file-list {
        font-size: 13px;
    }

    .file-list td, .file-list th {
        padding: 6px;
    }

    .editor-box {
        padding: 12px;
    }

    h3 {
        font-size: 1em;
    }
}