/* main-styles.css */
/* This file contains common, non-theme-specific styles. */
/* Theme-specific variables and overrides are in /themes/*.css */

/*
  NOTE: If you have truly global CSS variables that *never* change with themes,
  you could define them in a :root block here, e.g.:
  :root {
    --global-spacing-unit: 8px;
    --global-font-family: sans-serif;
  }
  However, your current structure defines most variables per-theme.
*/

* {
  box-sizing: border-box;
  /* Transitions on properties that change with themes */
  transition: background-color var(--transition-fast, 100ms ease), /* Provide fallback for transition var */
              color var(--transition-fast, 100ms ease),
              border-color var(--transition-fast, 100ms ease),
              box-shadow var(--transition-normal, 150ms ease),
              transform var(--transition-normal, 150ms ease);
  margin: 0; padding: 0; user-select: none;
}
.message, #collaborativeEditor, input[type="text"], input[type="password"], textarea, .new-card-text-input {
  user-select: text;
}
html, body { height: 100%; width: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary); /* Uses theme variable */
  color: var(--text-primary); /* Uses theme variable */
  line-height: 1.5; display: flex; flex-direction: column; overflow: hidden;
}

.flex { display: flex; } .flex-col { flex-direction: column; } .flex-grow { flex-grow: 1; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); } .gap-md { gap: var(--space-md); }
.overflow-hidden { overflow: hidden; } .overflow-y-auto { overflow-y: auto; } .min-h-0 { min-height: 0; }

.card {
  background-color: var(--bg-card); /* Uses theme variable */
  border: 1px solid var(--border-color); /* Uses theme variable */
  border-radius: var(--radius-sm); /* Uses theme variable */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  /* transition is on * property already */
}
.card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.btn {
  padding: 0.5rem 1rem; border: none; cursor: pointer;
  background-color: var(--accent-color); /* Uses theme variable */
  color: white; /* Often white, but could be a variable if themes change button text color */
  font-weight: 500; font-size: 0.9rem;
  border-radius: var(--radius-sm); /* Uses theme variable */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  /* transition is on * property already */
}
.btn:hover {
  background-color: var(--accent-hover); /* Uses theme variable */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16), 0 2px 4px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}
.btn:disabled { background-color: var(--border-color); cursor: not-allowed; opacity: 0.7; transform: none; }
.btn-danger { background-color: var(--danger-color); } /* Uses theme variable */
.btn-danger:hover { background-color: var(--danger-hover); } /* Uses theme variable */
.btn-outline { background-color: transparent; color: var(--accent-color); border: 1px solid var(--accent-color); }
.btn-outline:hover { background-color: var(--accent-color); color: white; }
.btn-icon { padding: var(--space-sm); font-size: 1.2rem; line-height: 1; min-width: auto; }

.container { width: 100%; flex-grow: 1; height: 100vh; display: flex; flex-direction: column; }
.app-wrapper { flex-grow: 1; max-width: 100%; display: flex; overflow: hidden; height: 100%; }
.main-app-content {
  flex-grow: 1; min-width: 0; padding: var(--space-md);
  overflow-y: auto; background-color: var(--bg-primary); /* Uses theme variable */
  display: flex; flex-direction: column; gap: var(--space-md); height: 100%;
}

.app-header {
  padding: var(--space-sm) var(--space-md); background-color: var(--bg-secondary); /* Uses theme variable */
  border-bottom: 1px solid var(--border-color); /* Uses theme variable */
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.app-header-title-group { display: flex; align-items: center; gap: var(--space-md); }
.app-header h1 { font-size: 1.4rem; margin:0; color: var(--text-primary); } /* Ensure header text uses theme color */
.header-context-area { display: flex; flex-direction: column; gap: var(--space-xs); font-size: 0.85em; }
#headerRoomInfoDisplay { display: flex; gap: var(--space-sm); align-items: center; color: var(--text-secondary); flex-wrap: wrap; }
#headerRoomInfoDisplay strong { color: var(--text-primary); margin-right: var(--space-xs); }

.setup-controls-container {
  padding: var(--space-lg); margin: var(--space-lg) auto; max-width: 500px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  /* .card styles already apply background, border etc. from theme vars */
}

.sidebar-navigation {
  display: flex; flex-direction: column; width: var(--sidebar-width); /* Uses theme variable */
  background-color: var(--bg-secondary); /* Uses theme variable */
  padding: var(--space-md) var(--space-sm);
  border-right: 1px solid var(--border-color); /* Uses theme variable */
  gap: var(--space-xs);
  flex-shrink: 0; height: 100%; overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
}
.sidebar-button {
  padding: var(--space-md); border: none; background-color: transparent;
  color: var(--text-secondary); /* Uses theme variable */
  font-weight: 500; text-align: left; width: 100%;
  /* transition is on * property already */
  position: relative; display: flex; align-items: center; border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.sidebar-button:hover {
  color: var(--accent-color); /* Uses theme variable */
  background-color: var(--user-hover); /* Uses theme variable for hover */
  border-color: var(--border-color); /* Uses theme variable */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.sidebar-button.active {
  color: white; /* Often white for active, could be a variable */
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); /* Uses theme variables */
  border-color: var(--primary); /* Uses theme variable */
  box-shadow: 0 2px 4px rgba(0, 120, 215, 0.3); /* This shadow color might need to be a variable if it clashes with themes */
}
.sidebar-button.active:hover { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); }
.sidebar-button .icon { margin-right: var(--space-md); }
.notification-dot {
  width: 8px; height: 8px; background-color: var(--notification-dot-color); /* Uses theme variable */
  border-radius: 50%; position: absolute; top: 50%; right: var(--space-md);
  transform: translateY(-50%); box-shadow: 0 0 0 2px var(--bg-secondary); /* Uses theme variable for the knockout effect */
}

.content-section { display: flex; flex-direction: column; flex-grow: 1; min-height: 0; height: 100%; }
.section-pane {
  background-color: var(--bg-secondary); /* Uses theme variable */
  padding: var(--space-md);
  border: 1px solid var(--border-color); /* Uses theme variable */
  border-radius: var(--radius-md); /* Uses theme variable */
  display: flex; flex-direction: column; gap: var(--space-md);
  flex-grow: 1; min-height: 0; overflow: auto; height: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
#settingsSection.section-pane { max-width: 600px; margin: 0 auto; height: auto; flex-grow: 0; }

input[type="text"], input[type="password"], input[type="color"],
input[type="file"], textarea, input[type="checkbox"] {
  padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-md);
  font-size: 0.95rem; background-color: var(--bg-card); /* Changed to bg-card for better contrast potential */
  color: var(--text-primary); /* Uses theme variable */
  border: 1px solid var(--border-color); /* Uses theme variable */
  border-radius: var(--radius-sm); /* Uses theme variable */
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  /* transition is on * property already */
}
input[type="range"] { padding: 0; margin-bottom: var(--space-md); }
input[type="checkbox"] { padding: 0; margin: 0 var(--space-xs) 0 0; vertical-align: middle; }
label { vertical-align: middle; color: var(--text-primary); } /* Ensure label color uses theme variable */
input[type="text"], input[type="password"] { height: 34px; width: 100%; }
textarea { width: 100%; min-height: 60px; resize: vertical; }
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
  outline: none; border-color: var(--accent-color); /* Uses theme variable */
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-color) 15%, transparent), inset 0 1px 3px rgba(0, 0, 0, 0.06); /* Adjusted focus shadow */
}
input::placeholder, textarea::placeholder { color: var(--text-secondary); opacity: 0.8; } /* Uses theme variable */

.button-group { margin-bottom: var(--space-md); display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: center; }
.section-pane > .button-group { margin-bottom: 0; }

#chatSection .chat-section-content {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(200px, 1fr);
  gap: var(--space-md); flex: 1; min-height: 0; height: 100%;
}
.chat-main { overflow: hidden; flex-grow: 1; height: 100%; }
#chatArea { flex-grow: 1; overflow-y: auto; padding-right: var(--space-sm); }
.chat-sidebar { display: flex; flex-direction: column; gap: var(--space-md); height: 100%; }
.chat-input-area { display: flex; gap: var(--space-sm); margin-top: var(--space-md); position: relative; }
.chat-input-area input[type=text] { flex-grow: 1; margin-bottom: 0; padding-right: 120px; height: 36px; }
.file-attach-icon, .emoji-icon {
  position: absolute; top: 50%; transform: translateY(-50%); cursor: pointer;
  font-size: 1.1rem; color: var(--text-secondary); /* Uses theme variable */
  transition: color var(--transition-fast);
}
.emoji-icon { right: calc(70px + var(--space-sm)); } /* 70px is approx width of send button */
.file-attach-icon { right: calc(70px + var(--space-sm) + 20px + var(--space-sm)); } /* 20px for emoji icon */
.file-attach-icon:hover, .emoji-icon:hover { color: var(--accent-color); } /* Uses theme variable */

.message {
  margin-bottom: var(--space-md); padding: var(--space-md); word-wrap: break-word;
  max-width: 85%; position: relative; animation: fadeIn 0.2s ease-out;
  border-radius: var(--radius-sm); /* Uses theme variable */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.message.self { background-color: var(--self-message); text-align: right; margin-left: auto; } /* Uses theme variable */
.message.other { background-color: var(--other-message); margin-right: auto; } /* Uses theme variable */
.message .sender { font-weight: 600; display: block; font-size: 0.85em; margin-bottom: var(--space-xs); color: var(--text-primary); }
.message .timestamp { font-size: 0.75em; color: var(--text-secondary); margin-left: var(--space-sm); } /* Uses theme variable */
.message.pm { border-left: 2px solid var(--pm-border); } /* Uses theme variable */
.message.pm.self { border: none; border-right: 2px solid var(--pm-border); background-color: var(--pm-self); } /* Uses theme variable */
.message.pm.other { background-color: var(--pm-other); } /* Uses theme variable */
.message.file-message { background-color: var(--file-message-bg); } /* Uses theme variable */
.system-message {
  font-style: italic; color: var(--system-text); text-align: center; /* Uses theme variable */
  margin: var(--space-md) 0; padding: var(--space-sm) var(--space-md);
  background-color: var(--system-message); font-size: 0.85em; max-width: none; /* Uses theme variable */
  border-radius: var(--radius-sm); /* Uses theme variable */
}

.file-info-container { display: flex; flex-direction: column; gap: var(--space-xs); }
.chat-file-preview-link { display: inline-block; line-height: 0; cursor: pointer; border-radius: var(--radius-sm); overflow: hidden; }
.chat-file-preview-link:hover img { opacity: 0.85; box-shadow: 0 0 8px var(--accent-color); } /* Uses theme variable */
.chat-file-preview {
  max-width: var(--MAX_PREVIEW_DIM); max-height: var(--MAX_PREVIEW_DIM); /* Uses theme variable */
  width: auto; height: auto; object-fit: cover;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm); display: block; /* Uses theme variables */
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}
.message.self .file-info-container { align-items: flex-end; }
.message.other .file-info-container { align-items: flex-start; }
.file-text-info { display: inline-block; font-size: 0.9em; color: var(--text-secondary); } /* Uses theme variable */
.file-text-info strong { color: var(--text-primary); } /* Uses theme variable */
.file-text-info a { color: var(--accent-color); text-decoration: underline; } /* Uses theme variable */
.file-text-info a:hover { color: var(--accent-hover); } /* Uses theme variable */


.channel-list-container { max-height: 200px; overflow-y: auto; margin-bottom: var(--space-md); flex-grow: 1; }
/* .card styles apply to channel-list-container */
.channel-list-item {
  padding: var(--space-sm) var(--space-md); cursor: pointer;
  border-bottom: 1px solid var(--border-color); font-size: 0.9em; /* Uses theme variable */
  display: flex; justify-content: space-between; align-items: center; border-radius: var(--radius-sm);
  /* transition is on * property already */
}
.channel-list-item:last-child { border-bottom: none; }
.channel-list-item:hover { background-color: var(--user-hover); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); } /* Uses theme variable */
.channel-list-item.active {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%); /* Uses theme variables */
  color: white; font-weight: 600; box-shadow: 0 2px 4px color-mix(in srgb, var(--accent-color) 30%, transparent); /* Uses theme variable */
}
.channel-list-item .channel-notification-dot { /* Style for notification dots on channels */
    width: 6px; height: 6px; background-color: var(--notification-dot-color);
    border-radius: 50%; margin-left: auto;
}
.add-channel-controls { display: flex; flex-direction: column; gap: var(--space-sm); margin-top: auto; }
.add-channel-controls input[type="text"] { margin-bottom: 0; }

#userList { list-style-type: none; max-height: 300px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--text-secondary) transparent; }
/* .card styles apply to #userList */
#userList li { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-color); font-size: 0.9em; transition: background-color var(--transition-fast); } /* Uses theme variable */
#userList li:last-child { border-bottom: none; }
#userList li.peer-name-container { display: flex; justify-content: space-between; align-items: center; }
.peer-info-clickable { display: flex; align-items: center; flex-grow: 1; cursor: pointer; color: var(--text-primary); }
.peer-info-clickable .status-badge {
    width: 8px; height: 8px; background-color: #4caf50; /* Green for online, could be a variable */
    border-radius: 50%; margin-right: var(--space-sm);
    display: inline-block;
}
.peer-info-clickable:hover { color: var(--accent-color); } /* Uses theme variable */
.peer-volume-control { display: flex; align-items: center; gap: var(--space-xs); margin-left: var(--space-sm); }
.volume-icon { font-size: 0.85em; color: var(--text-secondary); } /* Uses theme variable */

.peer-volume-slider,
#settingsSection input[type="range"]#settingsGlobalVolumeSlider {
  width: 70px; height: 8px; margin: 0; padding: 0; vertical-align: middle;
  accent-color: var(--accent-color); background: transparent; /* Uses theme variable for accent */
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
#settingsSection input[type="range"]#settingsGlobalVolumeSlider { flex-grow: 1; width: auto; }

.peer-volume-slider::-webkit-slider-runnable-track,
#settingsSection input[type="range"]#settingsGlobalVolumeSlider::-webkit-slider-runnable-track {
  width: 100%; height: 4px; cursor: pointer; background: var(--border-color); border-radius: 2px; /* Uses theme variable */
}
.peer-volume-slider::-moz-range-track,
#settingsSection input[type="range"]#settingsGlobalVolumeSlider::-moz-range-track {
  width: 100%; height: 4px; cursor: pointer; background: var(--border-color); border-radius: 2px; border: none; /* Uses theme variable */
}
.peer-volume-slider::-webkit-slider-thumb,
#settingsSection input[type="range"]#settingsGlobalVolumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; border: 1px solid var(--bg-card); /* Uses theme variable */
  height: 12px; width: 12px; border-radius: 50%; background: var(--accent-color); /* Uses theme variable */
  cursor: pointer; margin-top: -4px;
}
.peer-volume-slider::-moz-range-thumb,
#settingsSection input[type="range"]#settingsGlobalVolumeSlider::-moz-range-thumb {
  border: 1px solid var(--bg-card); height: 12px; width: 12px; border-radius: 50%; /* Uses theme variable */
  background: var(--accent-color); cursor: pointer; /* Uses theme variable */
}

#localScreenSharePreviewContainer {
    padding: var(--space-md); max-width: 320px; margin-top: var(--space-md); flex-shrink: 0;
    background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-sm); /* Uses theme variables */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#localScreenSharePreviewContainer h4 { margin-bottom: var(--space-sm); font-size: 0.9em; color: var(--text-primary); text-align: center; } /* Uses theme variable */
#localScreenSharePreviewVideo { width: 100%; aspect-ratio: 16/9; background-color: #111; border-radius: var(--radius-sm); }

#remoteVideosContainer { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-md); flex-grow: 1; min-height: 0; }
#remoteVideoChatContainer { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-md); width: 100%; flex-grow: 1; overflow-y: auto; min-height: 0; }
.remoteVideoContainer, .remote-video-wrapper {
    background-color: var(--bg-card); border-radius: var(--radius-sm); overflow: hidden; /* Uses theme variables */
    display: flex; flex-direction: column; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.remoteVideoContainer { padding: var(--space-sm); }
.remoteVideoContainer p, .remote-video-wrapper p {
    padding: var(--space-xs) var(--space-sm); font-size: 0.85em; color: var(--text-primary); /* Uses theme variable */
    background-color: var(--bg-secondary); text-align: center; border-bottom: 1px solid var(--border-color); /* Uses theme variables */
    flex-shrink: 0;
}
.remoteVideoContainer video, .remote-video-wrapper video {
    width: 100%; object-fit: contain; display: block; flex-grow: 1;
    background-color: #000; /* Video background often black */
    /* transition is on * property already */
}
.remoteVideoContainer .maximize-btn { margin-top: var(--space-xs); padding: var(--space-xs) var(--space-sm); font-size: 0.8em; }

#whiteboardSection { display: flex; flex-direction: column; }
#whiteboardSection .button-group { flex-shrink: 0; margin-bottom: var(--space-sm); }
#whiteboardSection .button-group label { margin-right: var(--space-xs); vertical-align: middle; color: var(--text-primary); }
#whiteboardSection .button-group input[type="color"] {
    padding: 0; width: 38px; height: 38px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); /* Uses theme variables */
    cursor: pointer; margin-bottom: 0; vertical-align: middle; -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-color: transparent; /* Color input itself is transparent, swatch shows color */
}
#whiteboardSection .button-group input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
#whiteboardSection .button-group input[type="color"]::-webkit-color-swatch { border: none; width: 100%; height: 100%; border-radius: calc(var(--radius-sm) - 2px); }
#whiteboardSection .button-group input[type="color"]::-moz-color-swatch { border: none; width: calc(100% - 4px); height: calc(100% - 4px); border-radius: calc(var(--radius-sm) - 2px); margin: 2px; }
#whiteboardSection .button-group input[type="range"] { vertical-align: middle; margin-bottom: 0; accent-color: var(--accent-color); }
#whiteboardSection .button-group #wbLineWidthValue { vertical-align: middle; min-width: 30px; text-align: right; margin-left: var(--space-xs); color: var(--text-secondary); }
#wbTextInputArea {
    display: flex; gap: var(--space-sm); padding: var(--space-sm); background-color: var(--bg-secondary); /* Uses theme variable */
    border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: var(--space-sm); /* Uses theme variables */
    align-items: center; flex-shrink: 0;
}
#wbTextInputArea input[type="text"] { flex-grow: 1; margin-bottom: 0; height: 34px; }
#wbTextInputArea button { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.whiteboard-canvas-container {
  flex-grow: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: var(--space-sm); background-color: var(--bg-card); border: 1px solid var(--border-color); /* Uses theme variables */
  border-radius: var(--radius-md); position: relative; overflow: hidden; /* Uses theme variables */
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}
#whiteboardCanvas { background-color: #FFFFFF; border-radius: var(--radius-sm); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); } /* Canvas usually white */
.wb-tool-palette { display: flex; gap: var(--space-xs); padding: var(--space-xs); margin-right: var(--space-sm); border-radius: var(--radius-sm); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
/* .card styles apply to .wb-tool-palette */
.wb-tool-btn {
  background-color: transparent; border: 1px solid transparent; color: var(--text-primary); /* Uses theme variable */
  padding: var(--space-sm); font-size: 1.1rem; border-radius: var(--radius-sm);
  /* transition is on * property already */
}
.wb-tool-btn:hover { background-color: var(--user-hover); border-color: var(--border-color); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); } /* Uses theme variables */
.wb-tool-btn.active {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%); /* Uses theme variables */
  color: white; border-color: var(--accent-color); box-shadow: 0 2px 4px color-mix(in srgb, var(--accent-color) 30%, transparent); /* Uses theme variable */
}

.kanban-board { display: flex; flex-direction: row; gap: var(--space-md); overflow-x: auto; padding: var(--space-md); flex-grow: 1; min-height: 0; }
/* .card styles apply to .kanban-board (as a container) */
.kanban-column {
  background-color: var(--bg-secondary); padding: var(--space-md); width: 280px; /* Uses theme variable */
  flex-shrink: 0; display: flex; flex-direction: column; border-radius: var(--radius-sm); /* Uses theme variable */
  border: 1px solid var(--border-color); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Uses theme variable */
}
.kanban-column h3 { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-md); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--border-color); color: var(--text-primary); } /* Uses theme variables */
.kanban-cards { min-height: 100px; display: flex; flex-direction: column; gap: var(--space-md); flex-grow: 1; overflow-y: auto; }
.kanban-card {
  padding: var(--space-md); cursor: grab; display: flex; justify-content: space-between;
  align-items: flex-start; border-left: 4px solid transparent; border-radius: var(--radius-sm); /* Uses theme variable */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); background-color: var(--bg-card); /* Uses theme variable for card bg */
  color: var(--text-primary); /* Uses theme variable for card text */
  /* transition is on * property already */
}
.kanban-card:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); transform: translateY(-1px); }
.kanban-card.priority-1 { border-left-color: var(--priority-low); } /* Uses theme variable */
.kanban-card.priority-2 { border-left-color: var(--priority-medium); } /* Uses theme variable */
.kanban-card.priority-3 { border-left-color: var(--priority-high); } /* Uses theme variable */
.kanban-card.priority-4 { border-left-color: var(--priority-critical); } /* Uses theme variable */
.kanban-card.dragging { opacity: 0.5; border: 1px dashed var(--accent-color); } /* Uses theme variable */
.kanban-card .delete-card-btn, .kanban-column .delete-column-btn { /* Style for delete buttons in Kanban */
    background: none; border: none; color: var(--danger-color); cursor: pointer; opacity: 0.7;
    transition: opacity var(--transition-fast); padding: 0 var(--space-xs);
}
.kanban-card .delete-card-btn:hover, .kanban-column .delete-column-btn:hover { opacity: 1; }
.kanban-card-content { flex-grow: 1; }
.kanban-card-priority { /* Style for priority dropdown */
    margin-left: var(--space-sm); padding: var(--space-xs); font-size: 0.8em;
    border-radius: var(--radius-sm); border: 1px solid var(--border-color);
    background-color: var(--bg-secondary); color: var(--text-primary);
}
.add-card-form { margin-top: var(--space-sm); border-top: 1px solid var(--border-color); padding-top: var(--space-sm); }
.new-card-text-input { margin-bottom: var(--space-sm); } /* Uses styles from general textarea */
.add-card-form-actions { display: flex; gap: var(--space-sm); justify-content: flex-end; }
.add-card-btn { width: 100%; margin-top: auto; padding: var(--space-sm); font-size: 0.85em; } /* Add card button at bottom of column */


.document-management-bar { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm); flex-wrap: wrap; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
/* .card styles apply */
#documentList { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.document-list-item { padding: var(--space-xs) var(--space-sm); cursor: pointer; font-size: 0.85rem; border-radius: var(--radius-sm); border: 1px solid transparent; color: var(--text-secondary); }
.document-list-item:hover { background-color: var(--user-hover); border-color: var(--border-color); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); color: var(--text-primary); }
.document-list-item.active {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
  color: white; font-weight: 600; border-color: var(--accent-color); box-shadow: 0 2px 4px color-mix(in srgb, var(--accent-color) 30%, transparent);
}
#collaborativeEditor {
  flex-grow: 1; padding: var(--space-lg); overflow-y: auto; min-height: 150px;
  line-height: 1.7; outline: none; border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  background-color: var(--bg-card); /* Ensure editor bg uses theme */
  border: 1px solid var(--border-color); /* Add border consistent with inputs */
  color: var(--text-primary); /* Ensure editor text uses theme */
}
#collaborativeEditor:focus { border-color: var(--accent-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-color) 15%, transparent), inset 0 1px 3px rgba(0, 0, 0, 0.06); }
.document-formatting-controls { margin-top: var(--space-md); } /* .card and .button-group apply */

/* Theme Switcher Base Styles (positions, etc.) */
.theme-switch { position: relative; cursor: pointer; display: flex; align-items: center; }
.theme-switch::after {
    content: attr(data-theme-name); /* JS sets data-theme-name attribute */
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: var(--text-secondary); /* Uses theme variable */
    margin-top: 4px;
    white-space: nowrap;
    pointer-events: none;
}
.theme-switch-checkbox { display: none; } /* Hide actual checkbox, we style the track/thumb */
.theme-switch-track {
  position: relative; display: inline-block; width: 60px; height: 24px;
  border-radius: 12px; margin: 0 var(--space-sm);
  /* transition is on * property already */
  overflow: hidden;
  /* Default track styles are now in each theme file, e.g., themes/light.css */
  /* [data-theme="light"] .theme-switch-track { ... } */
  /* [data-theme="dark"] .theme-switch-track { ... } */
  /* [data-theme="aero"] .theme-switch-track { ... } */
}
.theme-switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  /* transition for transform (thumb movement) is on * property already */
  /* Theme-specific background and transform are in each theme file */
  /* [data-theme="light"] .theme-switch-thumb { background: white; transform: translateX(2px); } */
}
.light-icon, .dark-icon { color: var(--text-secondary); }


.hidden { display: none !important; }
.copy-room-code-btn {
  background: none; border: none; color: var(--accent-color); cursor: pointer; /* Uses theme variable */
  font-size: 1rem; padding: 0 var(--space-xs); margin-left: var(--space-sm);
  opacity: 0.8; transition: color var(--transition-fast), opacity var(--transition-fast);
}
.copy-room-code-btn:hover { color: var(--accent-hover); opacity: 1; } /* Uses theme variable */

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.settings-option { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-xs); }
.settings-option label { margin-bottom: 0; }
.settings-option input[type="checkbox"] { margin-bottom: 0; accent-color: var(--accent-color); } /* Uses theme variable */
.settings-option input[type="range"] { margin-bottom: 0; }
#settingsPttKeyBtn { margin-bottom: 0; padding: var(--space-xs) var(--space-sm); }
#pttKeyInstructions { font-size: 0.8em; color: var(--text-secondary); margin-left: var(--space-sm); } /* Uses theme variable */
.settings-actions { display: flex; justify-content: flex-start; gap: var(--space-md); margin-top: var(--space-lg); }

/* SVG Definitions - if these colors need to be themed, they need to be CSS variables or inline styles changed by JS */
/* For simple cases, currentColor can be used if fill/stroke are set to it and parent color is themed */
.hidden-svg-defs { /* Class for the SVG container itself if needed */
  width: 0; height: 0; position: absolute; overflow: hidden;
}


@media (max-width: 900px) {
  :root { --sidebar-width: 170px; } /* This definition in :root here will be overridden by theme-specific --sidebar-width if defined */
  /* If sidebar-width is theme-dependent, it should be in each theme file. If global, here is fine. */
  #chatSection .chat-section-content { grid-template-columns: 1fr; }
  .chat-sidebar { margin-top: var(--space-md); }
}
@media (max-width: 768px) {
  .app-wrapper { flex-direction: column; }
  .sidebar-navigation {
    width: 100%; height: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid var(--border-color); padding: var(--space-xs); /* Uses theme variable */
  }
  .sidebar-button { flex-direction: column; padding: var(--space-sm); min-width: 70px; font-size: 0.8em; }
  .sidebar-button .icon { margin-right: 0; margin-bottom: var(--space-xs); }
  .notification-dot { top: var(--space-xs); right: var(--space-xs); transform: none; }
  .kanban-board { flex-direction: column; align-items: stretch; }
  .kanban-column { width: auto; margin-bottom: var(--space-md); }
  #remoteVideoChatContainer { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  #remoteVideosContainer { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  #settingsSection.section-pane { max-width: 100%; margin: 0; }
  #userList li.peer-name-container { flex-wrap: wrap; }
  .peer-volume-control {
    margin-left: calc(var(--space-sm) + 16px); /* Approx status badge width + its margin */
    width: calc(100% - (var(--space-sm) + 16px + var(--space-sm))); /* Adjust for its own margin-left */
    justify-content: flex-end; margin-top: var(--space-xs);
  }
}

/* --- NEW STYLES FOR THREADING --- */
.replying-to-banner {
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-md);
  font-size: 0.85em;
  background-color: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#cancelReplyBtn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger-color);
  font-weight: bold;
  padding: 0 var(--space-sm);
  font-size: 1.1em;
}

.reply-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.2em;
  padding: 0 var(--space-sm);
  margin-left: var(--space-sm);
  opacity: 0.5;
  transition: opacity var(--transition-fast), color var(--transition-fast);
  line-height: 1;
  vertical-align: middle;
}

.message:hover .reply-btn {
  opacity: 1;
}

.reply-btn:hover {
  color: var(--accent-color);
}

.thread-replies-container {
  margin-left: var(--space-lg);
  padding-left: var(--space-md);
  border-left: 2px solid var(--border-color);
  margin-top: var(--space-md);
}

.message-thread-container {
  /* This wrapper helps contain a message and all its replies */
  padding-bottom: var(--space-sm);
}