/* ===== Variables ===== */
/* Light Theme */
:root {
    --bg-body: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-container: #ffffff;
    --bg-section: #ffffff;
    --bg-light: #f7fafc;
    --bg-drop-zone: #f7fafc;
    --bg-drop-zone-hover: rgba(102, 126, 234, 0.05);
    --bg-drop-zone-active: rgba(102, 126, 234, 0.1);
    --bg-file-item: #f7fafc;
    --bg-modal: #ffffff;
    --bg-button-secondary: #ffffff;
    --bg-input: #ffffff;

    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --text-button-secondary: #667eea;

    --border-main: #e2e8f0;
    --border-light: #f0f0f0;
    --border-input: #e2e8f0;

    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-primary: #667eea;
    --accent-hover: #5568d3;
    --accent-success: #48bb78;
    --accent-danger: #f56565;
    --accent-danger-hover: #e53e3e;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --modal-backdrop: rgba(0, 0, 0, 0.5);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-body: #1a1a1a;
    --bg-container: #2a2a2a;
    --bg-section: #2a2a2a;
    --bg-light: #1a1a1a;
    --bg-drop-zone: #1a1a1a;
    --bg-drop-zone-hover: #333333;
    --bg-drop-zone-active: #3a3a3a;
    --bg-file-item: #1a1a1a;
    --bg-modal: #2a2a2a;
    --bg-button-secondary: #3a3a3a;
    --bg-input: #1a1a1a;

    --text-primary: #ffd580;
    --text-secondary: #b8945f;
    --text-tertiary: #999999;
    --text-button-secondary: #ffffff;

    --border-main: #3a3a3a;
    --border-light: #3a3a3a;
    --border-input: #3a3a3a;

    --primary-color: #c9a876;
    --primary-dark: #d4b586;
    --primary-gradient: linear-gradient(135deg, #c9a876 0%, #d4b586 100%);
    --accent-primary: #c9a876;
    --accent-hover: #d4b586;
    --accent-success: #66bb6a;
    --accent-danger: #ff5252;
    --accent-danger-hover: #d32f2f;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
    --modal-backdrop: rgba(0, 0, 0, 0.8);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

/* ===== App Container ===== */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-section);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-main);
}

/* ===== Header ===== */
.app-header {
    padding: 30px;
    border-bottom: 2px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: var(--bg-light);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== Main Content ===== */
.main-content {
    padding: 30px;
}

/* ===== Upload Section ===== */
.upload-section {
    margin-bottom: 20px;
}

/* Drop Zone */
.drop-zone {
    border: 3px dashed var(--border-main);
    border-radius: var(--radius-lg);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-drop-zone);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: var(--bg-drop-zone-hover);
    transform: scale(1.01);
}

.drop-zone.drag-over {
    border-style: solid;
    background: var(--bg-drop-zone-active);
}

.drop-zone-content h2 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.drop-zone-content p {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.file-info {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-top: 15px;
}

/* ===== File List Section ===== */
.file-list-section {
    margin-top: 30px;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-main);
}

.file-list-header h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
}

.file-list-actions {
    display: flex;
    gap: 10px;
}

/* File List */
.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.file-item {
    background: var(--bg-light);
    border: 2px solid var(--border-main);
    border-radius: var(--radius-lg);
    padding: 15px;
    cursor: move;
    transition: all 0.2s;
    position: relative;
}

.file-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.file-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.file-item.drag-over {
    border-color: var(--primary-color);
    border-style: dashed;
    background: rgba(102, 126, 234, 0.05);
}

.file-thumbnail {
    width: 100%;
    aspect-ratio: 8.5 / 11;
    background: var(--bg-section);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.file-thumbnail canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.file-thumbnail .loading {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.file-thumbnail .thumbnail-placeholder {
    font-size: 3rem;
    color: var(--text-tertiary);
}

.file-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px;
    pointer-events: none;
    z-index: 1;
}

.file-number {
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.file-remove-overlay {
    background: var(--accent-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    line-height: 1;
}

.file-remove-overlay:hover {
    background: var(--accent-danger-hover);
    transform: scale(1.1);
}

.file-info-box {
    margin-bottom: 8px;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    display: block;
}

.file-details {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* ===== Action Buttons ===== */
/* Advanced Toggle Container */
.advanced-toggle-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 15px 20px;
    background: var(--bg-light);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
}

.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-main);
    transition: 0.3s;
    border-radius: 28px;
    border: 2px solid var(--border-main);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-tertiary);
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
    background-color: white;
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(201, 168, 118, 0.3);
}

.toggle-slider:hover {
    opacity: 0.9;
}

/* Create PDF Container */
.create-pdf-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-main);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-section);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== Advanced Page Management ===== */
#advancedSection {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-light);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-lg);
}

.advanced-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pdf-page-list {
    background: var(--bg-section);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 15px;
}

.pdf-page-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.pdf-page-list-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    word-break: break-word;
}

.remove-pdf-btn {
    padding: 5px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-danger);
    background: var(--bg-light);
    color: var(--accent-danger);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.remove-pdf-btn:hover {
    background: var(--accent-danger);
    color: white;
}

.pdf-page-list-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pdf-page-list-controls button {
    padding: 5px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-main);
    background: var(--bg-light);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.pdf-page-list-controls .toggle-thumbnails-label {
    margin: 0;
    padding: 5px 10px;
    background: var(--bg-light);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.pdf-page-list-controls .toggle-thumbnails-label:hover {
    background: var(--bg-section);
}

.pdf-page-list-controls .toggle-switch {
    width: 40px;
    height: 22px;
}

.pdf-page-list-controls .toggle-slider:before {
    height: 16px;
    width: 16px;
    left: 1px;
    bottom: 1px;
}

.pdf-page-list-controls .toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.pdf-page-list-controls button:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.page-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.page-item:hover {
    background: var(--bg-light);
}

.page-item.page-deleted {
    opacity: 0.5;
    text-decoration: line-through;
}

.page-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.page-label {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.page-rotation {
    padding: 4px 10px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-main);
    background: var(--bg-light);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 60px;
    text-align: center;
}

.page-rotation:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.page-delete {
    padding: 4px 8px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-danger);
    background: transparent;
    color: var(--accent-danger);
    cursor: pointer;
    transition: all 0.2s;
}

.page-delete:hover {
    background: var(--accent-danger);
    color: white;
}

/* Thumbnail Grid View */
.page-items-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 15px;
}

.page-item-thumbnail {
    position: relative;
    border: 2px solid var(--border-main);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.2s;
}

.page-item-thumbnail:not(.page-deleted) {
    border-color: var(--accent-success);
}

.page-item-thumbnail:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.page-item-thumbnail.page-deleted {
    opacity: 0.5;
    border-color: var(--border-main);
}

.thumbnail-container {
    position: relative;
    background: var(--bg-body);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-thumbnail-canvas {
    display: block;
    width: 100%;
    height: auto;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.6) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.6) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.page-item-thumbnail:hover .thumbnail-overlay {
    opacity: 1;
}

.page-item-thumbnail .page-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    align-self: flex-start;
}

.page-number-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: var(--accent-primary);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
}

.thumbnail-controls {
    display: flex;
    gap: 6px;
    align-self: flex-end;
}

.page-item-thumbnail .page-rotation,
.page-item-thumbnail .page-delete {
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.page-item-thumbnail .page-rotation {
    background: var(--bg-light);
    border: 1px solid var(--border-main);
    color: var(--text-primary);
}

.page-item-thumbnail .page-rotation:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.page-item-thumbnail .page-delete {
    background: var(--accent-danger);
    color: white;
    border: 1px solid var(--accent-danger);
}

.page-item-thumbnail .page-delete:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}

/* ===== Preview Section ===== */
.preview-section {
    padding: 20px 0;
    text-align: center;
}

.preview-section h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.preview-info {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 25px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-main);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-primary);
}

.info-row span:last-child {
    color: var(--text-secondary);
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-backdrop);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-section);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s;
}

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

.modal-small {
    max-width: 400px;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 25px 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-body h3 {
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body ul,
.modal-body ol {
    margin-left: 20px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 10px;
}

.modal-body a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.modal-body a:hover {
    text-decoration: underline;
}

.support-link {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    text-decoration: none;
    margin-top: 10px;
    transition: all 0.2s;
}

.support-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.version {
    margin-top: 20px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-align: center;
}

/* Options Modal */
.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid var(--border-main);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.option-section {
    margin-bottom: 30px;
}

.option-section:last-child {
    margin-bottom: 0;
}

.option-section-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.theme-buttons {
    display: flex;
    gap: 10px;
}

.theme-btn {
    background: var(--bg-button-secondary);
    color: var(--text-button-secondary);
    border: 2px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 8px 20px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.theme-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.theme-btn:hover:not(.active) {
    border-color: var(--accent-primary);
}

.option-group {
    margin-bottom: 20px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    color: var(--text-primary);
    font-weight: 500;
    display: block;
    margin-bottom: 8px;
}

.option-group label.toggle-label {
    display: flex;
    margin-bottom: 0;
}

.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-main);
    transition: 0.3s;
    border-radius: 28px;
    border: 2px solid var(--border-main);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-tertiary);
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
    background-color: white;
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(201, 168, 118, 0.3);
}

.option-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-main);
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-top: 8px;
    transition: border-color 0.2s;
    background: var(--bg-input);
    color: var(--text-primary);
}

.option-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.option-help {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-top: 8px;
    line-height: 1.4;
}

.shortcuts-list {
    list-style: none;
    margin-left: 0;
}

.shortcuts-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: var(--text-secondary);
}

.shortcuts-list li span:first-child {
    flex: 1;
}

kbd {
    background: var(--bg-light);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-family: monospace;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

/* Progress Modal */
.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.progress-status {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-no-close .modal-content {
    pointer-events: auto;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .header-buttons {
        top: 15px;
        right: 15px;
    }

    .upload-section,
    .preview-section {
        padding: 20px;
    }

    .drop-zone {
        padding: 40px 15px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .file-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .file-item {
        padding: 10px;
    }

    .btn-primary {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .action-buttons,
    .preview-actions {
        flex-direction: column;
    }

    .action-buttons button,
    .preview-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .file-list {
        grid-template-columns: 1fr;
    }

    .file-list-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .file-list-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* ===== Footer ===== */
.app-footer {
    padding: 20px;
    text-align: center;
    border-top: 2px solid var(--border-main);
    color: var(--text-secondary);
}

.app-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.app-footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.footer-separator {
    color: var(--text-tertiary);
    margin: 0 5px;
}

/* Alert Modal */
.alert-modal .modal-content {
    max-width: 450px;
}

.alert-message {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.alert-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-alert-ok {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Confirm Modal */
.confirm-modal .modal-content {
    max-width: 450px;
}

.confirm-message {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-confirm-yes {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-confirm-no {
    background: var(--bg-button-secondary);
    color: var(--text-button-secondary);
    border: 2px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm-no:hover {
    border-color: var(--accent-primary);
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
