:root {
    /* Light theme variables */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --background: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --success: #059669;
    --error: #dc2626;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --file-text: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

body {
    background-color: var(--background);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: hidden; /* Hide vertical scroll on desktop */
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
    height: calc(100vh - 64px);
    min-height: 500px; /* Minimum height for small screens */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box; /* Ensure padding is included in width */
}

header {
    text-align: center;
    margin-bottom: 1.5rem;
}

header h1 {
    color: var(--text);
    font-size: 2rem;
    margin-bottom: 0;
}

.section-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.template-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.template-card img {
    display: none;
}

.template-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.template-card:hover .template-icon {
    transform: scale(1.05);
}


.download-btn:hover, .enhance-btn:hover {
    background-color: var(--primary-hover);
}

.divider {
    display: none;
}

.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background-color: var(--border);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.divider span {
    background-color: var(--background);
    padding: 0 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.875rem;
}

.upload-box {
    background: var(--surface);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    height: 92%;
    display: flex;
    flex-direction: column;
    min-height: min-content; /* Ensure content fits */
}

#upload-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: min-content;
}

.file-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.1s ease;
    margin-bottom: 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;  /* Ensure minimum height */
}

.file-drop-zone.dragover {
    border-color: var(--primary);
    background-color: rgba(37, 99, 235, 0.05);
}

.file-drop-zone.drag-over {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.upload-icon {
    font-size: 2.5rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.upload-text {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.file-info {
    font-size: 0.8rem;
    color: #6c757d;
}

.file-preview {
    display: flex;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-icon {
    font-size: 2rem;
    color: #4CAF50;
    margin-right: 1rem;
}

.file-details {
    flex: 1;
    text-align: left;
}

.file-name {
    font-weight: bold;
    margin: 0;
}

.file-size {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
}

.remove-file {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
}

.upload-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    width: 0%;
    height: 100%;
    background: #4CAF50;
    transition: width 0.1s ease;
}

.progress-text {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.template-selection {
    margin-bottom: 1.5rem;
}

.template-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.template-radio {
    cursor: pointer;
}

.template-radio input {
    display: none;
}

.radio-custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.1s ease;
}

.template-radio input:checked + .radio-custom {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

#template-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 0.5rem;
    color: var(--text);
    background-color: var(--surface);
}

.enhance-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.enhance-btn:hover {
    background: #45a049;
}

/* Toast notification custom styles */
.toastify {
    padding: 12px 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toastify.success {
    background: #4CAF50;
}

.toastify.error {
    background: #dc3545;
}

.toastify i {
    font-size: 1.2rem;
}

/* Template and Carousel Styles */
.template-carousel {
    position: relative;
    width: 100%;
    height: auto;
    }

    .template-preview-img {
        max-width: 40%;
        max-height: calc(100% - 60px);
        width: auto;
        height: auto;
        object-fit: contain;
        border: 1px solid var(--border);
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }


.template-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Swiper Specific Styles */
.swiper {
    width: 100%;
    height: 100%;
    background: var(--surface);
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--surface);
    height: auto;
}
.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    height: 80vh; /* Reduced from 85vh */
    margin: 0 auto;
    max-width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    height: 100%;
    align-items: center; /* Center items vertically */
    width: 100%;
}

.template-preview {
    min-width: 100%;
    height: 100%;
    display: flex;
    padding: 1rem;
    background: var(--surface);
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.1s ease;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.template-preview.active {
    opacity: 1;
    transform: translateX(0); /* Ensure active slide is fully visible */
}

.template-preview img {
    max-height: calc(85vh - 100px);
    width: auto;
    object-fit: contain;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: none;
}

.template-info {
    flex: 1;
    width: 35%;
    padding-left: 2rem;
    display: none;
}

.template-features {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.template-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.template-features i {
    color: #4CAF50;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.carousel-btn.prev {
    left: 1rem;
}

.carousel-btn.next {
    right: 1rem;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e0;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.dot.active {
    background: #4CAF50;
}



.template-download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.template-download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.template-download-btn i {
    font-size: 1.1rem;
}

/* Selected Template and Navigation Styles - Updated 2024-01-16 */
.selected-template {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    background: var(--surface);
    border: 1px solid var(--border);
    position: relative; /* Added for absolute positioning of buttons */
}

.template-details {
    flex: 1;
    text-align: center; /* Center the text between buttons */
    padding: 0 3rem; /* Make space for buttons on both sides */
}

.template-nav-btn {
    position: absolute;
    top: 50%;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1;
}

.template-nav-btn.prev {
    left: 1rem;
}

.template-nav-btn.next {
    right: 1rem;
}

.template-nav-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.template-nav-btn i {
    font-size: 1rem;
}

/* Remove duplicate dark mode styles and merge them */
[data-theme="dark"] .template-nav-btn {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .template-nav-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Update selected template preview */
.selected-template .template-thumbnail {
    display: none;
}

.selected-template .doc-preview-mini {
    width: 100px;
    height: 140px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 6pt;
    overflow: hidden;
}

/* Add more specific styles for different templates */
.template-preview[data-template="ats-professional"] .doc-page {
    font-family: Arial, sans-serif;
}

.template-preview[data-template="ats-modern"] .doc-page {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Remove all PDF viewer and preview related styles */
.pdf-container,
#pdfViewer,
.pdfViewer,
.modal-content,
.modal-header,
.modal-footer {
    display: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    display: block;
    position: relative;
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    z-index: 2001;
}

/* Ensure PDF pages are centered */
.pdfViewer .page {
    margin: 1px auto;
    border: 9px solid transparent;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-footer {
    padding: 15px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.download-docx-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white; /* Changed from #007bff */
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 16px;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.download-docx-btn:hover {
    background: var(--primary-hover);
    text-decoration: none; /* Removed underline on hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.download-docx-btn i {
    margin-right: 8px;
}

/* Add new layout styles */
.main-content {
    display: grid;
    gap: 2rem;
    flex: 1;
    width: 100%;
    height: 100%;
}

.templates-section {
    margin-bottom: 0;  /* Remove bottom margin as we're using grid gap */
    height: 100%;
}

.ai-section {
    margin-top: 0;  /* Remove top margin as we're using grid gap */
    height: 100%;
}

.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-title {
    font-size: 1.5rem;
    color: var(--text);
    margin: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

/* Add mobile menu button */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Language selector styles - consolidated */
.language-selector {
    position: relative;
    height: 40px;
    z-index: 1010;
}

.language-button {
    height: 40px;
    padding: 0 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.language-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.language-button .fa-chevron-down {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.language-button.active .fa-chevron-down {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1020;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.language-dropdown a:hover {
    background: var(--background);
}

.language-dropdown a.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.language-dropdown .flag {
    font-size: 1.2rem;
}

/* Modern Login Button */
.login-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-btn:hover::before {
    opacity: 1;
}

.login-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.login-btn:hover i {
    transform: translateX(2px);
}

/* Dark mode specific styles */
[data-theme="dark"] .language-button,
[data-theme="dark"] .language-dropdown {
    border-color: var(--border);
    background: var(--surface);
}

[data-theme="dark"] .language-dropdown a:hover {
    background: var(--background);
}

/* Dark mode specific overrides */
[data-theme="dark"] .template-card {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .file-drop-zone {
    background: var(--surface);
    border-color: var (--border);
}

[data-theme="dark"] .upload-box {
    background: var(--surface);
}

[data-theme="dark"] .modal-content {
    background: var(--surface);
}

[data-theme="dark"] #pdfViewer {
    background-color: var(--background);
}

[data-theme="dark"] .carousel-btn {
    background: var(--surface);
    color: var(--text);
}

[data-theme="dark"] .template-details h4,
[data-theme="dark"] .template-details p{
    color: rgb(255, 255, 255);
}

[data-theme="dark"] .file-name,
[data-theme="dark"] .file-size {
    color: rgb(0, 0, 0);
}

[data-theme="dark"] .file-drop-zone {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .file-preview {
    background: white;
}

[data-theme="dark"] .template-preview {
    background: var(--surface);
}

[data-theme="dark"] .selected-template {
    background: var(--surface);
}

[data-theme="dark"] .thumbnail-overlay {
    background: var(--overlay-bg);
    border: none;
}

[data-theme="dark"] .file-info,
[data-theme="dark"] .upload-text {
    color: var(--text-secondary);
}

[data-theme="dark"] .upload-icon {
    color: var (--text-secondary);
}

[data-theme="dark"] .file-icon {
    color: var(--success);
}

[data-theme="dark"] .template-thumbnail {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .template-preview-img {
    border-color: var(--border);
}

.download-options {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.download-btn {
    background-color: var(--surface);
    color: var(--primary);
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    min-width: 200px;
    width: 100%;
    justify-content: center;
}

.download-btn:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.download-btn i {
    font-size: 1.2rem;
}

.download-btn:active {
    transform: translateY(0);
}

/* Dark mode specific styles for download buttons */
[data-theme="dark"] .download-btn {
    background-color: white;
    color: var(--primary);
    border-color: white;
}

[data-theme="dark"] .download-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Update responsive grid layout */
@media (min-width: 1024px) {
    .main-content {
        grid-template-columns: minmax(400px, 1fr) 500px;
    }

    .swiper-pagination{
        display: none;
    }
}

/* Responsive Styles */
@media (max-width: 1023px) {
    body {
        overflow-y: auto; /* Enable scroll on mobile */
    }

    .container {
        height: auto;
        min-height: calc(100vh - 64px);
        padding: 0.5rem;
        overflow-y: visible; /* Enable container scroll */
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
        height: auto;
        min-height: min-content;
    }

    .templates-section {
        order: 2;
        height: 60vh;
        min-height: 400px; /* Minimum height for template section */
    }
    
    .ai-section {
        order: 1;
        height: auto;
        min-height: min-content;
    }

    .container {
        padding: 0.5rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .upload-box {
        width: 100%;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .file-drop-zone {
        width: 100%;
        min-height: 120px;
        padding: 0.75rem;
    }

    .template-carousel {
        max-height: 60vh;
        aspect-ratio: 3 / 4;
    }

    .template-thumbnail {
        width: 100%;
        padding: 0.5rem;
    }

    .template-preview-img {
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

    .enhance-btn,
    .download-btn {
        width: 100%;
        padding: 0.75rem;
    }

    .selected-template {
        width: 100%;
        padding: 0.5rem;
    }

    .swiper {
        width: 100%;
        max-width: 100%;
    }

    .swiper-slide {
        width: 100%;
    }

    .swiper-pagination{
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    .main-content {
        gap: 1rem;
    }

    .template-carousel {
        aspect-ratio: 2/4;
    }

    .template-thumbnail {
        padding: 0.5rem;
    }

    .template-preview-img {
        max-width: calc(100% - 1rem);
        margin: 0 auto;
        max-height: calc(100% - 40px);
    }

    header h1 {
        font-size: 1.5rem;
    }

    .template-download-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .theme-toggle {
        width: 30px;
        height: 30px;
    }

    .nav-title {
        font-size: 1rem;
        max-width: 60%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-right {
        position: fixed;
        top: 64px; /* Height of navbar */
        right: -100%;
        width: 250px;
        height: calc(100vh - 64px);
        background: var(--surface);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        gap: 1rem;
        transition: right 0.3s ease;
        border-left: 1px solid var(--border);
        box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    }

    .nav-right.show {
        right: 0;
    }

    .language-selector {
        width: 100%;
    }

    .language-button {
        width: 100%;
        justify-content: space-between;
    }

    .language-dropdown {
        width: 100%;
        position: relative;
        margin-top: 0.5rem;
    }

    .login-btn {
        width: 100%;
        justify-content: center;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .login-btn {
        padding: 0.4rem 0.8rem;
    }

    .swiper-pagination{
        display: none;
    }    
}

@media (max-width: 430px) {
    .container {
        padding: 0.25rem;
    }

    .main-content {
        gap: 0.5rem;
    }

    .upload-box,
    .template-carousel {
        margin: 0;
        border-radius: 4px;
    }

    .file-preview {
        padding: 0.5rem;
    }

    .file-name {
        font-size: 0.9rem;
        max-width: 200px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .progress-bar {
        height: 6px;
    }

    .swiper-pagination{
        display: none;
    }
}

@media (max-height: 600px) {
    .file-drop-zone {
        min-height: 120px;
    }
    
    .upload-text {
        font-size: 0.9rem;
    }

    .file-info {
        font-size: 0.75rem;
    }

    .enhance-btn, .download-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    .swiper-pagination{
        display: none;
    }
}

@media (min-height: 552px) and (max-height: 800px) {
    .container {
        padding: 0.5rem;
    }

    .swiper-pagination {
        display: none;
    }
    
    .file-drop-zone {
        min-height: 100px;
    }

    .template-carousel {
        min-height: 300px;
    }

    .template-preview-img {
        max-height: calc(100% - 80px);
    }
    .swiper-pagination{
        display: none;
    }
}

/* Update z-index hierarchy */
.navbar { z-index: 1000; }
.language-selector { z-index: 1010; }
.language-dropdown { z-index: 1020; }
.modal { z-index: 2000; }
.modal-content { z-index: 2001; }
.process-overlay { z-index: 3000; }

/* Login Modal Styles */
.login-modal {
    display: block !important;
    max-width: 400px;
    width: 90%;
    padding: 2rem;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.login-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0;
    border: none;
}

.login-modal .modal-header h2 {
    font-size: 1.5rem;
    color: var(--text);
    font-weight: 600;
    margin: 0;
}

.login-modal .close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.login-modal .close-modal:hover {
    background: var(--background);
    transform: rotate(90deg);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface);
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-submit {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.login-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.login-submit:active {
    transform: translateY(0);
}

.login-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--primary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Dark mode specific styles for login modal */
[data-theme="dark"] .login-modal {
    background: var(--surface);
}

[data-theme="dark"] .form-group input {
    background: var(--background);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Full Screen Notification - Added 2024-01-16 */
.full-notification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.full-notification.active {
    display: flex;
    opacity: 1;
}

.notification-content {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.full-notification.active .notification-content {
    transform: translateY(0);
}

.notification-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.notification-title {
    font-size: 1.75rem;
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 600;
}

.notification-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.notification-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.notification-btn {
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-btn.primary {
    background: var(--primary);
    color: white;
    border: none;
}

.notification-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.notification-btn.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.notification-btn.secondary:hover {
    background: var(--background);
    transform: translateY(-1px);
}


