.hidden {
    display: none !important;
}

svg {
    fill: none;
}

body {
    overflow-x: hidden;
}

body.download-active {
    overflow-y: visible;
}

body.download-active .hero,
body.download-active .container > form {
    display: none;
}

body.selection-active {
    overflow-y: hidden;
}

body.selection-active .hero,
body.selection-active .container > form {
    display: none;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-screen.active {
    opacity: 1;
    pointer-events: all;
}

.loading-bar-container {
    width: 300px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loading-bar {
    position: absolute;
    height: 100%;
    background: #ff6154;
    border-radius: 2px;
    width: 40%;
    will-change: transform;
    animation: loading 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(200%);
    }
    100% {
        transform: translateX(500%);
    }
}

.loading-text {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

/* Container */
.container {
    background-color: transparent;
    box-sizing: border-box;
    padding: 20px;
    border-radius: 16px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto 10px auto;
    overflow: visible;
}

/* Upload Area */
.upload-area {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 12px;
    flex-wrap: wrap;
}

.file-input-label {
    display: inline-block;
    padding: 16px 48px;
    background-color: #ff6154;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
    flex-shrink: 0;
}

.file-input-label:hover {
    background: #e5554a;
    box-shadow: 0 4px 12px rgba(255, 97, 84, 0.4);
    transform: translateY(-1px);
}

#upload-label.drag-over {
    background-color: #e5554a;
    transform: scale(1.05);
}

#upload-label {
    outline: none;
}

.upload-content {
    text-align: center;
}

.upload-icon {
    display: none;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

input[type="file"] {
    display: none;
}

/* Selection Panel - General */
.selection-panel {
    margin-top: 0;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    position: fixed;
    top: 81px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100vh - 81px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.selection-panel.active {
    opacity: 1;
    visibility: visible;
}

.selection-content {
    display: flex;
    gap: 0;
    align-items: stretch;
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Left side - Content Section */
.pages-preview-section {
    flex: 1;
    background: #f8f9fa;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    margin-right: 450px;
    box-sizing: border-box;
}

.pages-header {
    margin-bottom: 48px;
    max-width: 900px;
    width: 100%;
    text-align: center;
    flex-shrink: 0;
}

.pages-header h2 {
    margin: 0 0 8px 0;
    font-size: 1.75rem;
    color: #1f2937;
    font-weight: 700;
}

.selection-subtitle {
    margin: 0;
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
}

.preview-canvas-wrapper {
    width: 100%;
    max-width: 700px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 32px;
    position: relative;
    flex-shrink: 0;
}

#previewCanvas {
    width: 100%;
    height: auto;
    display: block;
}

.preview-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 0;
    flex-shrink: 0;
}

.preview-nav-btn {
    padding: 12px 20px;
    font-size: 0.95rem;
    background: white;
    border: 2px solid #e5e7eb;
    color: #374151;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.preview-nav-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.preview-nav-btn:hover:not(:disabled) {
    border-color: #ff6154;
    background: #fff5f4;
    color: #ff6154;
    box-shadow: 0 4px 12px rgba(255, 97, 84, 0.2);
}

.preview-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.preview-page-info {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    min-width: 120px;
    text-align: center;
    background: white;
    padding: 10px 20px;
    border-radius: 24px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Config Fields */
.config-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.config-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
    color: #1f2937;
    box-sizing: border-box;
}

.config-input:focus {
    outline: none;
    border-color: #ff6154;
}

.config-input:hover {
    border-color: #ffc9c3;
    background: #fff5f4;
}

/* Settings Toggle Switch */
.settings-toggle-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 10px;
}

.settings-toggle-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s ease;
}

.settings-toggle-btn.active {
    background: white;
    color: #ff6154;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-toggle-btn:hover:not(.active) {
    color: #374151;
}

/* Custom Dropdown */
.custom-dropdown-trigger {
    width: 100%;
    height: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1f2937;
    font-weight: 500;
    position: relative;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.custom-dropdown-trigger:hover {
    border-color: #ffc9c3;
    background: #fff5f4;
}

.custom-dropdown-trigger:focus {
    outline: none;
    border-color: #ff6154;
}

.custom-dropdown-trigger.active {
    border-color: #ff6154;
}

.dropdown-value {
    flex: 1;
    text-align: left;
}

.custom-dropdown-trigger svg {
    flex-shrink: 0;
    stroke: #6b7280;
    transition: transform 0.2s ease;
}

.custom-dropdown-trigger.active svg {
    transform: rotate(180deg);
}

/* Color Picker Button */
.color-picker-btn {
    width: 100%;
    height: 100%;
    padding: 4px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    box-sizing: border-box;
}

.color-picker-btn:hover {
    border-color: #ffc9c3;
    background: #fff5f4;
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #000000;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
}

.toggle-group:last-child {
    border-bottom: none;
}

.toggle-group:first-child {
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch.active {
    background: #ff6154;
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: none;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(20px);
}

/* Right side - Controls Panel */
.controls-panel {
    position: fixed;
    right: 0;
    top: 81px;
    width: 450px;
    box-sizing: border-box;
    padding: 45px;
    height: calc(100vh - 81px);
    background: white;
    border-left: 2px solid #e5e7eb;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.06);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.controls-sticky {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Control Sections */
.control-section {
    margin-bottom: 20px;
    flex-shrink: 0;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 14px 0;
}

/* Config Section Card */
.config-section-card {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.config-section-card.active {
    display: flex !important;
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    height: 70px;
}

/* Controls Divider */
.controls-divider {
    height: 2px;
    background: linear-gradient(to right, #e5e7eb 0%, #e5e7eb 50%, transparent 50%);
    background-size: 8px 2px;
    margin: 20px 0;
    flex-shrink: 0;
}

/* Extract Actions Vertical */
.extract-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-extract {
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.btn-extract.single {
    background-color: #ff6154;
    color: white;
}

.btn-extract.single:hover:not(:disabled) {
    background: #e5554a;
    box-shadow: 0 6px 16px rgba(255, 97, 84, 0.4);
    transform: translateY(-2px);
}

.btn-extract:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-extract svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.btn-extract.single:hover:not(:disabled) svg {
    transform: translateX(4px);
}

.btn-extract-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.btn-extract-title {
    font-size: 1rem;
    font-weight: 700;
}

.btn-extract-desc {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 400;
}

/* Dropdown Modal Overlay */
.dropdown-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
}

.dropdown-modal-overlay.active {
    display: block;
}

/* Dropdown Modal */
.dropdown-modal {
    display: none;
    position: absolute;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.dropdown-modal.active {
    display: block;
}

.dropdown-modal-content {
    padding: 8px;
}

.dropdown-option {
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.15s ease;
    font-weight: 500;
}

.dropdown-option:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.dropdown-option.selected {
    background: #fff5f4;
    color: #ff6154;
    font-weight: 600;
}

/* Color Picker Modal */
.color-picker-modal {
    display: none;
    position: absolute;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    padding: 16px;
    min-width: 240px;
    width: 240px;
}

.color-picker-modal.active {
    display: block;
}

.color-picker-content {
    display: flex;
    flex-direction: column;
}

.color-palette-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.color-box {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    position: relative;
}

.color-box:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.color-box.selected {
    border-color: #ff6154;
    border-width: 3px;
}

.color-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
    margin-top: 10px;
    margin-bottom: 10px;
}

.custom-color-button {
    width: 100%;
    padding: 10px 14px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.custom-color-button:hover {
    border-color: #ff6154;
    background: #fff5f4;
    color: #ff6154;
}

.custom-color-button svg {
    flex-shrink: 0;
}

/* Custom Color Full Screen Modal */
.custom-color-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.custom-color-overlay.active {
    display: block;
}

.custom-color-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
}

.custom-color-modal.active {
    display: block;
}

.custom-color-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid #e5e7eb;
}

.custom-color-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.custom-color-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #6b7280;
}

.custom-color-close:hover {
    background: #f3f4f6;
    color: #ff6154;
}

.custom-color-body {
    padding: 40px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.color-input-section-full {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 450px;
}

.color-input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hex-input-container {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.hex-input-group {
    display: flex;
    gap: 8px;
    flex: 1;
}

#hexInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

#hexInput:focus {
    outline: none;
    border-color: #ff6154;
}

#applyHexBtn {
    padding: 12px 24px;
    background: #ff6154;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#applyHexBtn:hover {
    background: #e5554a;
}

.hex-color-preview {
    width: 80px;
    height: 48px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #000000;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease;
}

/* Previous Settings Notice */
.previous-settings-notice {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fffbeb;
    border: none;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.875rem;
    color: #1f2937;
}

.previous-settings-notice svg {
    flex-shrink: 0;
    color: #f59e0b;
}

.previous-settings-notice a {
    color: #f7b33e;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.previous-settings-notice a:hover {
    text-decoration: underline;
}

/* Download Screen Styles */
.download-screen {
    display: none;
    padding: 0;
    max-width: 100%;
    margin: 0;
    min-height: calc(100vh - 81px);
    background: #f8f9fa;
    position: fixed;
    top: 81px;
    left: 0;
    right: 0;
    bottom: 0;
}

.download-screen.active {
    display: block;
}

.download-content {
    display: flex;
    width: 100%;
    height: calc(100vh - 81px);
}

/* Left side - PDF Preview (scrollable) */
.pdf-preview-section {
    flex: 1;
    background: #f8f9fa;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    margin-right: 450px;
    height: 100%;
    box-sizing: border-box;
}

.preview-canvas-container {
    width: 100%;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    margin-bottom: 20px;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-page-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    position: relative;
}

.preview-page-wrapper canvas {
    width: 100%;
    height: auto;
    display: block;
}

.page-number-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
}

/* Right side - Actions (Fixed Panel) */
.download-actions-section {
    position: fixed;
    right: 0;
    top: 81px;
    width: 450px;
    height: calc(100vh - 81px);
    background: white;
    border-left: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 40px 32px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.06);
}

.back-button {
    background: transparent;
    color: #6b7280;
    border: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-weight: 500;
    position: absolute;
    margin-top: -10px;
    left: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: none;
    color: #ff6154;
    box-shadow: none;
    transform: translateX(-2px);
    border-radius: 8px;
}

.back-button svg {
    width: 18px;
    height: 18px;
}

/* File Preview Card */
#file-preview-card {
    margin-top: 50px;
    margin-bottom: 24px;
}

.single-file-card {
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.single-file-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.single-file-icon svg {
    width: 28px;
    height: 28px;
    stroke: #ff6154;
    fill: none;
}

.single-file-details {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.single-file-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.single-file-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.done-button {
    background: #10b981;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.done-button svg {
    width: 16px;
    height: 16px;
    stroke: white;
    fill: none;
}

/* Download Button */
.download-button-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.download-primary {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #ff6154;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.download-primary:hover {
    background: #e5554a;
    box-shadow: 0 6px 16px rgba(255, 97, 84, 0.4);
    transform: translateY(-2px);
}

.download-primary svg {
    width: 20px;
    height: 20px;
    stroke: white;
    fill: none;
}

/* Action buttons */
.action-buttons-grid {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: -6px;
    margin-bottom: 10px;
}

.action-button {
    background: #f7f8f9;
    border: none;
    color: #374151;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 48px;
    height: 48px;
}

/* Share button takes more space */
.action-button.action-share {
    flex: 2;
}

.action-button:hover {
    background: #fff5f4;
}

.action-button svg {
    width: 24px;
    height: 24px;
    stroke: #6b7280;
}

.action-button:hover svg {
    stroke: #ff6154;
}

/* Process Another Button */
.process-another {
    background: transparent;
    color: #ff6154;
    border: 2px solid #ff6154;
    width: 100%;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.process-another:hover {
    background: #fff5f4;
    box-shadow: 0 4px 12px rgba(255, 97, 84, 0.2);
}

/* Custom scrollbars */
.controls-panel::-webkit-scrollbar,
.pages-preview-section::-webkit-scrollbar,
.pdf-preview-section::-webkit-scrollbar,
.download-actions-section::-webkit-scrollbar,
.dropdown-modal::-webkit-scrollbar {
    width: 6px;
}

.controls-panel::-webkit-scrollbar-track,
.pages-preview-section::-webkit-scrollbar-track,
.pdf-preview-section::-webkit-scrollbar-track,
.download-actions-section::-webkit-scrollbar-track,
.dropdown-modal::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.controls-panel::-webkit-scrollbar-thumb,
.pages-preview-section::-webkit-scrollbar-thumb,
.pdf-preview-section::-webkit-scrollbar-thumb,
.download-actions-section::-webkit-scrollbar-thumb,
.dropdown-modal::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.controls-panel::-webkit-scrollbar-thumb:hover,
.pages-preview-section::-webkit-scrollbar-thumb:hover,
.pdf-preview-section::-webkit-scrollbar-thumb:hover,
.download-actions-section::-webkit-scrollbar-thumb:hover,
.dropdown-modal::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Hide elements */
.content-hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .controls-panel {
        width: 380px;
    }
    
    .pages-preview-section {
        margin-right: 380px;
    }
    
    .download-actions-section {
        width: 400px;
    }
    
    .pdf-preview-section {
        margin-right: 400px;
    }
}

@media (max-width: 968px) {
    body.selection-active {
        overflow-y: auto;
    }
    
    .selection-panel {
        position: relative;
        height: auto;
        min-height: calc(100vh - 81px);
    }
    
    .selection-content {
        flex-direction: column;
        height: auto;
    }
    
    .controls-panel {
        position: relative;
        width: 100%;
        height: auto;
        top: 0;
        border-left: none;
        border-bottom: 2px solid #e5e7eb;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
        order: 1;
    }
    
    .pages-preview-section {
        margin-right: 0;
        height: auto;
        order: 2;
        padding: 32px 24px;
        overflow-y: visible;
    }
    
    .download-screen {
        position: relative;
        height: auto;
        min-height: calc(100vh - 81px);
    }
    
    .download-content {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 81px);
    }
    
    .download-actions-section {
        position: relative;
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 2px solid #e5e7eb;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
    }
    
    .pdf-preview-section {
        margin-right: 0;
        padding: 100px 20px 20px 20px;
        height: auto;
        min-height: 50vh;
    }
    
    .back-button {
        top: 20px;
        left: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .hero {
        padding: 40px 20px 30px;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .pages-preview-section {
        padding: 24px 16px 40px 16px;
    }
    
    .pages-header h2 {
        font-size: 1.5rem;
    }
    
    .selection-subtitle {
        font-size: 0.9rem;
    }
    
    .controls-panel {
        padding: 20px 16px;
    }
    
    .config-row {
        grid-template-columns: 1fr;
    }
    
    .pdf-preview-section {
        padding: 80px 16px 24px 16px;
    }
    
    .download-actions-section {
        padding: 24px 16px;
    }
    
    .back-button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}