/* General Styles */
:root {
    /* Light theme (default) */
    --bg-color: #f5f7fa;
    --text-color: #333;
    --header-bg: #2c3e50;
    --header-text: white;
    --card-bg: #fff;
    --card-shadow: rgba(0, 0, 0, 0.05);
    --bereich-header-bg: #34495e;
    --bereich-content-bg: #f8f9fa;
    --untertitel-header-bg: #3498db;
    --untertitel-content-bg: white;
    --description-bg: #f0f0f0;
    --description-text: #555;
    --prompt-button-bg: #ecf0f1;
    --prompt-button-hover: #2ecc71;
    --input-bg: #f8f9fa;
    --input-border: #ddd;
    --modal-bg: #fff;
    --modal-overlay: rgba(0, 0, 0, 0.6);
}

/* Dark theme */
body.dark-theme {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --header-bg: #1c2833;
    --header-text: #f0f0f0;
    --card-bg: #2c2c2c;
    --card-shadow: rgba(0, 0, 0, 0.2);
    --bereich-header-bg: #2c3e50;
    --bereich-content-bg: #333333;
    --untertitel-header-bg: #2980b9;
    --untertitel-content-bg: #2c2c2c;
    --description-bg: #3a3a3a;
    --description-text: #d0d0d0;
    --prompt-button-bg: #3a3a3a;
    --prompt-button-hover: #27ae60;
    --input-bg: #333333;
    --input-border: #444444;
    --modal-bg: #2c2c2c;
    --modal-overlay: rgba(0, 0, 0, 0.8);
}

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1, h2, h3 {
    margin-bottom: 15px;
}

h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-right: 8px;
    background-color: #6c757d;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.primary {
    background-color: #3498db;
    color: white;
}

.primary:hover {
    background-color: #2980b9;
}

.secondary {
    background-color: #2ecc71;
    color: white;
}

.secondary:hover {
    background-color: #27ae60;
}

.danger {
    background-color: #e74c3c;
    color: white;
}

.danger:hover {
    background-color: #c0392b;
}

.edit {
    background-color: #f39c12;
    color: white;
}

.edit:hover {
    background-color: #d35400;
}

.info {
    background-color: #3498db;
    color: white;
}

.info:hover {
    background-color: #2980b9;
}

/* Controls Section */
.controls {
    margin-bottom: 30px;
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--card-shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Hierarchy Container */
.hierarchy-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--card-shadow);
    padding: 25px;
    margin-top: 20px;
}

/* Bereich Styles */
.bereich {
    margin-bottom: 30px;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bereich:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.bereich-content.collapsed {
    display: none;
}

.bereich-header {
    background-color: var(--bereich-header-bg);
    color: var(--header-text);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.bereich-title {
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.bereich-title i {
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.bereich-title.collapsed i.fa-folder-open {
    display: none;
}

.bereich-title:not(.collapsed) i.fa-folder {
    display: none;
}

.bereich-content {
    padding: 20px;
    background-color: var(--bereich-content-bg);
}

.bereich-actions {
    display: flex;
    gap: 10px;
}

/* Untertitel Styles */
.untertitel {
    margin-bottom: 20px;
    border: none;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--card-shadow);
    background-color: var(--untertitel-content-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.untertitel:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--card-shadow);
}

.untertitel-content.collapsed {
    display: none;
}

.untertitel-header {
    background-color: var(--untertitel-header-bg);
    color: var(--header-text);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.untertitel-title {
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.untertitel-title i {
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.untertitel-title.collapsed i.fa-list-alt {
    display: none;
}

.untertitel-title:not(.collapsed) i.fa-list {
    display: none;
}

.untertitel-content {
    padding: 16px;
    background-color: var(--untertitel-content-bg);
}

.untertitel-actions {
    display: flex;
    gap: 8px;
}

/* Prompt Styles */
.prompt-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.prompt-wrapper {
    flex: 0 0 calc(33.333% - 15px);
    min-width: 200px;
    transition: transform 0.2s ease;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.prompt-button {
    padding: 8px 12px;
    background-color: var(--prompt-button-bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 2px 5px var(--card-shadow);
    transition: all 0.2s ease;
    height: auto;
    min-height: 40px;
}

.prompt-button:hover {
    background-color: var(--prompt-button-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--card-shadow);
}

.prompt-button span {
    font-weight: 500;
    flex: 1;
}

.prompt-actions {
    display: flex;
    gap: 8px;
    opacity: 0.7;
    position: relative;
    z-index: 200; /* Higher than description's z-index (100) */
}

.prompt-button:hover .prompt-actions {
    opacity: 1;
}

.prompt-actions button {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

/* Prompt Description Styles */
.prompt-description {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
    width: 100%;
    box-shadow: 0 2px 5px var(--card-shadow);
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9em;
    z-index: 100;
    position: relative;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background-color: var(--modal-bg);
    margin: 8% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.2s ease;
}

.close:hover {
    color: #e74c3c;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 15px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--input-bg);
    color: var(--text-color);
}

input[type="text"]:focus,
textarea:focus {
    border-color: var(--untertitel-header-bg);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Empty State Styles */
.empty-state {
    padding: 30px;
    text-align: center;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--card-shadow);
    margin: 20px auto;
    max-width: 800px;
}

.empty-state p {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.empty-state p:first-child {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--untertitel-header-bg);
}

.empty-state i {
    margin-right: 10px;
    color: var(--untertitel-header-bg);
}

.empty-state ul {
    text-align: left;
    margin: 15px auto;
    max-width: 600px;
    list-style-position: inside;
}

.empty-state li {
    margin-bottom: 10px;
    padding: 8px;
    background-color: var(--bereich-content-bg);
    border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .prompt-wrapper {
        flex: 0 0 100%;
    }

    .bereich-header, .untertitel-header {
        flex-direction: column;
        gap: 10px;
    }

    .bereich-actions, .untertitel-actions {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
}
