* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #141416;
    --bg-tertiary: #1c1c1f;
    --border-color: #2a2a2e;
    --text-primary: #ffffff;
    --text-secondary: #a1a1a6;
    --accent: #0a84ff;
    --accent-hover: #409cff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.app-container {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    min-height: 100vh;
}

/* Sidebar styles */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    max-height: 100vh;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.sidebar h2 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.sidebar h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Upload area */
.upload-section {
    margin-bottom: 24px;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-tertiary);
}

.upload-zone:hover {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.05);
}

.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.1);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: 0.5;
}

.upload-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-text span {
    color: var(--accent);
    font-weight: 500;
}

/* Screenshot list */
.screenshot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.screenshot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.screenshot-item:hover {
    background: var(--bg-primary);
}

.screenshot-item.selected {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.1);
}

.screenshot-thumb {
    width: 40px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-primary);
}

.screenshot-info {
    flex: 1;
    min-width: 0;
}

.screenshot-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.screenshot-device {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.screenshot-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.screenshot-delete:hover {
    background: #ff453a20;
    color: #ff453a;
}

.screenshot-transfer {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.screenshot-transfer:hover {
    background: rgba(10, 132, 255, 0.2);
    color: var(--accent);
}

/* Transfer mode styles */
.transfer-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(10, 132, 255, 0.15);
    border: 1px solid var(--accent);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--accent);
}

.transfer-cancel {
    padding: 4px 10px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.2s;
}

.transfer-cancel:hover {
    background: var(--bg-secondary);
}

.screenshot-item.transfer-target {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.1);
}

.screenshot-item.transfer-source-option {
    cursor: pointer;
    border-color: transparent;
}

.screenshot-item.transfer-source-option:hover {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.05);
}

/* Drag handle */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    color: var(--text-secondary);
    opacity: 0.4;
    cursor: grab;
    flex-shrink: 0;
}

.drag-handle:hover {
    opacity: 0.8;
}

.screenshot-item:active .drag-handle {
    cursor: grabbing;
}

/* Drag and drop states */
.screenshot-item.dragging {
    opacity: 0.5;
    background: var(--bg-primary);
}

.screenshot-item.drag-over {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.15);
}

/* Set as Default button */
.set-default-btn {
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.set-default-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--accent);
}

.set-default-btn:active {
    transform: scale(0.98);
}

/* Controls */
.control-group {
    margin-bottom: 20px;
}

.control-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.control-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--bg-tertiary);
    appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.range-value {
    min-width: 40px;
    text-align: right;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Button group */
.btn-group {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.btn-group button {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-group button.active {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-group button:hover:not(.active) {
    color: var(--text-primary);
}

/* Text style bar - compact row with all text formatting options */
.text-style-bar {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.text-style-bar input[type="number"] {
    width: 52px;
    padding: 6px 8px;
    background: var(--bg-primary);
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

.text-style-bar input[type="number"]::-webkit-outer-spin-button,
.text-style-bar input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.text-style-bar input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 2px;
    background: var(--bg-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.text-style-bar input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.text-style-bar input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.text-style-bar select {
    flex: 1;
    min-width: 70px;
    padding: 6px 8px;
    background: var(--bg-primary);
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
}

.text-style-bar input[type="range"] {
    width: 50px;
    height: 32px;
    margin: 0;
    padding: 0 4px;
    background: var(--bg-primary);
    border-radius: 6px;
    cursor: pointer;
    accent-color: var(--accent);
}

.text-style-bar button {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.text-style-bar button:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.text-style-bar button.active {
    background: var(--accent);
    color: white;
}

.text-style-bar button svg {
    width: 14px;
    height: 14px;
}

/* Legacy text-style-group - keeping for backwards compatibility */
.text-style-group {
    display: flex;
    gap: 4px;
}

.text-style-group select {
    flex: 1;
    min-width: 90px;
    padding: 8px 10px;
    background: var(--bg-primary);
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
}

.text-style-group button {
    flex: 0 0 auto;
    width: 36px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-style-group button svg {
    width: 16px;
    height: 16px;
}

/* Gradient editor */
.gradient-stops {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.gradient-stop {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gradient-stop input[type="color"] {
    width: 32px;
    height: 32px;
}

.gradient-stop input[type="number"] {
    width: 60px;
}

.add-stop-btn {
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-stop-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Canvas area */
.canvas-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-primary);
    overflow: hidden;
    position: relative;
}

.preview-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    transition: transform 0.3s ease-out;
}

.preview-strip.sliding {
    pointer-events: none;
}

.side-preview {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    transition: opacity 0.3s, left 0.3s ease-out, right 0.3s ease-out;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.side-preview-left,
.side-preview-far-left {
    direction: rtl;
}

.side-preview-left canvas,
.side-preview-far-left canvas {
    direction: ltr;
}

.side-preview:hover {
    opacity: 0.85;
}

.side-preview.hidden {
    display: none;
}

.side-preview canvas {
    display: block;
}

.canvas-wrapper {
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
    transition: transform 0.3s ease-out, opacity 0.3s;
}

.canvas-wrapper.sliding-out-left {
    transform: translateX(-100%);
    opacity: 0;
}

.canvas-wrapper.sliding-out-right {
    transform: translateX(100%);
    opacity: 0;
}

#preview-canvas {
    display: block;
}

#preview-canvas-left,
#preview-canvas-right {
    display: block;
}

#threejs-container {
    width: 400px;
    height: 700px;
    display: block;
}

#threejs-container canvas {
    display: block;
}

.no-screenshot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 10;
}

.no-screenshot svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-screenshot p {
    font-size: 16px;
    opacity: 0.8;
}

/* Export buttons */
.export-section {
    padding: 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.export-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

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

.export-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.export-btn.secondary:hover {
    background: var(--border-color);
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.modal-overlay.visible .modal {
    transform: scale(1);
}

.modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: #ff453a20;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon svg {
    width: 28px;
    height: 28px;
    color: #ff453a;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-btn-cancel:hover {
    background: var(--border-color);
}

.modal-btn-confirm {
    background: #ff453a;
    color: white;
}

.modal-btn-confirm:hover {
    background: #ff6961;
}

.modal-btn-primary {
    background: var(--accent);
    color: white;
}

.modal-btn-primary:hover {
    background: #409cff;
}

.modal-icon-info {
    background: rgba(10, 132, 255, 0.15);
}

.modal-icon-info svg {
    color: var(--accent);
}

/* Translate modal styles */
.translate-modal {
    max-width: 500px;
    text-align: left;
}

.translate-modal .modal-title {
    text-align: center;
}

.translate-modal .modal-message {
    text-align: center;
}

.translate-source {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.translate-source select {
    width: 100%;
    margin-bottom: 12px;
}

.source-text-preview {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    min-height: 40px;
    word-break: break-word;
}

.translate-targets {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.translate-target-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.translate-target-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.translate-target-header .flag {
    font-size: 18px;
}

.translate-target-item textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
}

.ai-translate-btn {
    width: 100%;
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.ai-translate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ai-translate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-translate-btn.loading {
    background: var(--bg-tertiary);
}

.ai-translate-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-translate-status {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    min-height: 18px;
}

.ai-translate-status.error {
    color: #ff453a;
}

.ai-translate-status.success {
    color: #30d158;
}

.translate-target-item.translating {
    opacity: 0.7;
}

.translate-target-item.translating textarea {
    background: var(--bg-primary);
}

/* Settings Modal */
.settings-modal {
    max-width: 480px;
    text-align: left;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header .modal-title {
    margin-bottom: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.settings-section {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.settings-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.settings-provider-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-provider-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 140px;
}

.settings-provider-option:hover {
    border-color: var(--accent);
}

.settings-provider-option input[type="radio"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    margin: 0;
}

.settings-provider-option input[type="radio"]:checked + .provider-label {
    color: var(--accent);
}

.provider-label {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
}

.settings-input-group {
    display: flex;
    gap: 8px;
}

.settings-input-group input {
    flex: 1;
    padding: 12px 14px;
    font-size: 14px;
    font-family: monospace;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
}

.settings-input-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.settings-show-key {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.settings-show-key:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.settings-key-status {
    font-size: 12px;
    margin-top: 8px;
    min-height: 18px;
}

.settings-key-status.success {
    color: #30d158;
}

.settings-key-status.error {
    color: #ff453a;
}

.settings-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    margin-top: 12px;
}

.settings-link:hover {
    text-decoration: underline;
}

/* Device selector */
.device-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.device-option {
    padding: 12px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.device-option:hover {
    background: var(--bg-primary);
}

.device-option.selected {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.1);
}

.device-option-name {
    font-size: 12px;
    font-weight: 500;
}

.device-option-size {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Preset backgrounds */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.preset-swatch {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.preset-swatch:hover {
    transform: scale(1.05);
}

.preset-swatch.selected {
    border-color: var(--accent);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Toggle switch */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.toggle-label {
    font-size: 14px;
}

.toggle {
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle.active {
    background: var(--accent);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.2s;
}

.toggle.active::after {
    left: 22px;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

/* Font picker */
.font-picker {
    position: relative;
}

.font-picker-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.font-picker-trigger:hover {
    border-color: var(--accent);
}

.font-picker-trigger:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.font-picker-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow: hidden;
    flex-direction: column;
}

.font-picker-dropdown.open {
    display: flex;
}

.font-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.font-picker-search svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.font-picker-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.font-picker-search input::placeholder {
    color: var(--text-secondary);
}

.font-picker-categories {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.font-category {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.font-category:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.font-category.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.font-picker-list {
    overflow-y: auto;
    max-height: 300px;
    padding: 4px 0;
}

.font-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    cursor: pointer;
    transition: background 0.15s;
}

.font-option:hover {
    background: var(--bg-tertiary);
}

.font-option.selected {
    background: rgba(10, 132, 255, 0.15);
}

.font-option-name {
    font-size: 14px;
    line-height: 40px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-option-category {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.font-option-loading {
    font-size: 11px;
    color: var(--accent);
}

.font-picker-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Legacy font preview (unused but kept for compatibility) */
.font-preview {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-top: 8px;
    font-size: 14px;
}

/* Checkbox */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.checkbox-row label {
    font-size: 14px;
    cursor: pointer;
}

/* Position presets */
.preset-positions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.position-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.position-preset:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.position-preset.active {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.1);
    color: var(--text-primary);
}

.position-preset svg {
    width: 32px;
    height: 48px;
}

.position-preset span {
    font-size: 9px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

/* Section collapse */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 0;
}

.section-header h3 {
    margin: 0;
}

.section-toggle {
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.section-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Image background upload */
.bg-image-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.bg-image-upload:hover {
    border-color: var(--accent);
}

.bg-image-preview {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-top: 8px;
}

/* Output format selector */
.format-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.format-option {
    flex: 1;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.format-option.selected {
    border-color: var(--accent);
}

.format-option-label {
    font-size: 13px;
    font-weight: 500;
}

.logo-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-input-wrapper input[type="text"] {
    flex: 1;
    font-family: monospace;
}

.hint-text {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

/* Project controls */
.project-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-controls select {
    width: 100%;
}

.project-buttons {
    display: flex;
    gap: 4px;
}

.project-btn {
    flex: 1;
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.project-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--accent);
}

.project-btn.danger:hover {
    border-color: #ff453a;
    color: #ff453a;
}

/* Sidebar header with settings */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sidebar-header h2 {
    margin-bottom: 0;
}

.settings-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.settings-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.sidebar-header-buttons {
    display: flex;
    gap: 4px;
}

.settings-btn img {
    filter: invert(0.6);
    transition: filter 0.2s;
}

.settings-btn:hover img {
    filter: invert(1);
}

/* Language selector */
.label-with-action {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.label-with-action .control-label {
    margin-bottom: 0;
}

.language-selector {
    display: flex;
    gap: 4px;
    flex: 1;
}

.language-flag {
    width: 28px;
    height: 28px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: var(--bg-tertiary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.language-flag:hover {
    background: var(--bg-primary);
}

.language-flag.active {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.1);
}

.language-flag .remove-lang {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background: #ff453a;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.language-flag:hover .remove-lang {
    display: flex;
}

.language-flag:first-child .remove-lang {
    display: none !important;
}

.add-language-btn {
    width: 28px;
    height: 28px;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.add-language-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.magic-translate-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.magic-translate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* Language dropdown */
.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.language-dropdown.visible {
    display: flex;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    text-align: left;
    transition: all 0.2s;
}

.language-option:hover {
    background: var(--bg-tertiary);
}

.language-option .flag {
    font-size: 18px;
}

.per-screenshot-active {
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 12px;
    margin: -12px;
    margin-bottom: 0;
}