/* ===== Theme Variables ===== */

/* Retro Theme (Default) - Klassisches grünes Terminal */
[data-theme="retro"] {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d2d;
    --bg-hover: #353535;
    --border-color: #3d3d3d;
    --text-primary: #d4d4d4;
    --text-secondary: #888;
    --accent-color: #4ec9b0;
    --accent-hover: #5fd4bb;
    --error-color: #f48771;
    --warning-color: #dcdcaa;
    --info-color: #569cd6;
    --success-color: #4ec9b0;
    --selection-bg: #4ec9b0;
    --selection-text: #1e1e1e;
    --scrollbar-thumb: #3d3d3d;
    --scrollbar-track: #1e1e1e;
    --btn-close: #ff5f56;
    --btn-minimize: #ffbd2e;
    --btn-maximize: #27c93f;
    --window-title-style: center;
    --terminal-border-radius: 0;
    --header-padding: 8px 16px;
}

/* macOS Theme - Elegantes Apple Terminal */
[data-theme="macos"] {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d30;
    --bg-tertiary: #3c3c3c;
    --bg-hover: #4a4a4a;
    --border-color: #4a4a4a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #34c759;
    --accent-hover: #30d158;
    --error-color: #ff453a;
    --warning-color: #ffd60a;
    --info-color: #0a84ff;
    --success-color: #34c759;
    --selection-bg: #0a84ff;
    --selection-text: #ffffff;
    --scrollbar-thumb: #4a4a4a;
    --scrollbar-track: #2d2d30;
    --btn-close: #ff5f57;
    --btn-minimize: #febc2e;
    --btn-maximize: #28c840;
    --window-title-style: center;
    --terminal-border-radius: 8px;
    --header-padding: 12px 16px;
}

/* Windows Terminal Theme - Modernes Windows Design */
[data-theme="windows"] {
    --bg-primary: #0c0c0c;
    --bg-secondary: #1f1f1f;
    --bg-tertiary: #2d2d2d;
    --bg-hover: #3d3d3d;
    --border-color: #404040;
    --text-primary: #cccccc;
    --text-secondary: #808080;
    --accent-color: #61afef;
    --accent-hover: #7ec0f7;
    --error-color: #e06c75;
    --warning-color: #e5c07b;
    --info-color: #61afef;
    --success-color: #98c379;
    --selection-bg: #264f78;
    --selection-text: #ffffff;
    --scrollbar-thumb: #4d4d4d;
    --scrollbar-track: #1f1f1f;
    --btn-close: #e81123;
    --btn-minimize: #1f1f1f;
    --btn-maximize: #1f1f1f;
    --window-title-style: left;
    --terminal-border-radius: 0;
    --header-padding: 8px 12px;
}

/* PowerShell Theme - Klassisches blaues PowerShell */
[data-theme="powershell"] {
    --bg-primary: #012456;
    --bg-secondary: #001d40;
    --bg-tertiary: #002b5c;
    --bg-hover: #003670;
    --border-color: #0050a0;
    --text-primary: #eeedf0;
    --text-secondary: #a0a0a0;
    --accent-color: #ffff00;
    --accent-hover: #ffff55;
    --error-color: #ff5555;
    --warning-color: #ffff00;
    --info-color: #55ffff;
    --success-color: #55ff55;
    --selection-bg: #ffffff;
    --selection-text: #012456;
    --scrollbar-thumb: #0050a0;
    --scrollbar-track: #001d40;
    --btn-close: #c42b1c;
    --btn-minimize: #001d40;
    --btn-maximize: #001d40;
    --window-title-style: left;
    --terminal-border-radius: 0;
    --header-padding: 4px 12px;
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    cursor: text;
    transition: background-color 0.3s ease;
}

/* Terminal-Style Textauswahl */
::selection {
    background: var(--selection-bg);
    color: var(--selection-text);
}

::-moz-selection {
    background: var(--selection-bg);
    color: var(--selection-text);
}

#main-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Tabs Container ===== */
#tabs-container {
    display: none;
}

/* ===== Theme Selector ===== */
.theme-selector {
    display: none;
}

/* ===== New Terminal Button ===== */
.new-terminal-btn {
    display: none;
}

/* ===== Terminal Tabs ===== */
.terminal-tab {
    display: none;
}

.tab-close {
    display: none;
}

/* ===== Terminals Container ===== */
#terminals-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.terminal-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-radius: var(--terminal-border-radius);
    transition: background-color 0.3s ease;
}

/* ===== Split Container ===== */
.split-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.split-container.split-horizontal {
    flex-direction: row;
}

.split-container.split-vertical {
    flex-direction: column;
}

.terminal-container.terminal-active {
    outline: 1px solid var(--accent-color);
    outline-offset: -1px;
}

/* ===== Terminal Header ===== */
.terminal-header {
    background: var(--bg-tertiary);
    padding: var(--header-padding);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

/* Windows/PowerShell style header buttons */
[data-theme="windows"] .terminal-header,
[data-theme="powershell"] .terminal-header {
    flex-direction: row-reverse;
}

[data-theme="windows"] .terminal-buttons,
[data-theme="powershell"] .terminal-buttons {
    order: 1;
    margin-right: 0;
    margin-left: 12px;
}

[data-theme="windows"] .terminal-title,
[data-theme="powershell"] .terminal-title {
    text-align: left;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.8;
}

.btn.close {
    background: var(--btn-close);
}

.btn.minimize {
    background: var(--btn-minimize);
}

.btn.maximize {
    background: var(--btn-maximize);
}

/* Windows style buttons */
[data-theme="windows"] .btn,
[data-theme="powershell"] .btn {
    border-radius: 0;
    width: 30px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-secondary);
}

[data-theme="windows"] .btn.close:hover,
[data-theme="powershell"] .btn.close:hover {
    background: #e81123;
    color: white;
}

[data-theme="windows"] .btn.minimize:hover,
[data-theme="windows"] .btn.maximize:hover,
[data-theme="powershell"] .btn.minimize:hover,
[data-theme="powershell"] .btn.maximize:hover {
    background: var(--bg-hover);
}

.terminal-title {
    flex: 1;
    text-align: var(--window-title-style);
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== Terminal Body ===== */
.terminal-body {
    flex: 1;
    padding: 0 16px 16px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    cursor: text;
}

.terminal-output {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* ===== Input Line ===== */
.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    min-height: 1.6em;
    cursor: text;
    line-height: 1.6;
}

.prompt {
    color: var(--accent-color);
    font-weight: bold;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
    line-height: 1.6;
}

/* PowerShell prompt style */
[data-theme="powershell"] .prompt {
    color: var(--text-primary);
}

[data-theme="powershell"] .prompt::before {
    content: "PS ";
    color: var(--accent-color);
}

.command-display-wrapper {
    display: inline-flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    position: relative;
    line-height: 1.6;
}

.command-display {
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    white-space: pre;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    line-height: 1.6;
    display: inline-block;
}

.command-after-cursor {
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    white-space: pre;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    line-height: 1.6;
    display: inline-block;
}

.command-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: transparent;
    font-family: inherit;
    font-size: 14px;
    caret-color: transparent;
    min-width: 0;
    padding: 0;
    margin: 0;
    z-index: 10;
    cursor: text;
    line-height: 1.6;
}

.command-input:focus {
    outline: none;
}

/* ===== Cursor Block ===== */
.cursor-block {
    display: inline-block;
    color: var(--accent-color);
    font-weight: bold;
    animation: blink 1s infinite;
    line-height: 1.6;
    vertical-align: baseline;
    animation: blink-cursor 1s infinite;
    flex-shrink: 0;
}

.terminal-active .cursor-block {
    background: var(--accent-color);
}

/* PowerShell underscore cursor */
[data-theme="powershell"] .cursor-block {
    background: transparent !important;
    color: var(--accent-color);
}

@keyframes blink-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===== Output Styles ===== */
.output-line {
    margin-bottom: 2px;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.command-line {
    color: var(--text-primary);
    margin-bottom: 4px;
}

.error {
    color: var(--error-color);
}

.success {
    color: var(--success-color);
}

.info {
    color: var(--info-color);
}

.warning {
    color: var(--warning-color);
}

.path {
    color: var(--accent-color);
}

.file {
    color: var(--text-primary);
}

.dir {
    color: var(--info-color);
    font-weight: bold;
}

.executable {
    color: var(--accent-color);
}

/* ===== Markdown Content ===== */
.markdown-content {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 4px;
    margin: 8px 0;
    border-left: 3px solid var(--accent-color);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: var(--accent-color);
    margin-top: 16px;
    margin-bottom: 8px;
}

.markdown-content p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.markdown-content code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--warning-color);
    font-size: 0.9em;
}

.markdown-content pre {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 12px 0;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}

.markdown-content blockquote {
    border-left: 3px solid var(--info-color);
    padding-left: 12px;
    margin: 12px 0;
    color: var(--text-secondary);
}

.markdown-content ul,
.markdown-content ol {
    margin-left: 24px;
    margin-bottom: 12px;
}

.markdown-content a {
    color: var(--info-color);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

.markdown-content th {
    background: var(--bg-tertiary);
    color: var(--accent-color);
}

/* ===== Password Input ===== */
.password-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    width: 100%;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
    border: 2px solid var(--scrollbar-track);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ===== Nano Editor Styles ===== */
.nano-container {
    background: #ffffff;
    color: #000000;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 8px 0;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    max-height: 600px;
    overflow: hidden;
}

.nano-status-bar {
    background: #0000ff;
    color: #ffffff;
    padding: 2px 4px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}

.nano-status-text {
    flex: 1;
}

.nano-cursor-pos {
    margin-left: auto;
    padding-left: 8px;
}

.nano-editor-area {
    flex: 1;
    overflow: hidden;
    display: flex;
    background: #ffffff;
}

.nano-editor {
    flex: 1;
    background: #ffffff;
    color: #000000;
    border: none;
    outline: none;
    padding: 4px;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    overflow-x: hidden;
}

.nano-editor:focus {
    outline: none;
}

.nano-command-bar {
    background: #0000ff;
    color: #ffffff;
    padding: 2px 4px;
    font-weight: bold;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    line-height: 1.4;
    white-space: nowrap;
}

.nano-cmd-key {
    background: #ffffff;
    color: #0000ff;
    padding: 0 2px;
    margin-right: 2px;
    font-weight: bold;
    border-radius: 2px;
}

/* Scrollbar für nano-editor */
.nano-editor::-webkit-scrollbar {
    width: 12px;
}

.nano-editor::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.nano-editor::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

.nano-editor::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===== Chat Window Styles (Schwebendes Fenster) ===== */
.chat-window {
    position: fixed;
    top: 100px;
    right: 50px;
    width: 350px;
    height: 500px;
    min-width: 280px;
    min-height: 300px;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    resize: both;
}

.chat-window.minimized {
    height: auto !important;
    min-height: auto;
    resize: none;
}

.chat-window.minimized .chat-body {
    display: none;
}

.chat-window.maximized {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0;
    resize: none;
}

.chat-header {
    background: var(--bg-tertiary);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    cursor: move;
    user-select: none;
    flex-shrink: 0;
    border-radius: 8px 8px 0 0;
}

.chat-window.maximized .chat-header {
    border-radius: 0;
    cursor: default;
}

.chat-header-buttons {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.chat-header-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    padding: 0;
}

.chat-header-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.chat-header-btn.close {
    background: var(--btn-close, #ff5f56);
}

.chat-header-btn.minimize {
    background: var(--btn-minimize, #ffbd2e);
}

.chat-header-btn.maximize {
    background: var(--btn-maximize, #27c93f);
}

.chat-header-title {
    flex: 1;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-secondary);
}

.chat-users-section {
    border-bottom: 1px solid var(--border-color);
    max-height: 120px;
    overflow-y: auto;
    flex-shrink: 0;
}

.chat-users-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
}

.chat-users-title {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    flex: 1;
}

.chat-create-group-btn {
    padding: 4px 8px;
    margin-right: 8px;
    background: var(--accent-color);
    color: var(--bg-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.chat-create-group-btn:hover {
    background: var(--accent-hover);
}

.chat-user-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-user-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.chat-user-item:hover {
    background: var(--bg-tertiary);
}

.chat-user-item.active {
    background: var(--bg-hover);
    border-left: 2px solid var(--accent-color);
}

.chat-user-item.has-unread {
    font-weight: bold;
}

.chat-user-item.group-chat {
    background: var(--bg-secondary);
}

.chat-user-separator {
    padding: 0;
    margin: 4px 0;
}

.chat-user-separator hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0;
}

.chat-user-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    flex-shrink: 0;
}

.chat-user-name {
    flex: 1;
    color: var(--text-primary);
    font-size: 13px;
}

.chat-user-badge {
    background: var(--accent-color);
    color: var(--bg-primary);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.chat-messages-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-messages-header {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--accent-color);
}

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

.chat-message {
    max-width: 90%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.sent {
    align-self: flex-end;
    background: var(--accent-color);
    color: var(--bg-primary);
    border-bottom-right-radius: 4px;
}

.chat-message.received {
    align-self: flex-start;
    background: var(--bg-hover);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-message.sent .chat-message-time {
    text-align: right;
}

.chat-message-sender {
    font-size: 11px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 4px;
    opacity: 0.9;
}

.chat-no-messages {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

.chat-select-user {
    color: var(--text-secondary);
    text-align: center;
    padding: 40px 20px;
    font-size: 13px;
}

.chat-input-section {
    padding: 12px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--accent-color);
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    color: var(--bg-primary);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-send-btn:hover {
    background: var(--accent-hover);
}

.chat-send-btn:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Chat Benachrichtigung im Terminal */
.chat-notification {
    background: var(--bg-hover);
    border-left: 3px solid var(--accent-color);
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 0 4px 4px 0;
}

.chat-notification-icon {
    color: var(--accent-color);
    margin-right: 8px;
}

/* Gruppen-Erstellungs-Dialog */
.chat-group-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

.chat-group-dialog-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.chat-group-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.chat-group-dialog-header h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0;
}

.chat-group-dialog-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chat-group-dialog-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chat-group-dialog-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.chat-group-dialog-body label {
    display: block;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: bold;
}

.chat-group-name-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    margin-top: 4px;
    margin-bottom: 16px;
}

.chat-group-users-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
    background: var(--bg-primary);
}

.chat-group-user-item {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chat-group-user-item:hover {
    background: var(--bg-hover);
}

.chat-group-user-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.chat-group-user-item span {
    color: var(--text-primary);
    font-size: 13px;
}

.chat-group-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.chat-group-dialog-cancel,
.chat-group-dialog-create {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-group-dialog-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.chat-group-dialog-cancel:hover {
    background: var(--bg-hover);
}

.chat-group-dialog-create {
    background: var(--accent-color);
    color: var(--bg-primary);
    border-color: var(--accent-color);
}

.chat-group-dialog-create:hover {
    background: var(--accent-hover);
}

.chat-group-dialog-create:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* ===== Theme-Specific Adjustments ===== */

/* macOS specific */
[data-theme="macos"] .terminal-container {
    border-radius: 8px;
    overflow: hidden;
    margin: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="macos"] .terminal-header {
    background: linear-gradient(180deg, #3c3c3c 0%, #2d2d30 100%);
}

/* Windows specific */
[data-theme="windows"] .terminal-header {
    background: var(--bg-secondary);
}

/* PowerShell specific */
[data-theme="powershell"] .terminal-header {
    background: var(--bg-secondary);
    padding: 4px 8px;
}

[data-theme="powershell"] .terminal-title {
    font-family: 'Consolas', 'Courier New', monospace;
}

/* ===== Wayland File Manager Styles ===== */

.wayland-window {
    position: fixed;
    width: 800px;
    height: 600px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--terminal-border-radius, 0);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
}

.wayland-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--header-padding, 8px 16px);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: move;
    user-select: none;
}

.wayland-window-title {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    text-align: var(--window-title-style, center);
}

.wayland-window-buttons {
    display: flex;
    gap: 8px;
}

.wayland-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.2s;
}

.wayland-btn:hover {
    background: var(--bg-hover);
}

.wayland-btn-close:hover {
    background: var(--error-color);
    color: white;
}

.wayland-window-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

.wayland-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.wayland-toolbar-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: background-color 0.2s;
}

.wayland-toolbar-btn:hover {
    background: var(--bg-hover);
}

.wayland-path-display {
    flex: 1;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: monospace;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.wayland-file-view {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    align-content: start;
}

.wayland-file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.wayland-file-item:hover {
    background: var(--bg-hover);
}

.wayland-file-icon {
    font-size: 48px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wayland-file-name {
    color: var(--text-primary);
    font-size: 12px;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
}

/* Retro Theme Icons */
[data-theme="retro"] .wayland-file-icon {
    filter: grayscale(100%) brightness(1.2);
}

[data-theme="retro"] .retro-icon-folder,
[data-theme="retro"] .retro-icon-file,
[data-theme="retro"] .retro-icon-image,
[data-theme="retro"] .retro-icon-pdf {
    font-size: 48px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* OS Theme Icons */
.os-icon-folder,
.os-icon-file,
.os-icon-image,
.os-icon-pdf {
    font-size: 48px;
}

.wayland-file-content {
    padding: 20px;
    overflow-y: auto;
    color: var(--text-primary);
}

.wayland-file-content h1,
.wayland-file-content h2,
.wayland-file-content h3,
.wayland-file-content h4,
.wayland-file-content h5,
.wayland-file-content h6 {
    color: var(--text-primary);
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.wayland-file-content p {
    margin: 1em 0;
    line-height: 1.6;
}

.wayland-file-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.wayland-file-content pre {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 4px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.wayland-file-content pre code {
    background: transparent;
    padding: 0;
}

.wayland-file-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.wayland-text-content {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 16px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

.wayland-pdf-viewer {
    padding: 20px;
    overflow-y: auto;
}

.wayland-error {
    padding: 20px;
    color: var(--error-color);
    text-align: center;
}

.wayland-loading {
    padding: 20px;
    color: var(--text-secondary);
    text-align: center;
}

.wayland-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 0%, transparent 40%, var(--border-color) 40%, var(--border-color) 45%, transparent 45%, transparent 50%, var(--border-color) 50%, var(--border-color) 55%, transparent 55%);
}

.wayland-resize-handle:hover {
    background: linear-gradient(135deg, transparent 0%, transparent 40%, var(--accent-color) 40%, var(--accent-color) 45%, transparent 45%, transparent 50%, var(--accent-color) 50%, var(--accent-color) 55%, transparent 55%);
}

/* Theme-specific adjustments */
[data-theme="macos"] .wayland-window {
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="windows"] .wayland-window {
    border-radius: 0;
}

[data-theme="powershell"] .wayland-window {
    border-radius: 0;
    border: 2px solid var(--border-color);
}
