.hidden {
    display: none !important;
}

svg {
    fill: none;
}

body {
    overflow-x: hidden;
}

body.download-active {
    height: calc(100vh - 81px);
    overflow-y: visible;
}

body.selection-active {
    overflow-y: hidden;
}

/* 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 {
    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 {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.upload-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0;
    transition: opacity 0.3s ease;
}

.file-input-label:hover .upload-icon {
    opacity: 1;
}

.file-input-label:hover .upload-text {
    opacity: 0;
    visibility: hidden;
}

input[type="file"] {
    display: none;
}

/* Progress Bar */
#progress-container {
    margin-top: 1.5rem;
    width: 100%;
    max-width: 510px;
    margin-left: auto;
    margin-right: auto;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: transparent;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

#progress-bar {
    width: 0;
    height: 100%;
    background-color: #ff6154;
    transition: width 0.3s ease;
}

#progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Selection Panel - Quality Selection */
.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 - Files Preview */
.files-preview-section {
    flex: 1;
    background: none;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow-y: auto;
    margin-right: 450px;
    box-sizing: border-box;
}


/* Large File Preview Card */
.file-preview-large {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 48px;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.file-preview-large:hover {
    border-color: #ff6154;
    box-shadow: 0 8px 24px rgba(255, 97, 84, 0.12);
}

.file-preview-thumbnail {
    width: 100%;
    max-width: 180px;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}

.file-preview-thumbnail canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.file-preview-details {
    width: 100%;
}

.file-preview-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    word-break: break-word;
    line-height: 1.4;
}

.file-preview-size {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

.file-change-btn {
    background: transparent;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.file-change-btn:hover {
    border-color: #ff6154;
    color: #ff6154;
    background: #fff5f4;
}

.file-change-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-dropdown-trigger:hover {
    border-color: #ffc9c3;
    background: #fff5f4;
}

.custom-dropdown.open .custom-dropdown-trigger {
    border-color: #ff6154;
    background: #fff5f4;
}

.dropdown-selected {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-selected-text {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.dropdown-selected-desc {
    font-size: 0.8rem;
    color: #9ca3af;
}

.dropdown-selected-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ff6154;
    background: #ffe5e2;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
    width: fit-content;
}

.dropdown-arrow {
    width: 20px;
    height: 20px;
    stroke: #6b7280;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    margin-top: 8px;
    display: none;
    max-height: 280px;
    overflow: hidden;
}

.custom-dropdown.open .custom-dropdown-menu {
    display: block;
    overflow-y: auto;
}

.dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: #f8f9fa;
}

.dropdown-option.selected {
    background: #fff5f4;
}

.dropdown-option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-option-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.dropdown-option.selected .dropdown-option-name {
    color: #ff6154;
}

.dropdown-option-desc {
    font-size: 0.8rem;
    color: #9ca3af;
}

.dropdown-option-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ff6154;
    background: #ffe5e2;
    padding: 4px 10px;
    border-radius: 10px;
}

/* Custom Dropdown Scrollbar - inside border radius */
.custom-dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
    border: 2px solid white;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Right side - Controls Panel (Fixed Overlay) */
.controls-panel {
    position: fixed;
    right: 0;
    top: 81px;
    width: 450px;
    box-sizing: border-box;
    padding: 40px;
    padding-top: 20px;
    padding-bottom: 40px;
    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;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

/* Wrapper for options - centers content vertically */
.controls-options-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
}

.controls-options-wrapper .control-section {
    margin-bottom: 0;
}

.controls-sticky {
    padding: 40px 32px;
}

/* Control Sections */
.control-section {
    margin-bottom: 24px;
}

.control-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px 0;
}

/* Conversion Summary Card */
.summary-card {
    background: linear-gradient(135deg, #fff5f4 0%, #ffffff 100%);
    border: 2px solid #ffe5e2;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ff6154 0%, #ff7a6e 100%);
    color: white;
}

.summary-header svg {
    width: 20px;
    height: 20px;
    stroke: white;
    flex-shrink: 0;
}

.summary-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
}

.summary-details {
    padding: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.summary-item:first-child {
    padding-top: 0;
}

.summary-item:last-child {
    padding-bottom: 0;
}

.summary-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.summary-value {
    font-size: 0.9rem;
    color: #1f2937;
    font-weight: 700;
}

.summary-value.format-badge {
    background: #ff6154;
    color: white;
    padding: 4px 16px;
    border-radius: 16px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.summary-divider {
    height: 1px;
    background: none;
    margin: 0;
}

/* Controls Divider - hidden in new layout */
.controls-divider {
    display: none;
}

/* Convert button section - sticks to bottom */
.controls-panel > .control-section:last-child {
    margin-top: auto;
    margin-bottom: 0;
}

/* Extract Actions Vertical */
.extract-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-extract {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    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;
}

.btn-extract-title {
    font-size: 1rem;
    font-weight: 700;
}

.btn-extract-desc {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 400;
}

/* Download Screen Styles */
.download-screen {
    display: none;
    padding: 0;
    max-width: 100%;
    margin: 0;
    min-height: calc(100vh - 81px);
    background: #f5f6f8;
}

.download-screen.active {
    display: block;
}

.download-content {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 81px);
}

/* Left side - Image Preview (scrollable) */
.pdf-preview-section {
    flex: 1;
    background: #f5f6f8;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    margin-right: 420px;
    height: calc(100vh - 81px);
    box-sizing: border-box;
}

.preview-canvas-container {
    width: 100%;
    max-width: 800px;
    display: grid;
    gap: 20px;
}

/* Dynamic grid based on image count */
.preview-canvas-container.single-image {
    grid-template-columns: 1fr;
    max-width: 400px;
}

.preview-canvas-container.few-images {
    grid-template-columns: repeat(2, 1fr);
    max-width: 700px;
}

.preview-canvas-container.many-images {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    max-width: 800px;
}

.preview-page-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    position: relative;
    transition: all 0.25s ease;
    cursor: pointer;
}

.preview-page-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.preview-page-wrapper img {
    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;
}

/* Download overlay on hover */
.preview-download-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.preview-page-wrapper:hover .preview-download-overlay {
    opacity: 1;
}

.preview-download-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    border: 2px solid #ff6154;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.9);
    transition: transform 0.25s ease;
}

.preview-page-wrapper:hover .preview-download-icon {
    transform: scale(1);
}

.preview-download-icon svg {
    width: 24px;
    height: 24px;
    stroke: #ff6154;
}

/* Right side - Actions Sidebar */
.download-actions-section {
    position: fixed;
    right: 0;
    top: 81px;
    width: 420px;
    height: calc(100vh - 81px);
    background: white;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 40px;
    overflow-y: auto;
    box-sizing: border-box;
}

.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);
}

.back-button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* Files Preview List */
#files-preview-list {
    margin-top: 50px;
    margin-bottom: 24px;
}

/* Single File Card */
.single-file-card {
    background: none;
    border: none;
    border-radius: 12px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.single-file-thumb {
    width: 68px;
    height: 82px;
    background: white;
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.single-file-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.single-file-details {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.single-file-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.single-file-name:hover {
    background: #f0f1f3;
}

.single-file-name-base {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.single-file-name-ext {
    white-space: nowrap;
    flex-shrink: 0;
    color: #9ca3af;
    margin-left: auto;
}

.single-file-info {
    font-size: 0.7rem;
    color: #9ca3af;
}

.single-file-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-more-btn {
    background: #f9f9f9;
    border: none;
    border-radius: 8px;
    padding: 8px 6px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.file-more-btn:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.done-button {
    background: #10b981;
    color: white;
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 3px;
}

.done-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: white;
}

/* Primary download button */
.download-primary {
    width: 100%;
    padding: 18px 32px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #ff6154;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.download-primary:hover {
    background: #e5554a;
    box-shadow: 0 4px 12px rgba(255, 97, 84, 0.35);
    transform: translateY(-1px);
}

.download-primary svg {
    width: 20px;
    height: 20px;
    stroke: white;
    fill: none;
}

/* Convert Another Button */
.extract-another-btn {
    width: 100%;
    padding: 13px 32px;
    margin-top: 12px;
    background: transparent;
    color: #ff6154;
    border: 1.5px solid #ff6154;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.another-btn-text,
.another-btn-arrow {
    transition: opacity 0.25s ease;
}

.another-btn-arrow {
    position: absolute;
    opacity: 0;
}

.extract-another-btn:hover {
    background: #fff5f4;
    box-shadow: 0 4px 12px rgba(255, 97, 84, 0.2);
}

.extract-another-btn:hover .another-btn-text {
    opacity: 0;
}

.extract-another-btn:hover .another-btn-arrow {
    opacity: 1;
}

/* File More Modal */
.file-more-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    animation: modalFadeIn 0.15s ease;
}

.file-more-overlay.hidden {
    display: none !important;
}

.file-more-sheet {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: sheetSlideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes sheetSlideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

.file-more-group {
    background: white;
    border-radius: 16px;
    overflow: hidden;
}

.file-more-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.15s;
}

.file-more-action:hover {
    background: #f9fafb;
}

.file-more-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-more-action-icon svg {
    color: #374151;
}

.file-more-action-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.file-more-action-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1f2937;
}

.file-more-action-desc {
    font-size: 0.75rem;
    color: #9ca3af;
}

.file-more-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 0 18px;
}

.file-more-cancel {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: white;
    color: #6b7280;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.file-more-cancel:hover {
    background: #f9fafb;
    color: #374151;
}

/* Rename Modal */
.popup-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modalFadeIn 0.15s ease;
}

.popup-modal-overlay.hidden {
    display: none !important;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.rename-modal-card {
    background: #f5f6f8;
    border-radius: 24px;
    padding: 24px;
    width: 320px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
    animation: modalSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rename-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
}

.rename-modal-input-wrap {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.rename-modal-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    color: #1f2937;
    outline: none;
    min-width: 0;
}

.rename-modal-ext {
    padding: 12px 14px 12px 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: #9ca3af;
    flex-shrink: 0;
}

.rename-modal-actions {
    display: flex;
    gap: 8px;
}

.rename-modal-cancel {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 14px;
    background: white;
    color: #6b7280;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.rename-modal-cancel:hover {
    background: #f9fafb;
    color: #374151;
}

.rename-modal-save {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 14px;
    background: #1f2937;
    color: white;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.rename-modal-save:hover {
    background: #374151;
}

/* Hide elements when showing download screen */
.content-hidden {
    display: none !important;
}

/* Scrollbar */
.controls-panel::-webkit-scrollbar,
.files-preview-section::-webkit-scrollbar,
.pdf-preview-section::-webkit-scrollbar,
.download-actions-section::-webkit-scrollbar,
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: #f3f4f6;
}

*::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .controls-panel {
        width: 380px;
    }

    .files-preview-section {
        margin-right: 380px;
    }

    .download-actions-section {
        width: 380px;
    }

    .pdf-preview-section {
        margin-right: 380px;
    }
}

@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: 2;
    }

    .controls-sticky {
        padding: 32px 24px;
    }

    .files-preview-section {
        margin-right: 0;
        height: auto;
        order: 1;
        padding: 32px 24px;
        overflow-y: visible;
    }

    .file-preview-large {
        max-width: 100%;
    }

    .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: 1px solid #e5e7eb;
    }

    .pdf-preview-section {
        margin-right: 0;
        padding: 100px 20px 20px 20px;
        height: auto;
        min-height: 50vh;
    }

    .back-button {
        top: 20px;
        left: 20px;
    }

    .preview-canvas-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .preview-canvas-container.single-image {
        max-width: 400px;
    }

    .preview-canvas-container.few-images {
        max-width: 600px;
    }

    .preview-canvas-container.many-images {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .files-preview-section {
        padding: 24px 16px 40px 16px;
    }

    .controls-sticky {
        padding: 24px 16px;
    }

    .pdf-preview-section {
        padding: 80px 16px 24px 16px;
    }

    .download-actions-section {
        padding: 24px 16px;
    }

    .back-button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .preview-canvas-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .preview-canvas-container.single-image {
        max-width: 300px;
    }

    .preview-canvas-container.few-images {
        max-width: 100%;
        grid-template-columns: repeat(2, 1fr);
    }

    .preview-canvas-container.many-images {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

@media (max-width: 640px) {
    .control-section-title {
        font-size: 0.95rem;
    }

    .custom-dropdown-trigger {
        padding: 14px 16px;
    }

    .dropdown-selected-text {
        font-size: 0.95rem;
    }

    .btn-extract {
        padding: 14px 16px;
    }

    .btn-extract-title {
        font-size: 0.95rem;
    }

    .btn-extract-desc {
        font-size: 0.75rem;
    }

    .preview-canvas-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .preview-canvas-container.single-image {
        max-width: 250px;
    }

    .preview-canvas-container.few-images {
        max-width: 100%;
        grid-template-columns: repeat(2, 1fr);
    }

    .preview-canvas-container.many-images {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .preview-download-icon {
        width: 40px;
        height: 40px;
    }

    .preview-download-icon svg {
        width: 20px;
        height: 20px;
    }
}