/* Base Styles */
:root {
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --text: #1a233a;
    --text-light: #64748b;
    --background: #f6f7fb;
    --surface: #ffffff;
    --border: rgba(59,130,246,0.1);
    --shadow: rgba(59,130,246,0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --header-height: 64px;
    --bottom-bar-height: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', 'Merriweather', sans-serif;
    background: linear-gradient(120deg, #f6f7fb 0%, #e9ebf3 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
}

/* Header */
.pdf-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo span {
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Poppins', sans-serif;
}

.pdf-nav {
    display: flex;
    gap: 1rem;
}

.pdf-nav a {
    text-decoration: none;
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.pdf-nav a.active {
    background: var(--primary);
    color: white;
}

.mobile-menu-btn {
    display: none;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Main Content */
.pdf-main {
    flex: 1;
    padding: 1.5rem;
}

.pdf-workspace {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - var(--header-height) - 3rem);
}

/* Left Panel - PDF Workspace */
.pdf-workspace-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workspace-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
}

.file-counter {
    background: var(--background);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--primary);
    font-size: 0.875rem;
}

/* Workspace Container */
.workspace-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    padding: 1.5rem;
}

.state.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

/* Drop Area */
.pdf-drop-area {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    transition: all 0.3s;
    background: var(--background);
    text-align: center;
}

.pdf-drop-area:hover,
.pdf-drop-area.dragover {
    border-color: var(--primary);
    background: rgba(58,141,255,0.05);
}

.drop-icon {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px var(--shadow);
}

.upload-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Files List */
.files-container {
    height: 100%;
    overflow-y: auto;
    padding: 1rem;
}

.pdf-file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    padding: 0.5rem;
}

.pdf-file-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    cursor: grab;
    transition: all 0.3s;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px var(--shadow);
}

.pdf-file-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow);
}

.pdf-file-card.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.pdf-thumb {
    width: 60px;
    height: 75px;
    background: var(--background);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-light);
}

.pdf-filename {
    font-size: 0.75rem;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.remove-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #ff4757;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s;
    font-size: 0.625rem;
}

.pdf-file-card:hover .remove-btn {
    opacity: 1;
    transform: scale(1);
}

/* Right Panel - Actions */
.pdf-actions-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.actions-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.actions-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}

.actions-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.action-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Buttons */
.merge-btn, .download-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.merge-btn:not(:disabled):hover,
.download-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.merge-btn:disabled {
    background: var(--border);
    cursor: not-allowed;
    transform: none;
}

.download-btn {
    background: #10b981;
}

.download-btn:hover {
    background: #059669;
}

/* File Info */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

/* Instructions */
.instruction-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.instruction-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
}

.instruction-list li::before {
    content: counter(list-item);
    counter-increment: list-item;
    background: var(--primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.instruction-list {
    counter-reset: list-item;
}

/* Success State */
.success-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.merge-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.merge-stats div {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* New loader styles */
.flex-col {
    flex-direction: column;
}

.gap-4 {
    gap: 1rem;
}

.w-full {
    width: 100%;
}

.flex {
    display: flex;
}

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

.justify-center {
    justify-content: center;
}

.w-28 {
    width: 7rem;
}

.h-28 {
    height: 7rem;
}

.border-8 {
    border-width: 2rem;
}

.text-blue-400 {
    color: #60a5fa;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.border-gray-300 {
    border-color: #d1d5db;
}

.border-t-blue-400 {
    border-top-color: #60a5fa;
}

.rounded-full {
    border-radius: 9999px;
}

.animate-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    color: var(--text);
    padding: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid var(--primary);
    pointer-events: auto;
}

.toast.error {
    border-left-color: #ff4757;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

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

/* ===== IMAGES TO PDF STYLES ===== */

/* Image Workspace */
.image-workspace {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - var(--header-height) - 3rem);
}

.image-workspace-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-workspace-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.image-workspace-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
}

.image-drop-area {
    width: 100%;
    min-height: 260px;
    border: 2.5px dashed #b6e7d7;
    border-radius: 28px;
    background: linear-gradient(135deg, #f8fafc 60%, #e6f9f2 100%);
    box-shadow: 0 4px 24px rgba(16,185,129,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    position: relative;
    text-align: center;
}

.image-drop-area:hover,
.image-drop-area.dragover {
    border-color: #10b981;
    background: linear-gradient(135deg, #e6f9f2 60%, #f8fafc 100%);
    box-shadow: 0 8px 32px rgba(16,185,129,0.12);
}

.image-drop-area .drop-icon {
    margin-bottom: 0.5rem;
}

.image-drop-area .drop-icon svg {
    width: 56px;
    height: 56px;
    stroke: #10b981;
    background: #e6f9f2;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(16,185,129,0.08);
}

.image-drop-area p {
    color: #10b981;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.image-upload-btn {
    background: linear-gradient(90deg, #10b981 60%, #34d399 100%);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 0.85rem 2.2rem;
    font-size: 1.08rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.2rem;
    box-shadow: 0 2px 12px rgba(16,185,129,0.10);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.02em;
}
.image-upload-btn:hover {
    background: linear-gradient(90deg, #059669 60%, #10b981 100%);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 16px rgba(16,185,129,0.16);
}

/* Modern Image Cards */
.image-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 0.5rem 0.5rem 0 0.5rem;
    justify-content: flex-start;
}

.image-file-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(16,185,129,0.08);
    padding: 1rem 0.8rem 0.7rem 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    position: relative;
    cursor: grab;
    min-width: 120px;
    max-width: 140px;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 2px solid transparent;
}

.image-file-card:hover {
    box-shadow: 0 6px 24px rgba(16,185,129,0.16);
    border-color: #10b98133;
    transform: translateY(-2px) scale(1.03);
}

.image-file-card.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.image-thumb {
    width: 80px;
    height: 80px;
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 6px rgba(16,185,129,0.07);
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: filter 0.2s;
}

.image-file-card:hover .image-thumb img {
    filter: brightness(0.97) saturate(1.1);
}

.image-filename {
    font-size: 0.92rem;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #1a233a;
    letter-spacing: 0.01em;
}

.image-remove-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #ff4757;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.92;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(255,71,87,0.10);
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}
.image-remove-btn:hover {
    background: #e11d48;
    transform: scale(1.12);
    opacity: 1;
}

/* Image Actions Panel */
.image-actions-panel {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 6px 32px rgba(16,185,129,0.10);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 270px;
    max-width: 340px;
    margin-left: 1.5rem;
    border: 1.5px solid #e6f9f2;
}

.image-actions-header {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    border-bottom: none;
}

.image-actions-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    color: #10b981;
    letter-spacing: 0.01em;
}

.image-actions-content {
    flex: 1;
    padding: 1.2rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
}

.convert-btn, .download-btn {
    background: linear-gradient(90deg, #10b981 60%, #34d399 100%);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 1.1rem 0;
    font-size: 1.13rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    width: 100%;
    box-shadow: 0 2px 12px rgba(16,185,129,0.10);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}
.convert-btn svg, .download-btn svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
}
.convert-btn:not(:disabled):hover, .download-btn:hover {
    background: linear-gradient(90deg, #059669 60%, #10b981 100%);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 16px rgba(16,185,129,0.16);
}
.convert-btn:disabled {
    background: #e6f9f2;
    color: #b6e7d7;
    cursor: not-allowed;
    box-shadow: none;
}

.download-section {
    background: #f8fafc;
    border-radius: 14px;
    padding: 1rem 1rem 0.5rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e6f9f2;
    box-shadow: 0 1px 6px rgba(16,185,129,0.04);
}

/* Info and Instructions */
#imageFileInfo, .image-info-grid {
    margin-bottom: 1.2rem;
}

.info-grid {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 6px rgba(16,185,129,0.04);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e6f9f2;
}
.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 1rem;
    color: #64748b;
    font-weight: 600;
}
.info-value {
    font-size: 1rem;
    font-weight: 700;
    color: #10b981;
}

.instructions {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    box-shadow: 0 1px 6px rgba(16,185,129,0.04);
}
.instruction-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    counter-reset: step;
    margin: 0;
    padding: 0;
}
.instruction-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 1rem;
    color: #64748b;
    line-height: 1.5;
    position: relative;
    padding-left: 2.1rem;
}
.instruction-list li::before {
    counter-increment: step;
    content: counter(step);
    background: #10b981;
    color: #fff;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    position: absolute;
    left: 0;
    top: 0.1rem;
    box-shadow: 0 1px 4px rgba(16,185,129,0.10);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .pdf-nav span {
        display: none;
    }
    
    .pdf-nav a {
        padding: 0.5rem;
    }
    
    .pdf-workspace,
    .image-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        height: auto;
    }
    
    .pdf-actions-panel,
    .image-actions-panel {
        order: -1;
    }
    
    .actions-content,
    .image-actions-content {
        flex-direction: row;
        overflow-x: auto;
        padding: 1rem;
    }
    
    .action-section {
        min-width: 200px;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }
    
    .pdf-header {
        padding: 0 1rem;
    }
    
    .pdf-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .pdf-main {
        padding: 1rem;
    }
    
    .pdf-workspace,
    .image-workspace {
        gap: 1rem;
    }
    
    .workspace-header h1,
    .image-workspace-header h1 {
        font-size: 1.125rem;
    }
    
    .pdf-file-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .image-file-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .pdf-file-card,
    .image-file-card {
        padding: 0.5rem;
    }
    
    .pdf-thumb {
        width: 50px;
        height: 62px;
    }
    
    .image-thumb {
        width: 60px;
        height: 60px;
    }
    
    .pdf-filename,
    .image-filename {
        font-size: 0.625rem;
    }
    
    .actions-content,
    .image-actions-content {
        flex-direction: column;
        overflow-x: visible;
    }
    
    .action-section {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .pdf-main {
        padding: 0.5rem;
    }
    
    .pdf-workspace-panel,
    .pdf-actions-panel,
    .image-workspace-panel,
    .image-actions-panel {
        border-radius: var(--radius-md);
    }
    
    .pdf-file-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .image-file-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .pdf-thumb {
        width: 40px;
        height: 50px;
    }
    
    .image-thumb {
        width: 50px;
        height: 50px;
    }
    
    #toast-container {
        left: 1rem;
        right: 1rem;
    }
    
    .toast {
        width: 100%;
    }
}

/* --- PHASE 3: Success State & Feedback for Images to PDF --- */

.image-success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    padding: 2.5rem 0 2rem 0;
    min-height: 350px;
}

.image-success-icon {
    width: 90px;
    height: 90px;
    background: #e6f9f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(16,185,129,0.10);
    animation: popIn 0.6s cubic-bezier(0.22, 1, 0.36, 1.12);
}

@keyframes popIn {
    0% { transform: scale(0.2); opacity: 0; }
    70% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

.image-success-title {
    font-size: 2rem;
    font-weight: 800;
    color: #10b981;
    margin: 0;
    letter-spacing: 0.01em;
    text-align: center;
}

.image-success-stats-card {
    background: #f8fafc;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(16,185,129,0.06);
    padding: 1.2rem 2.2rem;
    margin: 0.5rem 0 1.2rem 0;
    display: flex;
    flex-direction: row;
    gap: 2.5rem;
    align-items: center;
    justify-content: center;
    min-width: 220px;
}

.image-success-stats {
    display: flex;
    flex-direction: row;
    gap: 2.5rem;
}

.image-success-stats .label {
    font-size: 1.05rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.2rem;
    text-align: center;
}
.image-success-stats .value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10b981;
    text-align: center;
}

#imageDownloadBtn {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
    font-weight: 800;
    padding: 1.1rem 0;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(16,185,129,0.10);
}

.image-success-reset {
    background: #f8fafc;
    color: #10b981;
    border: 2px solid #10b981;
    font-weight: 700;
    margin-top: 0.5rem;
    margin-bottom: 0.2rem;
    box-shadow: none;
    transition: background 0.2s, color 0.2s, border 0.2s, transform 0.2s;
}
.image-success-reset svg {
    stroke: #10b981;
}
.image-success-reset:hover {
    background: #10b981;
    color: #fff;
    border: 2px solid #10b981;
    transform: translateY(-2px) scale(1.04);
}
.image-success-reset:hover svg {
    stroke: #fff;
}

/* --- PHASE 4: Micro-interactions, Accessibility, and Mobile Polish --- */

/* Focus and active states for buttons */
.image-upload-btn:focus, .convert-btn:focus, .download-btn:focus, .image-success-reset:focus {
    outline: 2.5px solid #10b981;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px #b6e7d7;
    z-index: 2;
}

.image-upload-btn:active, .convert-btn:active, .download-btn:active, .image-success-reset:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(16,185,129,0.10);
}

/* Focus state for image cards */
.image-file-card:focus {
    outline: 2.5px solid #10b981;
    outline-offset: 2px;
    z-index: 2;
}

/* Remove button focus/active */
.image-remove-btn:focus {
    outline: 2.5px solid #e11d48;
    outline-offset: 2px;
    z-index: 3;
}
.image-remove-btn:active {
    transform: scale(1.18);
    background: #be123c;
}

/* Drag-and-drop feedback */
.image-file-card.dragover {
    border: 2.5px dashed #10b981;
    background: #e6f9f2;
    box-shadow: 0 6px 24px rgba(16,185,129,0.18);
}

.image-drop-area.dragover {
    border-color: #059669;
    background: linear-gradient(135deg, #e6f9f2 80%, #d1fae5 100%);
    box-shadow: 0 8px 32px rgba(16,185,129,0.18);
}

/* Mobile polish: bigger touch targets, better spacing */
@media (max-width: 600px) {
    .image-file-list {
        gap: 0.7rem;
        padding: 0.2rem 0.2rem 0 0.2rem;
    }
    .image-file-card {
        min-width: 90px;
        max-width: 110px;
        padding: 0.7rem 0.4rem 0.5rem 0.4rem;
        gap: 0.4rem;
    }
    .image-thumb {
        width: 48px;
        height: 48px;
        border-radius: 8px;
    }
    .image-filename {
        font-size: 0.7rem;
    }
    .image-remove-btn {
        width: 22px;
        height: 22px;
        font-size: 0.95rem;
        top: 0.2rem;
        right: 0.2rem;
    }
    .image-upload-btn, .convert-btn, .download-btn, .image-success-reset {
        font-size: 1rem;
        padding: 0.8rem 0;
        border-radius: 12px;
    }
    .image-success-content {
        padding: 1.2rem 0 1rem 0;
        gap: 1.2rem;
    }
    .image-success-title {
        font-size: 1.2rem;
    }
    .image-success-icon {
        width: 60px;
        height: 60px;
    }
    .image-success-stats-card {
        padding: 0.7rem 1rem;
        gap: 1.2rem;
        min-width: 120px;
    }
    .image-success-stats .value {
        font-size: 1.1rem;
    }
}
