/* Browser Extension Styles - Unified Stylesheet */
/* Version: 1.0.0 - For popup, sidepanel, and content areas */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
	/* Base theme colors */
	--primary-color: #6fd42f;
	--secondary-color: #4caf50;
	--accent-color: #bcffb4;
	--accent-light: #dcf5dc;
	--accent-dark: #008807;
	--light-color: #f5fff2;
	--dark-color: #2c3e2e;
	
	/* Additional accent variations */
	--accent-hover: #eaf5ea;
	--accent-active: #a5d6a7;
	
	/* Content colors */
	--content-bg: var(--light-color);
	--content-text: var(--dark-color);
	
	/* State colors */
	--state-selected-bg: var(--accent-light);
	--state-selected-text: var(--dark-color);
	--state-hover-bg: var(--accent-hover);
	--state-hover-text: var(--dark-color);
	--state-disabled-bg: #f0f0f0;
	--state-disabled-text: #999999;
	
	/* Special colors */
	--error-color: #ff5252;
	--warning-color: #ffc107;
	--success-color: #4caf50;
	--info-color: #2196f3;
	
	/* Error/success backgrounds */
	--error-bg: #ffefef;
	--success-bg: #e9f7ef;
	--info-bg: #e3f2fd;
	
	/* Border and text colors */
	--border-color: #d0e8c5;
	--text-color: var(--content-text);
	
	/* Form colors */
	--input-bg: #e8f5e9;
	
	/* Progress bar colors */
	--progress-track: #e9ecef;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
	:root {
		--content-bg: #1a291c;
		--content-text: #f5fff2;
		--state-hover-bg: #2a3a2c;
		--state-selected-bg: #2a3a2c;
		--border-color: #324634;
		--progress-track: #324634;
		--error-bg: rgba(255, 82, 82, 0.2);
		--success-bg: rgba(76, 175, 80, 0.2);
		--info-bg: rgba(33, 150, 243, 0.2);
		--input-bg: #2a3a2c;
	}
}

/* ========================================
   GLOBAL STYLES
   ======================================== */
* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PT Sans', Tahoma, Arial, Helvetica, Verdana, sans-serif;
	color: var(--text-color);
	background-color: var(--content-bg);
	font-size: 13px;
}

.hidden {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.spacer {
	height: 16px;
}

/* ========================================
   POPUP STYLES
   ======================================== */

body.popup {
	width: 420px;
	min-height: 280px;
	background: var(--light-color);
}

.popup-header {
	display: flex;
	align-items: center;
	padding: 16px 20px;
	background: var(--light-color);
	border-bottom: 1px solid var(--border-color);
	text-decoration: none;
	color: inherit;
	position: relative;
}

.popup-header img {
	height: 48px;
	margin-right: 12px;
}

.header-content {
	flex: 1;
}

.extension-title {
	display: block;
	font-size: 18px;
	font-weight: 600;
	color: var(--secondary-color);
	line-height: 1.2;
}

.extension-description {
	display: block;
	font-size: 13px;
	color: var(--dark-color);
	opacity: 0.8;
	margin-top: 2px;
	line-height: 1.3;
}

.header-actions {
	position: absolute;
	top: 16px;
	right: 20px;
	display: flex;
	align-items: center;
	gap: 4px;
}

.header-icon-btn {
	background: none;
	border: none;
	font-size: 16px;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 4px;
	opacity: 0.7;
	transition: all 0.2s ease;
}

.header-icon-btn:hover {
	opacity: 1;
	background: var(--accent-light);
}

.logout-link {
	background: none;
	border: none;
	font-size: 16px;
	color: var(--dark-color);
	opacity: 0.6;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.logout-link:hover {
	opacity: 1;
	background: var(--accent-light);
}

.popup-content {
	padding: 12px;
}

.instructions-box {
	background: #ffffff;
	border-radius: 8px;
	padding: 14px;
	border: 1px solid #e8e8e8;
}

.instructions-box h3 {
	font-size: 15px;
	font-weight: 600;
	color: #2c2c2c;
	margin-bottom: 16px;
}

.instructions-box ol {
	margin-left: 8px;
	margin-bottom: 16px;
	padding-left: 16px;
}

.youtube-link {
	color: #1a73e8;
	text-decoration: underline;
}

.youtube-link:hover {
	color: #174ea6;
}

.instructions-box li {
	margin-bottom: 10px;
	color: #4a4a4a;
	font-size: 14px;
	line-height: 1.5;
}

.step-keyword {
	font-weight: 600;
	color: var(--secondary-color);
}

.note-box {
	padding: 12px;
	background: var(--success-bg);
	border-left: 3px solid var(--secondary-color);
	border-radius: 4px;
	font-size: 13px;
	color: #2e7d32;
}

.note-box strong {
	font-weight: 600;
}

.popup-inline-icon {
	vertical-align: middle;
	margin-left: 2px;
	font-size: 14px !important;
	padding: 2px 4px !important;
}

.bookmarks-line {
	display: flex;
	align-items: center;
	padding-top: 12px;
	border-top: 1px solid var(--border-color);
	font-size: 14px;
	color: #4a4a4a;
}

.instructions-section {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--border-color);
}

.instructions-section h4 {
	font-size: 13px;
	font-weight: 600;
	color: var(--dark-color);
	margin: 0 0 8px 0;
}

.instructions-section p {
	font-size: 13px;
	line-height: 1.5;
	color: #5f6368;
	margin: 0;
}

.action-buttons {
	margin-top: 20px;
	text-align: center;
}

.open-sidebar-btn {
	background: var(--secondary-color);
	color: white;
	border: none;
	border-radius: 6px;
	padding: 12px 24px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.open-sidebar-btn:hover {
	background: #0d8a4d;
}

/* Settings Section */
.settings-section {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 2px solid var(--border-color);
}

.settings-section h3 {
	font-size: 14px;
	font-weight: 600;
	color: var(--dark-color);
	margin: 0 0 16px 0;
}

.setting-group {
	margin-bottom: 8px;
}

.setting-group > .radio-label-compact {
	border: 1px solid var(--border-color);
	border-radius: 8px;
}

.setting-group > .radio-label-compact:hover {
	background: #f8f9fa;
	border-color: var(--secondary-color);
}

.setting-group-title {
	font-size: 12px;
	font-weight: 600;
	color: #5f6368;
	margin: 12px 0 4px 0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.radio-label-compact {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	cursor: pointer;
}

.radio-label-compact strong {
	font-size: 13px;
	color: var(--dark-color);
}

.radio-label-compact .radio-description {
	margin-left: auto;
}

.radio-label-compact input[type="radio"] {
	margin: 0;
	cursor: pointer;
}

.chatbot-options {
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 2px 0;
	margin-top: 4px;
}

.chatbot-options .radio-label-compact {
	padding: 5px 10px;
}

.chatbot-options .radio-label-compact:not(:last-child) {
	border-bottom: 1px solid #f0f0f0;
}

.chatbot-options .radio-label-compact:hover {
	background: #f8f9fa;
}

.radio-label-compact.disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.radio-label-compact.disabled input[type="radio"] {
	pointer-events: none;
}

.radio-label-compact.disabled strong,
.radio-label-compact.disabled .radio-description {
	color: #999;
}

#apiAuthHint.auth-warning {
	color: #e65100;
	font-weight: 600;
}

#apiAuthHint.auth-ok {
	color: #0d7c3d;
	font-weight: 500;
}

.radio-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	padding: 12px;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	transition: all 0.2s;
}

.radio-label:hover {
	background: #f8f9fa;
	border-color: var(--secondary-color);
}

.radio-label input[type="radio"] {
	margin-top: 2px;
	cursor: pointer;
}

.radio-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.radio-text strong {
	font-size: 13px;
	color: var(--dark-color);
}

.radio-description {
	font-size: 11px;
	color: #5f6368;
}

.llm-options-global {
	margin: 16px 0 12px 12px;
	padding: 12px;
	background: #f8f9fa;
	border-radius: 6px;
}

.llm-options {
	margin-top: 12px;
	margin-left: 28px;
	padding: 12px;
	background: #f8f9fa;
	border-radius: 6px;
	display: none;
}

.llm-options.active {
	display: block;
}

.llm-options label {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: var(--dark-color);
	margin-bottom: 6px;
}

.llm-selector {
	width: 100%;
	padding: 8px;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	font-size: 13px;
	margin-bottom: 12px;
	cursor: pointer;
}

.checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: #5f6368;
	cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
	cursor: pointer;
}

.settings-save-status {
	margin-top: 12px;
	font-size: 12px;
	color: var(--secondary-color);
	min-height: 18px;
	opacity: 0;
	transition: opacity 0.3s;
}

.demo-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 12px;
	background: #ff0000;
	color: white;
	border: none;
	border-radius: 18px;
	font-size: 13px;
	font-weight: 500;
	vertical-align: middle;
	white-space: nowrap;
	pointer-events: none;
	line-height: 1.4;
}

/* ========================================
   FORM STYLES
   ======================================== */

.form-group {
	margin-bottom: 16px;
}

.form-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: var(--dark-color);
	font-size: 14px;
}

.form-group input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	font-size: 14px;
	background: var(--input-bg);
	color: var(--dark-color);
	transition: all 0.2s ease;
}

.form-group input:focus {
	outline: none;
	border-color: var(--secondary-color);
	background: white;
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input::placeholder {
	color: rgba(44, 62, 46, 0.5);
}

.form-group.error input {
	border-color: var(--error-color);
	background: var(--error-bg);
}

.form-error {
	display: none;
	color: var(--error-color);
	font-size: 12px;
	margin-top: 4px;
}

.form-group.error .form-error {
	display: block;
}

.submit-btn {
	width: 100%;
	padding: 14px;
	background: var(--accent-color);
	color: var(--dark-color);
	border: none;
	border-radius: 25px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	margin-top: 8px;
}

.submit-btn:hover {
	background: var(--secondary-color);
	color: white;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.submit-btn:active {
	transform: translateY(0);
}

.submit-btn:disabled {
	background: var(--state-disabled-bg);
	color: var(--state-disabled-text);
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.help-text {
	font-size: 12px;
	color: #666;
	margin-top: 8px;
	line-height: 1.4;
}

/* ========================================
   TABBAR
   ======================================== */

.tabbar {
	display: flex;
	background: var(--light-color);
	border-bottom: 1px solid var(--border-color);
}

.tab {
	flex: 1;
	padding: 14px 0;
	text-align: center;
	font-size: 14px;
	font-weight: 500;
	color: var(--secondary-color);
	cursor: pointer;
	border-bottom: 3px solid transparent;
	transition: all 0.2s ease;
	background: var(--light-color);
	user-select: none;
}

.tab:hover {
	background: var(--accent-light);
}

.tab.active {
	border-bottom-color: var(--secondary-color);
	color: var(--dark-color);
	font-weight: 600;
}

.tab-content {
	display: none;
	padding: 24px 20px;
	background: var(--light-color);
}

.tab-content.active {
	display: block;
}

/* Toast notification */
.toast-message {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: #323232;
	color: #fff;
	padding: 8px 20px;
	border-radius: 6px;
	font-size: 13px;
	z-index: 3000;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	white-space: nowrap;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.toast-message.show {
	opacity: 1;
}

/* ========================================
   LOADING & MESSAGES
   ======================================== */

.loading {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid #f3f3f3;
	border-top-color: var(--secondary-color);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	margin-right: 8px;
	vertical-align: middle;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.message {
	padding: 12px;
	border-radius: 6px;
	margin-bottom: 16px;
	font-size: 13px;
	line-height: 1.5;
	display: none;
}

.message.show {
	display: block;
}

.message.success {
	background: var(--success-bg);
	color: var(--dark-color);
	border: 1px solid var(--success-color);
}

.message.error {
	background: var(--error-bg);
	color: var(--dark-color);
	border: 1px solid var(--error-color);
}

.message.info {
	background: var(--info-bg);
	color: var(--dark-color);
	border: 1px solid var(--info-color);
}

/* ========================================
   SIDEPANEL STYLES
   ======================================== */

body.sidepanel {
	height: 100vh;
	overflow: hidden;
	background-color: var(--content-bg) !important;
	color: var(--text-color) !important;
}

.sidepanel-container {
	height: 100vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Sidebar Toolbar */
.sidepanel-toolbar {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 4px 8px;
	background: var(--accent-light);
	border-bottom: 1px solid var(--border-color);
	flex-shrink: 0;
}

.toolbar-icon-btn {
	background: none;
	border: none;
	font-size: 14px;
	cursor: pointer;
	padding: 3px 6px;
	border-radius: 4px;
	opacity: 0.6;
	transition: all 0.2s ease;
}

.toolbar-icon-btn:hover {
	opacity: 1;
	background: rgba(76, 175, 80, 0.15);
}

.toolbar-video-title {
	font-size: 13px;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
	cursor: pointer;
	text-decoration: none;
	padding: 2px 4px;
	border-radius: 3px;
	transition: background 0.15s, color 0.15s;
}

.toolbar-video-title:hover {
	color: #1a73e8;
	background: rgba(26, 115, 232, 0.08);
}

.toolbar-video-title:empty {
	display: none;
}

.toolbar-spacer {
	flex: 1;
}

/* Bookmark Browser Slide-out Panel */
.bookmark-browser {
	position: fixed;
	top: 0;
	left: -65%;
	width: 60%;
	height: 100vh;
	background: #ffffff;
	box-shadow: 3px 0 12px rgba(0, 0, 0, 0.2);
	z-index: 2000;
	display: flex;
	flex-direction: column;
	transition: left 0.3s ease;
}

.bookmark-browser.open {
	left: 0;
}

.bookmark-browser-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
	z-index: 1999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.bookmark-browser-overlay.open {
	opacity: 1;
	pointer-events: auto;
}

.bookmark-browser-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	background: var(--accent-light);
	border-bottom: 1px solid var(--border-color);
	flex-shrink: 0;
}

.bookmark-browser-title {
	font-size: 14px;
	font-weight: 600;
	color: #2c2c2c;
}

.bookmark-browser-close {
	background: none;
	border: none;
	font-size: 16px;
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 4px;
	color: #666;
	transition: all 0.2s;
}

.bookmark-browser-close:hover {
	background: rgba(0, 0, 0, 0.1);
	color: #333;
}

/* Bookmark Browser Webix Tree Container */
.bookmark-browser-tree-wrap {
	flex: 1;
	overflow: hidden;
	min-height: 0;
}

/* ── Bookmark sctreetable ──
   Mirrors LLM-SSH .wx-tree-icon / .wx-tree-label pattern */
.wx-tree-icon {
	margin-right: 4px;
}

.wx-tree-label {
	font-size: 12px;
}

.bm-tree-channel {
	font-size: 10px;
	color: #065fd4;
	margin-left: 6px;
}

.bm-tree-date {
	font-size: 10px;
	color: var(--text-muted, #999);
	margin-left: 6px;
	white-space: nowrap;
}

/* D&D ghost: Webix uses env.zIndexBase (~100); bookmark panel is 2000+ - lift above + style (docs: DragItem.$drag / .webix_drag_zone) */
body.sidepanel .webix_drag_zone {
	z-index: 25000 !important;
	pointer-events: none;
	max-width: min(420px, 92vw);
	box-sizing: border-box;
}
body.sidepanel .webix_drag_zone .bm-drag-ghost {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 8px;
	min-height: 36px;
	min-width: 200px;
	max-width: 400px;
	padding: 8px 12px;
	background: #fff;
	border: 1px solid var(--border-color, #c5c5c5);
	border-radius: 6px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
	font-size: 13px;
	font-weight: 500;
	color: #222;
	line-height: 1.35;
}
body.sidepanel .webix_drag_zone .bm-drag-ghost-icon {
	font-size: 16px;
	line-height: 1;
	flex-shrink: 0;
}
body.sidepanel .webix_drag_zone .bm-drag-ghost-label {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
body.sidepanel .webix_drag_zone .bm-drag-ghost-sub {
	flex-basis: 100%;
	font-size: 11px;
	font-weight: 400;
	color: #065fd4;
	margin-left: 24px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
body.sidepanel .webix_drag_zone .bm-drag-ghost-multi .bm-drag-ghost-label {
	flex: none;
}

/* Action buttons on tree rows - shown on hover (same pattern as .wx-tree-play) */
.bm-tree-delete,
.bm-tree-rename {
	float: right;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s;
	padding: 0 4px;
	font-size: 12px;
	color: var(--text-muted, #999);
}

.bm-tree-delete:hover {
	color: var(--accent-danger, #f44336);
}

.bm-tree-rename:hover {
	color: var(--accent-primary, #4caf50);
}

.webix_row_hover .bm-tree-delete,
.webix_row_hover .bm-tree-rename {
	opacity: 1;
}

/* ── Folder picker popup ── */
.bm-folder-picker-win {
	border-radius: 6px !important;
	overflow: hidden;
}

.bm-folder-picker-head {
	background: var(--bg-secondary, var(--accent-light)) !important;
}

.bm-folder-picker-tree {
	border: none !important;
}

.bm-folder-picker-tree .webix_tree_item {
	font-size: 13px;
	line-height: 30px;
}


/* Text prompt modal (new / rename folder) */
.bm-prompt-win {
	border-radius: 6px !important;
	overflow: hidden;
}
.bm-prompt-head {
	background: var(--bg-secondary, var(--accent-light)) !important;
}
.bm-prompt-text input {
	font-size: 13px !important;
}

/* Settings Slide-out Panel (from right) */
.settings-panel {
	position: fixed;
	top: 0;
	right: -85%;
	width: 80%;
	height: 100vh;
	background: #ffffff;
	box-shadow: -3px 0 12px rgba(0, 0, 0, 0.2);
	z-index: 2000;
	display: flex;
	flex-direction: column;
	transition: right 0.3s ease;
}

.settings-panel.open {
	right: 0;
}

.settings-panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	background: var(--accent-light);
	border-bottom: 1px solid var(--border-color);
	flex-shrink: 0;
}

.settings-panel-title {
	font-size: 14px;
	font-weight: 600;
	color: #2c2c2c;
}

.settings-panel-content {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
}

.settings-panel-section {
	display: flex;
	flex-direction: column;
}

.settings-panel-section:last-of-type {
	flex: 1;
}

.settings-panel-label {
	font-size: 13px;
	font-weight: 600;
	color: #2c2c2c;
	margin-bottom: 6px;
}

.settings-panel-hint {
	font-size: 11px;
	color: #666;
	margin-bottom: 8px;
	line-height: 1.4;
}

.settings-panel-hint code {
	background: #f0f0f0;
	padding: 1px 4px;
	border-radius: 3px;
	font-size: 11px;
}

.settings-panel-textarea {
	flex: 1;
	width: 100%;
	min-height: 200px;
	padding: 8px 10px;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	font-family: monospace;
	font-size: 12px;
	line-height: 1.5;
	resize: vertical;
	outline: none;
	box-sizing: border-box;
}

.settings-panel-textarea:focus {
	border-color: var(--secondary-color);
	box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
}

.settings-panel-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding-top: 10px;
	flex-shrink: 0;
}

.settings-panel-btn {
	padding: 6px 16px;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s;
}

.settings-panel-btn.primary {
	background: var(--secondary-color);
	color: #fff;
}

.settings-panel-btn.primary:hover {
	background: #388e3c;
}

.settings-panel-btn.secondary {
	background: #f0f0f0;
	color: #555;
}

.settings-panel-btn.secondary:hover {
	background: #e0e0e0;
}

.settings-panel-divider {
	border-top: 1px solid #e0e0e0;
	margin: 4px 0 12px;
}

.settings-auth-row {
	margin-bottom: 8px;
}

.settings-auth-field-label {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: #555;
	margin-bottom: 3px;
}

.settings-auth-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 13px;
	font-family: inherit;
	box-sizing: border-box;
}

.settings-auth-input:focus {
	outline: none;
	border-color: #1a73e8;
	box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

.settings-auth-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
}

.settings-auth-status {
	font-size: 12px;
	white-space: nowrap;
}

.settings-auth-status.success {
	color: #0d7c3d;
}

.settings-auth-status.error {
	color: #d93025;
}

.settings-auth-status.pending {
	color: #999;
}

.settings-auth-status.warning {
	color: #e65100;
	font-weight: 500;
}

.backup-icon {
	float: right;
	font-size: 13px;
	padding: 0 2px;
	opacity: 0.4;
	margin: -2px -4px 0 0;
}

.backup-icon:hover {
	opacity: 1;
}

.video-info {
	padding: 8px 12px;
	background: var(--accent-light);
	border-bottom: 1px solid var(--border-color);
	margin: 0;
}

.video-header-content {
	display: block;
}

.video-title-section {
	margin-bottom: 4px;
}

.video-meta-line {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 4px;
}

.video-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
	font-size: 12px;
	color: #5f6368;
}

.video-meta:empty {
	display: none;
}

.video-meta .meta-item {
	display: flex;
	align-items: center;
	gap: 3px;
	white-space: nowrap;
}

.video-meta .meta-separator {
	color: #dadce0;
}

.video-meta .meta-value {
	color: #202124;
	font-weight: 500;
}

/* Video action buttons */
.video-actions {
	display: flex;
	align-items: center;
	gap: 2px;
	width: 100%;
}

.actions-spacer {
	flex: 1;
}

.icon-btn {
	background: transparent;
	border: none;
	font-size: 14px;
	cursor: pointer;
	padding: 2px 4px;
	border-radius: 3px;
	transition: all 0.2s;
	opacity: 0.6;
	line-height: 1;
}

.icon-btn:hover {
	opacity: 1;
	background: rgba(76, 175, 80, 0.1);
}

.icon-btn:active {
	transform: scale(0.95);
}

.icon-btn.bookmarked {
	opacity: 1;
	color: #ffc107;
}

/* Bookmark buttons */
.bookmark-container {
	position: relative;
	display: flex;
	align-items: center;
	gap: 2px;
}

.bookmark-folder-btn {
	font-size: 10px;
	padding: 2px 3px;
}

.bookmark-empty {
	padding: 20px;
	text-align: center;
	color: #999;
	font-size: 13px;
}

/* Language dropdown */
.language-container {
	position: relative;
	display: flex;
	align-items: center;
	gap: 2px;
}

.language-dropdown-btn {
	font-size: 10px;
	padding: 2px 3px;
}

.language-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	margin-top: 4px;
	background: white;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	max-width: calc(100vw - 8px);
	z-index: 1000;
	min-width: 200px;
}

.language-header {
	padding: 10px 12px;
	border-bottom: 1px solid var(--border-color);
	font-weight: 600;
	font-size: 13px;
	color: var(--dark-color);
}

.language-list {
	max-height: 300px;
	overflow-y: auto;
}

.language-item {
	padding: 10px 12px;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	transition: background 0.2s;
	display: flex;
	align-items: center;
	gap: 8px;
}

.language-item:hover {
	background: var(--accent-light);
}

.language-item:last-child {
	border-bottom: none;
}

.lang-flag {
	font-size: 18px;
	line-height: 1;
}

.lang-name {
	flex: 1;
	font-size: 13px;
	color: #1a1a1a;
}

.lang-check {
	font-size: 14px;
	color: var(--secondary-color);
	opacity: 0;
	transition: opacity 0.2s;
}

.language-item.active .lang-check {
	opacity: 1;
}

.sidepanel-content {
	flex: 1;
	padding: 0;
	overflow-y: auto;
}

.summary-container {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
	margin: 0;
}

.summary-text {
	font-size: 14px;
	line-height: 1.6;
	color: #202124;
	white-space: normal;
	word-wrap: break-word;
	padding: 4px;
	background: transparent;
	margin: 0;
}

/* Markdown styling */
.summary-text h1,
.summary-text h2,
.summary-text h3,
.summary-text h4 {
	margin-top: 1em;
	margin-bottom: 0.5em;
	color: #1a1a1a;
}

.summary-text h1 { font-size: 1.5em; font-weight: 700; }
.summary-text h2 { font-size: 1.3em; font-weight: 600; }
.summary-text h3 { font-size: 1.1em; font-weight: 600; }

.summary-text p {
	margin-bottom: 1em;
}

.summary-text ul,
.summary-text ol {
	margin-left: 1.5em;
	margin-bottom: 1em;
}

.summary-text li {
	margin-bottom: 0.5em;
}

.summary-text table {
	width: 100%;
	border-collapse: collapse;
	margin: 1em 0;
	border: 1px solid #ddd;
}

.summary-text th,
.summary-text td {
	padding: 8px 12px;
	text-align: left;
	border: 1px solid #ddd;
}

.summary-text th {
	background-color: #f5f5f5;
	font-weight: 600;
}

.summary-text tr:nth-child(even) {
	background-color: #f9f9f9;
}

.summary-text code {
	background-color: #f5f5f5;
	padding: 2px 4px;
	border-radius: 3px;
	font-family: 'Courier New', monospace;
	font-size: 0.9em;
}

.summary-text pre {
	background-color: #f5f5f5;
	padding: 12px;
	border-radius: 4px;
	overflow-x: auto;
	margin: 1em 0;
}

.summary-text pre code {
	background-color: transparent;
	padding: 0;
}

.summary-text blockquote {
	border-left: 4px solid #ddd;
	padding-left: 1em;
	margin-left: 0;
	color: #666;
	font-style: italic;
}

.summary-text strong {
	font-weight: 600;
}

.summary-text em {
	font-style: italic;
}

.summary-text hr {
	border: none;
	border-top: 1px solid #ddd;
	margin: 1.5em 0;
}

.summary-actions {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	background: #f8f9fa;
	border-top: 1px solid #e8eaed;
}

.action-btn {
	flex: 1;
	padding: 10px 12px;
	background: #ffffff;
	color: #1a73e8;
	border: 1px solid #dadce0;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
}

.action-btn:hover {
	background: #f8f9fa;
	border-color: #1a73e8;
}

/* Status messages */
.status {
	padding: 16px;
	margin: 16px;
	border-radius: 8px;
	background: var(--success-bg);
	border: 1px solid var(--border-color);
}

.status.info {
	background: var(--info-bg);
	border-color: var(--info-color);
}

.loading-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	text-align: center;
}

.loading-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 4px;
}

.loading-spinner {
	width: 36px;
	height: 36px;
	border: 4px solid #e8eaed;
	border-top-color: #1a73e8;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

.loading-timer {
	font-size: 28px;
	font-weight: 600;
	color: #1a73e8;
	font-variant-numeric: tabular-nums;
}

.loading-details {
	font-size: 14px;
	color: #5f6368;
	margin-bottom: 16px;
}

/* Progress table */
.progress-table {
	width: 100%;
	max-width: 420px;
	border-collapse: collapse;
	font-size: 12px;
	text-align: left;
	color: #5f6368;
}

.progress-table thead th {
	font-weight: 600;
	color: #9aa0a6;
	text-transform: uppercase;
	font-size: 10px;
	letter-spacing: 0.5px;
	padding: 4px 8px 6px;
	border-bottom: 1px solid #e8eaed;
}

.progress-table tbody td {
	padding: 4px 8px;
	vertical-align: middle;
	border-bottom: 1px solid #f1f3f4;
}

.progress-table .pt-num {
	width: 24px;
	text-align: center;
	color: #9aa0a6;
}

.progress-table .pt-status {
	width: 20px;
	text-align: center;
}

.progress-table .pt-time {
	width: 40px;
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: #9aa0a6;
}

.progress-table tr.active td {
	color: #202124;
	font-weight: 500;
}

.progress-table tr.active .pt-status {
	color: #1a73e8;
}

.progress-table tr.done .pt-status {
	color: #34a853;
}

.progress-table tr.error td {
	color: #ea4335;
}

.progress-table tr.error .pt-status {
	color: #ea4335;
}

.error-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	text-align: center;
}

.error-icon {
	font-size: 48px;
	margin-bottom: 16px;
}

.error-message {
	font-size: 14px;
	color: #d93025;
	margin-bottom: 16px;
	max-width: 400px;
}
