/* ==========================================================================
   3. MODULES (Tabs, Editor, Dashboard, Modals)
   ========================================================================== */

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 25px; }

.editor-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    height: 100vh !important;
    width: 100vw !important;
    border-radius: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* KI Chat Panel */
.editor-ai-sidebar {
    width: 350px;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.ai-chat-header {
    padding: 10px 15px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
}

.ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-msg {
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 90%;
    word-wrap: break-word;
    white-space: pre-wrap; /* Wichtig für Code-Einrückungen der KI */
}

.ai-msg.user {
    background: var(--primary);
    color: var(--dark);
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.ai-msg.bot {
    background: var(--dark);
    color: var(--text);
    border: 1px solid var(--border);
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.ai-chat-input-area {
    padding: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.2);
}

#ai-chat-input {
    flex: 1;
    background: var(--dark);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 10px;
    resize: none;
    height: 45px;
    font-family: inherit;
    font-size: 0.85rem;
}

#ai-chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

   /* --- TABS --- */
.wedevix-tabs {
    display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.wedevix-tab-btn {
    background: none; border: none; padding: 10px 5px; font-size: 1rem;
    color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent;
}
.wedevix-tab-btn:hover { color: var(--text); }
.wedevix-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* --- EDITOR FIX (Dein gewünschtes VS-Code Layout!) --- */
.editor-module { height: calc(100vh - 120px); display: flex; flex-direction: column; padding: 0; }
.editor-split-view { display: flex; flex: 1; overflow: hidden; }
.editor-sidebar { width: 250px; background: var(--card-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.editor-main-area { flex: 1; background: #1e1e1e; }

.editor-file-tree { padding: 10px; overflow-y: auto; flex: 1; font-size: 0.9rem; }
.file-tree-item { 
    padding: 6px 8px; cursor: pointer; border-radius: 4px; 
    display: flex; align-items: center; gap: 8px; color: var(--text-light);
}
.file-tree-item:hover { background: var(--light); color: var(--text); }

/* Die schönen Einrückungen für Ordner */
.folder-children { 
    margin-left: 18px; 
    border-left: 1px solid var(--border); 
    padding-left: 5px;
}
.folder-icon { font-size: 0.7rem; width: 12px; text-align: center; }

/* --- MODALS --- */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; }

/* --- SPINNER --- */
.loading { display: flex; justify-content: center; padding: 3rem; color: var(--text-light); }
.spinner { border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }