@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --hover-color: #f5f5f5;
    --text-muted: #6c757d;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --border-color: #333333;
    --hover-color: #2a2a2a;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    background-image: url('../images/grid.svg');
    transition: background-color 0.3s, color 0.3s;
}

/* Theme Switch */
.theme-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
}

/* Upload Container */
.upload-container {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.3s, background-color 0.3s;
}

.upload-container:hover, .upload-container.dragover {
    border-color: #0d6efd;
    background-color: var(--hover-color);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Dimension Controls - Updated as per manager's request */
.dimensions-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem auto;
    width: 100%;
    max-width: 300px;
}

.dimension-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}

.dimension-control label {
    min-width: 60px;
    text-align: right;
}

.dimension-control input {
    width: 80px;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

@media (max-width: 768px) {
    .dimensions-group {
        padding: 0 1rem;
    }

    .dimension-control {
        justify-content: space-between;
        max-width: 250px;
    }
}

.aspect-ratio-control {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
}

.aspect-ratio-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.toggle-label {
    font-weight: 500;
}

.width-slider {
    max-width: 280px;
    margin: 1rem auto 0;
    padding: 0 1rem;
    transition: opacity 0.3s ease;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .aspect-ratio-control {
        margin: 0.5rem 0;
        padding: 0.5rem;
    }

    .download-section {
        margin-top: 1rem;
        padding: 0.75rem;
    }

    .aspect-ratio-toggle {
        padding: 0.75rem;
    }
}

/* Preview Box */
.preview-box {
    width: 100%;
    height: 300px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--hover-color);
}

.preview-box canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Controls Container */
.controls-container {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 900px;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

/* Info Text */
.info-text {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}


/* Footer */
footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.8;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .dimensions-group {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .dimension-control {
        width: 100%;
        justify-content: center;
    }

    .preview-box {
        margin-bottom: 1rem;
    }

    .controls-container {
        padding: 1.5rem;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0 1rem;
    }
}

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

.image-preview-container:not(.d-none) {
    animation: fadeIn 0.3s ease-out;
}

/* Upload Notification */
.upload-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

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

.upload-notification.show {
    display: block;
}

.controls-container .row {
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .controls-container .row {
        gap: 2rem;
        margin-bottom: 3rem;
        padding: 0 1rem;
    }
}

.info-text {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

input[type="number"] {
    width: 100px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.download-section {
    margin-top: 1.5rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .download-section {
    background: rgba(40, 40, 40, 0.8);
}

#downloadBtn {
    background: #28a745;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center; /* Add this */
    gap: 0.75rem;
    margin: 0 auto;
    min-width: 200px;
    transition: all 0.2s ease;
}

/* Ensure consistent alignment in mobile view */
@media (max-width: 768px) {
    #downloadBtn {
        justify-content: center;
        width: 100%;
    }
}

#downloadBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#downloadBtn i {
    width: 20px;
    height: 20px;
}

.preview-box {
    margin-bottom: 1.5rem;
}

/* Loading Spinner */
.spinner-container {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer Styles */
footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.8;
}

/* Width Slider */
.slider-container {
    width: 100%;
    max-width: 450px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    position: relative;
}

.width-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, #0d6efd, #0d6efd) 0 0 / var(--slider-progress, 50%) 100% no-repeat #e0e0e0;
    border-radius: 6px;
    margin: 1.5rem 0;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.width-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #0d6efd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid #ffffff;
}

.width-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.width-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
    background: #0b5ed7;
}

.slider-labels {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.75rem;
    text-align: center;
}

.image-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.dimensions {
    font-weight: 600;
}

.file-size {
    color: var(--text-muted);
}

.current-width {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    background: var(--bg-color);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

[data-theme="dark"] .width-slider {
    background: #333;
}

/* Preview Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.image-preview-container:not(.d-none) {
    animation: fadeIn 0.3s ease-out;
}

.controls-container:not(.d-none) {
    animation: scaleIn 0.3s ease-out;
}

@keyframes uploadSuccess {
    0% { transform: scale(0.95); opacity: 0; }
    50% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.upload-success {
    animation: uploadSuccess 0.4s ease-out;
}

.preview-container {
    transition: all 0.3s ease-in-out;
}

.dimension-control label {
    font-weight: 500;
    color: var(--text-color);
}

.dimension-control .unit {
    color: var(--text-muted);
    font-weight: 500;
}

.form-check {
    margin: 0;
    padding: 0.5rem 0;
}

.width-slider {
    padding: 0.5rem 0;
}

@media (min-width: 768px) {
    .dimensions-group {
        flex-direction: row;
        align-items: center;
        padding: 0;
    }

    .dimension-control {
        flex: 1;
    }
}

/* Content Pages Styles */
.content-page {
    min-height: calc(100vh - 200px);
}

/* Blog Styles */
.blog-header {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(66, 133, 244, 0.05));
    padding: 4rem 2rem;
    border-radius: 20px;
    margin-bottom: 3rem;
}

.blog-card {
    border: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 16px;
    background: var(--bg-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.blog-card:hover .blog-icon {
    transform: scale(1.1) rotate(5deg);
}

.blog-icon-wrapper {
    display: inline-block;
    padding: 12px;
    background: rgba(66, 133, 244, 0.1);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.blog-icon {
    width: 32px;
    height: 32px;
    stroke: #4285F4;
    stroke-width: 2px;
    transition: transform 0.3s ease;
}

.blog-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.blog-card .card-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.read-more-wrapper {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.read-more {
    color: #4285F4;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.blog-card:hover .read-more {
    gap: 0.75rem;
}

/* Blog Post Styles */
.blog-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.blog-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.blog-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.blog-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.blog-content ul, .blog-content ol {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

[data-theme="dark"] .blog-card {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .blog-header {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(66, 133, 244, 0.05));
}

[data-theme="dark"] .read-more-wrapper {
    border-top-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .blog-header {
        padding: 3rem 1rem;
    }
    
    .blog-content {
        padding: 1.5rem;
    }
    
    .blog-content h1 {
        font-size: 2rem;
    }
    
    .blog-content h2 {
        font-size: 1.5rem;
    }
}

.read-more {
    color: #4285F4;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more .feather-sm {
    width: 16px;
    height: 16px;
}

.blog-card .card-title {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.blog-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
    background: linear-gradient(to right, rgba(66, 133, 244, 0.1), rgba(66, 133, 244, 0.05));
    border-radius: 16px;
}

.blog-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.blog-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.blog-content p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    opacity: 0.9;
}

[data-theme="dark"] .blog-card {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .blog-header {
    background: linear-gradient(to right, rgba(66, 133, 244, 0.15), rgba(66, 133, 244, 0.05));
}

.content-section {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.content-section:hover {
    transform: translateY(-2px);
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.faq-answer {
    padding-top: 1rem;
    display: none;
}

.faq-answer.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.breadcrumb {
    background: transparent;
    margin-bottom: 2rem;
}

.breadcrumb-item a {
    color: var(--text-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .dimension-control {
        grid-template-columns: 70px 1fr auto;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .dimension-control input {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    #downloadBtn {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }

    .controls-container .row {
        margin-bottom: 1rem;
    }

    .controls-container .col-12 {
        margin-bottom: 0.5rem;
    }

    .d-flex.align-items-center {
        justify-content: space-between;
        width: 100%;
    }

    .form-control {
        max-width: 120px;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0 1rem;
    }

    .preview-box {
        margin-bottom: 1rem;
    }

    .width-slider {
        padding: 0 1rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
    }

    .form-check {
        margin: 1rem 0;
    }

    input[type="range"] {
        height: 2rem;
    }
}

.upload-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

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

.upload-notification.show {
    display: block;
}

/* Book Cards Styles */
.recommended-books {
    padding: 3rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.book-card {
    background: var(--bg-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.book-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
}

.book-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-image img {
    transform: scale(1.05);
}

.book-title {
    color: var(--text-color);
    font-weight: 600;
}

.badge {
    padding: 0.5em 1em;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
}

.unforgettable-title {
    color: #4285F4;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
    position: relative;
}

.unforgettable-title:after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #4285F4;
    border-radius: 3px;
}

.btn-spotify, .btn-audible, .btn-google, .btn-apple {
    border: none;
    padding: 0.75rem;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    margin: 8px 0;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.btn-spotify {
    background-color: #1DB954;
    color: white;
}

.btn-audible {
    background-color: #F7991C;
    color: white;
}

.btn-apple {
    background-color: #232323;
    color: white;
}

.btn-google {
    background-color: #4285F4;
    color: white;
}

.btn-spotify:hover {
    background-color: #1DB954 !important;
}

.btn-audible:hover {
    background-color: #F7991C !important;
}

.btn-google:hover {
    background-color: #4285F4 !important;
}

.btn-apple:hover {
    background-color: #232323 !important;
    color: white !important;
}

.section-heading {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.section-heading:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* User Stats Section */
.user-stats {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin: 2rem auto;
}

.stats-card {
    padding: 2rem;
    text-align: center;
}

.stats-card h2 {
    color: var(--text-color);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.stats-card .lead {
    color: var(--text-color);
    opacity: 0.9;
}

.rating {
    margin-top: 2rem;
}

.rating .stars {
    color: #FFD700;
    font-size: 2rem;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
}

.rating-text {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Feature Grid and Testimonials Styles */
.feature-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    stroke: var(--primary-color);
}

.rating-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
}

.stars {
    color: #00b67a;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

/* Dark mode support */
[data-theme="dark"] .feature-card {
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .feature-card {
        padding: 1.5rem !important;
    }

    .recommended-books .col-md-3 {
        width: 70%;
        margin: 0 auto;
    }
}
/* Loading Spinner Styles */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.loading-spinner.show {
    display: flex;
    opacity: 1;
}

.spinner {
    width: 70px;
    height: 70px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
    box-shadow: 0 0 25px rgba(13, 110, 253, 0.6);
    filter: drop-shadow(0 0 10px rgba(13, 110, 253, 0.4));
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.15) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.loading-text {
    position: absolute;
    bottom: 35%;
    color: white;
    font-size: 1.25rem;
    font-weight: 500;
    text-align: center;
    animation: fadeInOut 2s ease-in-out infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.7; transform: translateY(5px); }
    50% { opacity: 1; transform: translateY(0); }
}

/* Amazon Deals Button Styles */
/* Amazon Deals Button */
.amazon-deals-button {
    padding: 1.5rem;
    margin: 2.5rem auto;
    max-width: 600px;
    position: relative;
}

.amazon-deals-button .btn {
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, #4285F4, #34A5FF);
    border: none;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.2);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-decoration: none;
    color: #fff;
    letter-spacing: 0.5px;
}

.amazon-deals-button .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: 0.5s;
}

.amazon-deals-button .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.3);
    background: linear-gradient(135deg, #34A5FF, #4285F4);
}

.amazon-deals-button .btn:hover::before {
    left: 100%;
}

.amazon-deals-button .btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 153, 0, 0.2);
}

.amazon-deals-button .fab {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.amazon-deals-button .btn:hover .fab {
    transform: scale(1.1);
}

/* Mobile optimization for Amazon button */
@media (max-width: 768px) {
    .amazon-deals-button {
        padding: 1rem;
        margin: 2rem auto;
    }

    .amazon-deals-button .btn {
        padding: 1rem 1.8rem;
        font-size: 1rem;
        width: 90%;
    }
}

[data-theme="dark"] .amazon-deals-button .btn {
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
}

/* Preview Grid Styles */
#imageList {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 1rem;
}

.preview-item {
    width: 150px;
    height: 150px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: var(--bg-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.preview-item:hover {
    transform: translateY(-2px);
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.preview-item .btn-danger {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 4px;
    line-height: 1;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.preview-item:hover .btn-danger {
    opacity: 1;
}

/* PDF Options Styles */
.pdf-options {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.pdf-options h5 {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

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

.option-group {
    background: rgba(0, 0, 0, 0.02);
    padding: 1rem;
    border-radius: 6px;
}

.option-group .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #566573;
}

.form-switch {
    padding-left: 2.5rem;
}

.form-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
    margin-left: -2.5rem;
}

.download-section {
    margin-top: 2rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.form-check-label {
    color: var(--text-color);
    cursor: pointer;
}

.form-select {
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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