/* ==============================
   @version v3
   themes.css
   - Themes-Panel
   - Theme-Items
   - Panel-Abschnitte
   - Formulare
   - Theme-Styles
   ============================== */

/* ==============================
   1. Themes-Panel
   ============================== */
.themes-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 450px;
    max-width: 90vw;
    background-color: #f5f7fa;
    color: #333;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    z-index: var(--z-index-fixed);
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    max-height: 80vh;
    overflow-y: auto;
}

.themes-panel.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.themes-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #444;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #555;
    color: white;
}

.themes-panel-header h3 {
    margin: 0;
    color: white;
}

.themes-panel-content {
    padding: 15px;
}

.drag-handle {
    cursor: move;
    padding: 5px;
    margin-right: 5px;
}

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

.theme-panel-toggle,
.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.theme-panel-toggle:hover,
.close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Theme-Toggle Button */
.theme-toggle-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: var(--z-index-fixed);
    border: none;
    transition: transform var(--transition-speed) ease,
        background-color var(--transition-speed) ease;
}

.theme-toggle-button:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.theme-toggle-button .material-icons {
    font-size: 30px;
}

/* Dark Theme für Panel */
.themes-panel[data-theme="dark"] {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.themes-panel[data-theme="dark"] .themes-panel-header {
    background-color: #2a2a2a;
    border-bottom-color: #3d3d3d;
}

.themes-panel[data-theme="dark"] input,
.themes-panel[data-theme="dark"] textarea,
.themes-panel[data-theme="dark"] select {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border-color: #3d3d3d;
}

.themes-panel[data-theme="dark"] input:focus,
.themes-panel[data-theme="dark"] textarea:focus,
.themes-panel[data-theme="dark"] select:focus {
    border-color: var(--primary-light);
}

.themes-panel[data-theme="dark"] .panel-section-header {
    border-bottom-color: #3d3d3d;
}

.themes-panel[data-theme="dark"] .theme-item {
    background-color: #2a2a2a;
    border-color: #3d3d3d;
}

.themes-panel[data-theme="dark"] .theme-header {
    background-color: #333;
    border-bottom-color: #3d3d3d;
}

/* ==============================
   2. Panel-Abschnitte
   ============================== */
.panel-section {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.themes-panel[data-theme="dark"] .panel-section {
    background-color: #2a2a2a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.panel-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #e0e0e0;
}

.themes-panel[data-theme="dark"] .panel-section-header {
    background-color: #333;
    border-bottom-color: #3d3d3d;
}

.panel-section-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.panel-section-content {
    padding: 15px;
}

.toggle-section-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.toggle-section-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.themes-panel[data-theme="dark"] .toggle-section-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ==============================
   3. Formulare im Panel
   ============================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.theme-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.theme-action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.theme-action-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.theme-action-button.secondary {
    background-color: var(--secondary);
}

.theme-action-button.secondary:hover {
    background-color: #5a6268;
}

.theme-action-button:active {
    transform: translateY(1px);
}

/* ==============================
   4. Theme-Items
   ============================== */
.themes-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 5px;
}

.theme-item {
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.theme-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-item.theme-collecting-active {
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

.theme-item.theme-collecting-active .theme-header {
    background-color: rgba(74, 144, 226, 0.15);
}

.themes-panel[data-theme="dark"] .theme-item.theme-collecting-active {
    border-color: var(--primary-light);
    box-shadow: 0 0 10px rgba(100, 181, 246, 0.3);
}

.themes-panel[data-theme="dark"] .theme-item.theme-collecting-active .theme-header {
    background-color: rgba(100, 181, 246, 0.25);
}

.theme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.theme-header:hover {
    background-color: #f0f0f0;
}

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

.theme-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

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

.theme-action-icon {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.theme-action-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

.themes-panel[data-theme="dark"] .theme-action-icon {
    color: #aaa;
}

.themes-panel[data-theme="dark"] .theme-action-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.theme-action-icon.delete {
    color: #dc3545;
}

.theme-action-icon.delete:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.theme-meta {
    padding: 8px 15px;
    font-size: 0.8rem;
    color: #666;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
}

.themes-panel[data-theme="dark"] .theme-meta {
    background-color: #292929;
    color: #aaa;
    border-bottom-color: #3d3d3d;
}

.theme-content {
    padding: 15px;
    display: none;
}

.theme-item.active .theme-content {
    display: block;
}

.theme-description {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* ==============================
   5. Prüfschritte im Thema
   ============================== */
.theme-pruefschritte {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pruefschritt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 0.9rem;
}

.themes-panel[data-theme="dark"] .pruefschritt-item {
    background-color: #333;
}

.pruefschritt-title {
    flex: 1;
}

.remove-pruefschritt {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.remove-pruefschritt:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #dc3545;
}

.themes-panel[data-theme="dark"] .remove-pruefschritt:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

.empty-pruefschritte {
    font-style: italic;
    color: #999;
    text-align: center;
    padding: 10px;
}

.themes-panel[data-theme="dark"] .empty-pruefschritte {
    color: #777;
}

.empty-themes-message {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

.themes-panel[data-theme="dark"] .empty-themes-message {
    color: #777;
}

/* ==============================
   6. Suche-Hervorhebung
   ============================== */
.highlight {
    background-color: rgba(255, 255, 0, 0.3);
    padding: 0 2px;
    border-radius: 2px;
}

.themes-panel[data-theme="dark"] .highlight {
    background-color: rgba(255, 255, 0, 0.2);
    color: #fff;
}