/* Common styles for tool pages */

/* Progress Modal */
.progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(244, 114, 182, 0.1);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-modal[style*="flex"] {
    visibility: visible !important;
    opacity: 1 !important;
}

.progress-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(244, 114, 182, 0.3);
    border: 2px solid rgba(244, 114, 182, 0.2);
    text-align: center;
    min-width: 320px;
    max-width: 420px;
    z-index: 100000;
    position: relative;
    overflow: hidden;
    animation: modalBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-content h3 {
    margin: 0 0 1rem 0;
    color: #8b5cf6;
    font-size: 1.3rem;
    font-weight: 600;
    position: relative;
}

.progress-content h3::before {
    content: '✨';
    margin-right: 0.5rem;
    animation: sparkle 2s ease-in-out infinite;
}

.progress-content h3::after {
    content: '✨';
    margin-left: 0.5rem;
    animation: sparkle 2s ease-in-out infinite 1s;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(244, 114, 182, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: inset 0 2px 6px rgba(244, 114, 182, 0.1);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f472b6, #8b5cf6, #06b6d4);
    background-size: 200% 100%;
    border-radius: 15px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
    animation: progressShine 2s ease-in-out infinite;
}

.progress-fill::after {
    content: '🌈';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-fill[style*="width: 100"]::after {
    opacity: 1;
}

/* Images Grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Comparison Slider Styles */
.comparison-container {
    width: 100%;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.comparison-slider {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    height: auto;
    max-height: 600px;
    overflow: hidden;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-before,
.comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.comparison-before {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.comparison-after {
    z-index: 1;
}

.comparison-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.comparison-label {
    position: absolute;
    top: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 10;
}

.comparison-before .comparison-label {
    left: 10px;
}

.comparison-after .comparison-label {
    right: 10px;
}

.comparison-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    z-index: 3;
    cursor: grab;
    transform: translateX(-50%);
}

.comparison-handle:active {
    cursor: grabbing;
}

.comparison-line {
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, #fff 20%, #fff 80%, transparent 100%);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
    position: relative;
}

.comparison-control {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid #e2e8f0;
    font-size: 16px;
    color: #4a5568;
    transition: all 0.2s ease;
}

.comparison-control:hover {
    background: #f7fafc;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Result Item Enhancements */
.result-item {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

.result-info {
    padding: 1.5rem;
}

.result-filename {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #4a5568;
}

.detail-row span:first-child {
    font-weight: 500;
    min-width: 80px;
    color: #2d3748;
}

.quality-improvement {
    align-items: center;
    gap: 10px;
}

.improvement-badge {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
}

.result-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Option Help Text */
.option-help {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Checkbox styling */
.option-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.option-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3182ce;
    cursor: pointer;
}

.option-group input[type="checkbox"]:checked + span {
    color: #1e40af;
}

/* Auto-download notification styling */
.auto-download-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 1rem;
}


/* Fullscreen comparison */
.fullscreen-active {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-active .comparison-slider {
    max-width: 90vw;
    max-height: 90vh;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    z-index: 10001;
    box-shadow: 0 8px 25px rgba(244, 114, 182, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transform: translateX(100%);
    animation: slideInBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-info {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
}

.notification-info::before {
    content: 'ℹ️';
    font-size: 1.2rem;
}

.notification-error {
    background: linear-gradient(135deg, #f472b6, #ef4444);
}

.notification-error::before {
    content: '⚠️';
    font-size: 1.2rem;
}

.notification-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.notification-warning::before {
    content: '🚨';
    font-size: 1.2rem;
}

.notification-success {
    background: linear-gradient(135deg, #34d399, #10b981);
}

.notification-success::before {
    content: '✨';
    font-size: 1.2rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes slideInBounce {
    0% {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateX(-10px) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comparison-container {
        margin: 1rem 0;
    }
    
    .comparison-slider {
        max-width: 100% !important;
        max-height: 300px !important;
        width: calc(100vw - 2rem) !important;
        height: auto !important;
    }
    
    .comparison-control {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .comparison-label {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .improvement-badge {
        margin-left: 0;
        align-self: flex-start;
    }
}

/* Medium screen adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .comparison-slider {
        max-width: 600px !important;
        max-height: 400px !important;
    }
}

.image-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.image-preview {
    position: relative;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.image-info {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.image-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.image-size {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.transform-info {
    color: #3182ce;
    font-size: 0.8rem;
    font-weight: 500;
}

.image-actions {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    min-width: auto;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #3182ce;
    color: #3182ce;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.result-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.result-preview {
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.result-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.result-info {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.result-details {
    color: #666;
    font-size: 0.8rem;
}

.result-details div {
    margin-bottom: 0.25rem;
}

.result-actions {
    padding: 1rem;
    text-align: center;
}

.results-summary {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item strong {
    display: block;
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .images-grid,
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .image-actions {
        gap: 0.25rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
}
.tool-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.tool-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 2rem;
}

.tool-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.tool-header .logo-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: opacity 0.2s ease;
}

.tool-header .logo-link:hover {
    opacity: 0.8;
}

.tool-header .logo h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.tool-header .logo-pdf { color: #f472b6; }
.tool-header .logo-jpg { color: #8b5cf6; }

.tool-header .logo-heart {
    height: 0.9em;
    width: 0.9em;
    margin-left: 0.3em;
    display: inline-block;
    vertical-align: middle;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { 
        transform: scale(1) rotate(0deg); 
        filter: brightness(1);
    }
    25% { 
        transform: scale(1.15) rotate(-2deg); 
        filter: brightness(1.1);
    }
    50% { 
        transform: scale(1.05) rotate(1deg); 
        filter: brightness(1.05);
    }
    75% { 
        transform: scale(1.1) rotate(-1deg); 
        filter: brightness(1.1);
    }
}

.tool-header .tagline {
    font-size: 0.75rem;
    color: #666;
    font-weight: 400;
    display: block;
    margin-top: -5px;
}

.tool-header .nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.tool-header .nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.tool-header .nav-link:hover,
.tool-header .nav-link.active {
    color: #3182ce;
}

.tool-header .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3182ce;
    border-radius: 1px;
}

.tool-header .nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.tool-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.tool-logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.tool-logo .logo-pdf { color: #f472b6; }
.tool-logo .logo-jpg { color: #8b5cf6; }

/* Mobile Navigation */
@media (max-width: 768px) {
    .tool-header .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 2rem;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    
    .tool-header .nav-menu.active {
        right: 0;
    }
    
    .tool-header .nav-toggle {
        display: block;
    }
    
    .tool-header .nav-menu li {
        margin: 1rem 0;
    }
    
    .tool-header .nav-link {
        font-size: 1.2rem;
        padding: 1rem;
    }
}

.back-to-home {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f472b6 0%, #8b5cf6 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(244, 114, 182, 0.3);
}

.back-to-home:hover {
    background: linear-gradient(135deg, #ec4899 0%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 114, 182, 0.4);
}

.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.tool-main {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    margin-bottom: 2rem;
}

.tool-title {
    text-align: center;
    margin-bottom: 1rem;
}

.tool-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.tool-title .tool-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #3182ce;
}

.tool-title .tool-icon .fa-arrow-right {
    font-size: 2rem;
    color: #68d391;
    animation: pulse 2s infinite;
}

.tool-description {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* File Upload Area */
.upload-area {
    border: 3px dashed rgba(244, 114, 182, 0.3);
    border-radius: 25px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(135deg, rgba(254, 247, 237, 0.8), rgba(252, 231, 243, 0.8));
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(244, 114, 182, 0.15), transparent);
    transition: left 0.5s ease;
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #f472b6;
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.1), rgba(139, 92, 246, 0.1));
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(244, 114, 182, 0.2);
}

.upload-area.has-files {
    border-color: #34d399;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1), rgba(16, 185, 129, 0.1));
    border-style: solid;
}

.upload-icon {
    font-size: 4rem;
    color: #f472b6;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 4px 8px rgba(244, 114, 182, 0.2));
}

.upload-area:hover .upload-icon,
.upload-area.drag-over .upload-icon {
    color: #8b5cf6;
    transform: scale(1.2) rotate(10deg);
    filter: drop-shadow(0 6px 12px rgba(139, 92, 246, 0.3));
}

.upload-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #8b5cf6;
    margin-bottom: 0.5rem;
}

.upload-text p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.upload-text .file-types {
    font-size: 0.9rem;
    color: #999;
    background: #edf2f7;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
}

.file-input {
    display: none;
}

.file-preview {
    margin-top: 2rem;
    display: none;
}

.file-preview.visible {
    display: block;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.file-icon {
    font-size: 2rem;
    color: #e53e3e;
}

.file-icon.image {
    color: #3182ce;
}

.file-details h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

.file-details p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-remove {
    background: #fed7d7;
    color: #e53e3e;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-remove:hover {
    background: #feb2b2;
    transform: scale(1.1);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #f472b6 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(244, 114, 182, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(244, 114, 182, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #fef7ed, #fce7f3);
    color: #8b5cf6;
    border: 2px solid rgba(244, 114, 182, 0.2);
    box-shadow: 0 4px 15px rgba(244, 114, 182, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #fce7f3, #e0e7ff);
    transform: translateY(-3px) scale(1.05);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 25px rgba(244, 114, 182, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: white;
    box-shadow: 0 4px 20px rgba(52, 211, 153, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(52, 211, 153, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}


/* Cute button effects */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

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

/* Results Section */
.results-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(244, 114, 182, 0.15);
    border: 2px solid rgba(244, 114, 182, 0.1);
    padding: 2.5rem;
    margin-top: 2rem;
    display: none;
    position: relative;
    overflow: hidden;
}

.results-section.visible {
    display: block;
    animation: slideUp 0.5s ease;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #8b5cf6;
    margin-bottom: 0.5rem;
    position: relative;
}

.results-header h2::after {
    content: '✨';
    margin-left: 0.5rem;
    animation: sparkle 2s ease-in-out infinite;
}

.results-header p {
    color: #666;
    font-size: 1.1rem;
}

.result-files {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.result-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-icon {
    font-size: 2.5rem;
    color: #48bb78;
}

.result-details h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.result-details p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-download {
    background: #48bb78;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-download:hover {
    background: #38a169;
    transform: translateY(-1px);
}

/* Options Panel */
.options-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    display: none;
}

.options-panel.visible {
    display: block;
}

.options-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.options-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

.options-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: #3182ce;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.options-panel.collapsed .options-toggle {
    transform: rotate(-90deg);
}

.options-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
}

.option-group select,
.option-group input {
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.option-group select:focus,
.option-group input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.page-range-input {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.page-range-input input {
    width: 100%;
    margin-bottom: 0.5rem;
}

.page-range-input small {
    color: #718096;
    font-size: 0.8rem;
}

/* Tips Section */
.tips-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.tips-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.tips-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.tip-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.tip-item i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #68d391;
}

.tip-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.tip-item p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-main {
        padding: 2rem 1.5rem;
    }
    
    .tool-title h1 {
        font-size: 2rem;
    }
    
    .tool-title .tool-icon {
        font-size: 3rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .file-actions {
        justify-content: center;
    }
    
    .result-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .result-actions {
        justify-content: center;
    }
    
    .options-content {
        grid-template-columns: 1fr;
    }
    
    .tips-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 0 10px;
    }
    
    .tool-main {
        padding: 1.5rem 1rem;
    }
    
    .upload-area {
        padding: 1.5rem 0.5rem;
    }
    
    .tool-header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .back-to-home {
        width: 100%;
        justify-content: center;
    }
}

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


@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

/* PDF Signature Tool Styles */
.pdf-preview {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pdf-viewer {
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
    margin-bottom: 1rem;
}

.pdf-viewer canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.page-controls span {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
    text-align: center;
}

.signature-panel {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.signature-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    background: #f8fafc;
    border-radius: 8px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #666;
}

.tab-btn:hover {
    background: #e2e8f0;
}

.tab-btn.active {
    background: #3182ce;
    color: white;
    box-shadow: 0 2px 4px rgba(49, 130, 206, 0.3);
}

.signature-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.signature-canvas-container {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    background: #f8fafc;
}

#signature-canvas {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    cursor: crosshair;
}

.canvas-controls {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.pen-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pen-options label {
    font-weight: 500;
    color: #4a5568;
}

.pen-options input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.pen-options input[type="range"] {
    width: 100px;
}

.text-signature-options {
    display: grid;
    gap: 1.5rem;
}

.text-preview {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: white;
    font-size: 40px;
    font-family: 'Dancing Script', cursive;
    color: #000;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.upload-signature-area {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 3rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.upload-signature-area:hover {
    border-color: #3182ce;
    background: #ebf8ff;
}

.upload-signature-area i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.upload-signature-area p {
    margin: 0.5rem 0;
    font-weight: 500;
    color: #4a5568;
}

.upload-signature-area small {
    color: #666;
}

.uploaded-signature {
    margin-top: 1rem;
}

.uploaded-signature img {
    max-width: 300px;
    max-height: 150px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.signature-actions {
    margin-top: 2rem;
    text-align: center;
}

.position-panel {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #48bb78;
}

.position-panel h3 {
    color: #48bb78;
    margin-bottom: 1rem;
}

.position-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Mobile Responsiveness for Signature Tool */
@media (max-width: 768px) {
    .signature-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        justify-content: flex-start;
    }
    
    .canvas-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .pen-options {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .position-controls {
        flex-direction: column;
    }
    
    .text-preview {
        font-size: 24px;
        min-height: 80px;
    }
    
    #signature-canvas {
        width: 100%;
        max-width: 350px;
    }
}

/* Color Picker Styles */
.image-display {
    margin: 2rem 0;
    text-align: center;
}

.image-container {
    position: relative;
    display: inline-block;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

#image-canvas {
    display: block;
    max-width: 100%;
}

.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem;
    border-radius: 8px;
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#zoom-level {
    color: white;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
}

.color-results {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #edf2f7;
}

.results-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-color {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.current-color h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.color-display {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

#current-swatch {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 3px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-codes {
    flex: 1;
    min-width: 300px;
}

.color-code-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.color-code-group label {
    font-weight: 600;
    color: #4a5568;
    width: 50px;
}

.color-code-group input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-family: monospace;
    font-size: 0.9rem;
}

.copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.color-history h3,
.dominant-colors h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.color-grid,
.dominant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.color-item,
.dominant-color-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.color-item:hover,
.dominant-color-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.color-swatch-small {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.dominant-color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.color-info,
.dominant-color-info {
    flex: 1;
}

.color-hex,
.dominant-color-hex {
    font-family: monospace;
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

.color-rgb,
.dominant-color-rgb {
    font-family: monospace;
    color: #718096;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.dominant-color-percentage {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.color-actions,
.dominant-color-actions {
    display: flex;
    gap: 0.25rem;
}

.copy-btn-small {
    background: #edf2f7;
    color: #4a5568;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.copy-btn-small:hover {
    background: #e2e8f0;
    color: #2d3748;
}

/* Color Picker Mobile Styles */
@media (max-width: 768px) {
    .color-display {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .color-codes {
        width: 100%;
        min-width: unset;
    }
    
    .color-grid,
    .dominant-grid {
        grid-template-columns: 1fr;
    }
    
    .zoom-controls {
        position: static;
        justify-content: center;
        margin-top: 1rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }
    
    .zoom-btn {
        background: #e2e8f0;
        color: #4a5568;
    }
    
    .zoom-btn:hover {
        background: #cbd5e0;
    }
    
    #zoom-level {
        color: #4a5568;
    }
}

/* Color Theme Generator Specific Styles */
.dominant-colors-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-header p {
    color: #718096;
    font-size: 1rem;
}

.dominant-colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dominant-color-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.dominant-color-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.color-swatch-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

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

.color-rank {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.color-hex {
    font-family: monospace;
    font-weight: 700;
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.color-percentage {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.copy-btn-mini {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.4rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.copy-btn-mini:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.palette-schemes {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.palette-schemes-grid {
    display: grid;
    gap: 2rem;
}

.palette-scheme-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.palette-scheme-card:hover {
    border-color: #cbd5e0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.scheme-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.scheme-info h4 {
    color: #2d3748;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scheme-info p {
    color: #718096;
    font-size: 1rem;
}

.export-btn {
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.export-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.palette-colors {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.palette-color {
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.5rem;
    border-radius: 8px;
}

.palette-color:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.8);
}

.palette-color .color-swatch {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.palette-color:hover .color-swatch {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.color-code {
    font-family: monospace;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.css-export {
    background: #2d3748;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

.css-export textarea {
    width: 100%;
    height: 80px;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    resize: none;
    outline: none;
    line-height: 1.4;
}

.copy-css-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #4a5568;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.copy-css-btn:hover {
    background: #2d3748;
}

/* Mobile Responsiveness for Color Themes */
@media (max-width: 768px) {
    .dominant-colors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .dominant-color-card {
        padding: 1rem;
    }
    
    .color-swatch-large {
        width: 60px;
        height: 60px;
    }
    
    .palette-colors {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .palette-color .color-swatch {
        height: 60px;
    }
    
    .scheme-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .css-export textarea {
        height: 100px;
        font-size: 0.75rem;
    }
}

/* PDF Pages Preview Styles */
.pages-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.page-thumbnail {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    background: white;
    transition: all 0.2s;
}

.page-thumbnail:hover {
    border-color: #4299e1;
    transform: scale(1.05);
}

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

.page-thumb-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 4px;
    font-size: 0.7rem;
    text-align: center;
}

.more-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #4a5568;
    font-size: 0.8rem;
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
}

/* Source File Preview Styles */
.source-file-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.source-preview-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.source-preview-header h4 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1rem;
}

.source-preview-header p {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
}

.source-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.source-page-thumbnail {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    transition: all 0.2s;
    cursor: pointer;
}

.source-page-thumbnail:hover {
    border-color: #4299e1;
    transform: scale(1.02);
}

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

.source-page-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px;
    font-size: 0.7rem;
    text-align: center;
}

.more-pages-notice {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem;
    background: #e6f3ff;
    border-radius: 6px;
    color: #2d3748;
}

.more-pages-notice p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Mobile Responsiveness for Pages Preview */
@media (max-width: 768px) {
    .pages-preview {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 0.3rem;
        padding: 0.5rem;
        max-height: 150px;
    }
    
    .source-pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.5rem;
        max-height: 200px;
    }
    
    .page-thumb-number,
    .source-page-number {
        font-size: 0.6rem;
        padding: 2px;
    }
}

/* === CUTE ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(100px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply cute animations to page elements */
.tool-container {
    animation: floatUp 0.8s ease-out;
}

.tool-container > * {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.tool-container > *:nth-child(1) { animation-delay: 0.1s; }
.tool-container > *:nth-child(2) { animation-delay: 0.2s; }
.tool-container > *:nth-child(3) { animation-delay: 0.3s; }
.tool-container > *:nth-child(4) { animation-delay: 0.4s; }
.tool-container > *:nth-child(5) { animation-delay: 0.5s; }

/* Hover animations */
.upload-area:hover {
    animation: pulse 1s ease-in-out;
}

.btn:hover {
    animation: bounce 0.6s ease;
}

/* Success animations */
.results-section.visible {
    animation: fadeInUp 0.8s ease, pulse 2s ease 0.8s;
}

/* Progress Modal Animations */
@keyframes modalBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-100px);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes progressShine {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes sparkle {
    0%, 100% { 
        opacity: 0.7; 
        transform: scale(1) rotate(0deg); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2) rotate(180deg); 
    }
}