* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-rgb: 79, 70, 229;
    --secondary-color: #f3f4f6;
    --text-color: #374151;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --background-color: #ffffff;
    --card-bg-secondary: #f9fafb;
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Dark theme variables */
:root[data-theme="dark"] {
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --primary-rgb: 99, 102, 241;
    --secondary-color: #1f2937;
    --text-color: #e5e7eb;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --background-color: #111827;
    --card-bg-secondary: #1a202c;
    --error-color: #f87171;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    background-color: var(--secondary-color);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

header h1 {
    font-weight: 600;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

header p {
    color: #6b7280;
    font-size: 1.1rem;
}

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

.user-section {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    min-width: 120px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background-color: var(--secondary-color);
}

.theme-toggle:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.theme-toggle i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

:root[data-theme="dark"] .theme-toggle i {
    transform: rotate(45deg);
}

#user-button {
    margin-left: 0;
}

.icon-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
}

.icon-button.primary-button {
    background-color: var(--primary-color);
}

.icon-button:hover {
    transform: translateY(-2px);
}

.icon-button i {
    font-size: 1.1rem;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.upload-container {
    background-color: var(--background-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--box-shadow);
    text-align: center;
}

.upload-content {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem 2rem;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.upload-content:hover {
    border-color: var(--primary-color);
}

.upload-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-content p {
    margin: 0.5rem 0;
    color: #6b7280;
}

.upload-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.upload-button:hover {
    background-color: var(--primary-hover);
}

.preview-container, .results-container {
    background-color: var(--background-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.preview-header, .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.preview-header h3, .results-header h3 {
    font-weight: 600;
    color: var(--text-color);
}

.image-preview {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f3f4f6;
}

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

.primary-button {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.primary-button:hover {
    background-color: var(--primary-hover);
}

.secondary-button {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.secondary-button:hover {
    background-color: #e5e7eb;
}

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

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.action-button:hover {
    transform: translateY(-1px);
    background-color: var(--border-color);
}

.action-button i {
    font-size: 1rem;
}

#change-image,
#copy-text,
#download-text,
#download-all {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

#change-image:hover,
#copy-text:hover,
#download-text:hover,
#download-all:hover {
    background-color: var(--border-color);
}

.results-content {
    width: 100%;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Suwannaphum', serif;
    resize: vertical;
}

.hidden {
    display: none !important;
}

.error-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    background-color: #f44336;
    color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-family: 'Suwannaphum', serif;
    max-width: 80%;
    animation: slideIn 0.3s ease-out;
}

/* Add success notification styling */
.error-notification.success {
    background-color: var(--success-color);
}

/* Add warning notification styling */
.error-notification.warning {
    background-color: #ff9800;
}

/* Remove the full-screen loading overlay styles */
.loading-overlay {
    display: none; /* Hide completely as we're not using it anymore */
}

/* Update progress container styles for inline placement */
.progress-container {
    width: 100%;
    margin: 15px 0;
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 12px;
    box-shadow: var(--box-shadow);
}

.progress-bar {
    width: 100%;
    height: 40px;
    background-color: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%
    );
    background-size: 40px 40px;
    border-radius: 6px;
    width: 0;
    position: absolute;
    top: 0;
    left: 0;
    animation: progress-animation 2.5s ease-out forwards, 
               progress-stripes 1s linear infinite;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 5;
    white-space: nowrap;
    pointer-events: none;
}

@keyframes progress-animation {
    0% { width: 0; }
    90% { width: 95%; }
    100% { width: 100%; }
}

@keyframes progress-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

@media (max-width: 768px) {
    .progress-container {
        width: 90%;
        padding: 1.5rem;
    }
    
    .progress-bar {
        height: 35px;
    }
    
    .progress-text {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .progress-container {
        padding: 10px;
    }
    
    .progress-bar {
        height: 32px;
    }
    
    .progress-text {
        font-size: 12px;
    }
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: #6b7280;
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.notice-section {
    background-color: var(--background-color);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--primary-color);
}

.notice-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.notice-section p {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.notice-section p:last-child {
    margin-bottom: 0;
}

/* Updated History Section Styles */
.history-section {
    background-color: var(--background-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-top: 2rem;
    max-height: 600px; /* Set maximum height for the entire section */
    display: flex;
    flex-direction: column;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto; /* Make this container scrollable */
    padding-right: 8px; /* Add some padding for the scrollbar */
    flex-grow: 1; /* Allow this to take remaining space */
    max-height: 500px; /* Set a reasonable max height */
}

/* Add custom scrollbar styling */
.history-items::-webkit-scrollbar {
    width: 6px;
}

.history-items::-webkit-scrollbar-track {
    background: var(--card-bg-secondary);
    border-radius: 10px;
}

.history-items::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.history-items::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Add a footer to the history section for the download all button */
.history-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0; /* Prevent footer from shrinking */
}

.left-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-button {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.supported-formats {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    background-color: var(--card-bg-secondary);
    border: 1px solid var(--border-color);
}

.supported-formats h4 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.supported-formats h4 i {
    margin-right: 8px;
}

.format-list {
    margin: 10px 0;
}

.format-item {
    margin-bottom: 5px;
    font-size: 0.9rem;
    padding-left: 5px;
}

.format-tips {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 8px;
    background-color: rgba(var(--primary-rgb), 0.05);
    border-radius: 4px;
}

.format-tips i {
    color: var(--primary-color);
}

/* App header styling to match privacy page */
.app-header {
    background-color: var(--background-color);
    padding: 1rem 2rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    font-family: 'Suwannaphum', serif;
}

a.logo {
    transition: color 0.3s ease;
}

a.logo:hover {
    color: var(--primary-hover);
}

.subtitle {
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
    font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    /* ...existing code... */
}

/* Add to the end of styles.css */
#user-profile-section {
    background-color: var(--background-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

#close-user-profile {
    display: block;
    margin: 0 auto 1rem auto;
}

#user-profile {
    max-width: 100%;
    overflow-x: auto;
}

/* Styles for the login dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(3px);
}

.dialog-content {
    background-color: var(--background-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    width: 90%;
    max-width: 500px;
}

.dialog-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.dialog-content p {
    margin-bottom: 1rem;
}

.dialog-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.dialog-content li {
    margin-bottom: 0.5rem;
}

.dialog-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Make the "skip" button wider for Khmer text */
.dialog-buttons .secondary-button {
    min-width: 130px; /* Increase width to accommodate Khmer text */
    padding: 0.75rem 1rem;
    justify-content: center;
}

/* Make sure both buttons have similar height */
.dialog-buttons button {
    height: 45px;
    white-space: nowrap;
}

/* Enhanced history item styles */
.history-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background-color: var(--background-color);
    margin-bottom: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-item-date {
    font-size: 0.9rem;
    color: var (--text-muted);
}

.history-item-text {
    max-height: 100px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: var(--secondary-color);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-color);
    white-space: pre-wrap;
}

/* Button highlight animation */
.highlight-button {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }
}

/* Usage counter styles */
.usage-counter {
    background-color: var(--secondary-color);
    border-radius: 8px;
    padding: 10px 15px;
    margin: 12px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.usage-counter p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
}

.usage-counter span {
    display: inline-block;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0 5px;
}

/* Login dialog enhancements */
.dialog-content .benefits-list {
    margin: 15px 0;
    padding: 0;
    list-style: none;
}

.dialog-content .benefits-list li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 10px;
    background-color: var(--secondary-color);
    border-radius: 6px;
}

.dialog-content .benefits-list li i {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 10px;
}

/* Make sure these elements use theme colors */
.upload-container, 
.preview-container, 
.results-container, 
.notice-section,
.history-section,
.dialog-content,
textarea,
input {
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.notice-section p,
.notice-section h3 {
    color: var(--text-color);
}

.history-item {
    background-color: var(--card-bg-secondary);
    border-color: var(--border-color);
}

.history-item-text {
    background-color: var(--background-color);
    color: var (--text-color);
}

.upload-content {
    border-color: var(--border-color);
}

/* Dark mode specific adjustments */
:root[data-theme="dark"] .upload-button:hover,
:root[data-theme="dark"] .action-button:hover {
    background-color: #2d3748;
}

:root[data-theme="dark"] textarea {
    background-color: #1a202c;
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Subscription Page Styles */
body {
    font-family: 'Suwannaphum', serif;
    background-color: #f9fafb;
    color: #374151;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}


h1 {
    text-align: center;
    font-size: 2rem;
    color: #4f46e5;
    margin-bottom: 1rem;
}

p.subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 2rem;
}

.plans {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.plan {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
}

.plan:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.12);
}

.plan::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #4f46e5, #a5b4fc);
    opacity: 0.7;
}

.plan.popular::before {
    background: linear-gradient(to right, #10b981, #34d399);
    opacity: 1;
}

.plan.yearly::before {
    background: linear-gradient(to right, #f59e0b, #fbbf24);
    opacity: 1;
}

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

.plan-header h2 {
    font-size: 1.35rem;
    color: #1f2937;
    font-weight: 700;
    margin: 0;
}

.plan-header .badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #4f46e5;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan.popular .badge {
    background-color: #10b981;
}

.plan.yearly .badge {
    background-color: #f59e0b;
}

.plan-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-end;
}

.plan-price small {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
    margin-left: 0.5rem;
}

.plan-description {
    color: #6b7280;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    color: #374151;
    font-size: 0.9rem;
}

.plan-features li i {
    color: #10b981;
    font-size: 0.95rem;
    min-width: 16px;
}

.plan.yearly .plan-features li i {
    color: #f59e0b;
}

.plan-button {
    display: block;
    text-align: center;
    background-color: #4f46e5;
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.plan-button:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3);
}

.plan.popular .plan-button {
    background-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.plan.popular .plan-button:hover {
    background-color: #059669;
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

.plan.yearly .plan-button {
    background-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.plan.yearly .plan-button:hover {
    background-color: #d97706;
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.3);
}

.plan.popular {
    border-color: #10b981;
    transform: scale(1.03);
    z-index: 1;
}

.plan.popular:hover {
    transform: scale(1.03) translateY(-5px);
}

/* Subscription Page Header Styles */
.subscription-header {
    text-align: center;
    margin-bottom: 2rem;
}

.subscription-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
    position: relative;
    display: inline-block;
}

.subscription-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #4f46e5, #a5b4fc);
    border-radius: 1.5px;
}

.subscription-header .subtitle {
    font-size: 1rem;
    color: #6b7280;
    max-width: 600px;
    margin: 1rem auto 0;
}

@media (max-width: 1000px) {
    .plans {
        flex-wrap: wrap;
        justify-content: center;
    }

    .plan {
        margin-bottom: 1.5rem;
    }

    .plan.popular {
        transform: scale(1);
    }
    
    .plan.popular:hover {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    .plan {
        max-width: 100%;
    }
}

/* ...existing code... */


/* Add global notice style */
.global-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 800px;
    margin: 2rem auto 1rem;
    padding: 0.75rem 1.25rem;
    background-color: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #4f46e5;
    font-size: 0.9rem;
    color: #4b5563;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.global-notice i {
    color: #4f46e5;
    font-size: 1.1rem;
}

.global-notice p {
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .global-notice {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 1rem;
    }
}

/* ...existing code... */

.plan-notice {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background-color: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #4f46e5;
    line-height: 1.4;
}

.plan.popular .plan-notice {
    border-left-color: #10b981;
}

.plan.yearly .plan-notice {
    border-left-color: #f59e0b;
}

/* Adjust spacing to accommodate the new notice */
.plan-price {
    margin-bottom: 0.5rem;
}

.plan-description {
    margin-top: 0.5rem;
}

/* ...existing code... */

/* Update plan feature icons to match their card color schemes */
.plan .plan-features li i {
    color: #4f46e5; /* Default blue/purple for basic plan */
    font-size: 0.95rem;
    min-width: 16px;
}

.plan.popular .plan-features li i {
    color: #10b981; /* Green for popular plan */
}

.plan.yearly .plan-features li i {
    color: #f59e0b; /* Amber/gold for yearly plan */
}

/* ...existing code... */

/* Payment Page Styles */
.payment-header {
    text-align: center;
    margin-bottom: 2rem;
}

.payment-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.payment-header p {
    font-size: 1rem;
    color: #6b7280;
}

.payment-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    margin: 0 auto 2rem;
}

.payment-card .payment-details h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.payment-card .payment-details .price {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4f46e5;
    margin-bottom: 1rem;
}

.payment-card .qr-code img {
    max-width: 200px;
    margin: 1rem 0;
}

.payment-card .download-qr {
    display: inline-block;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background-color: #4f46e5;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.payment-card .download-qr:hover {
    background-color: #4338ca;
}

.payment-card .payment-note {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 1rem;
}

.back-button {
    display: inline-block;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    background-color: #e5e7eb;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #d1d5db;
}



/* ...existing code... */

/* Payment Page Styles - Enhanced to match plan styles */
.payment-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.payment-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.9;
    z-index: -1;
}

.payment-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
}

.payment-header p {
    font-size: 1rem;
    position: relative;
    opacity: 0.9;
}

.payment-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    margin: 0 auto 2rem;
    border-top: 5px solid;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.payment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.payment-card .payment-details h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.payment-card .payment-details .price {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.payment-card .qr-code {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    display: inline-block;
    margin: 0.5rem 0 1.5rem;
}

.payment-card .qr-code img {
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

.payment-card .download-qr {
    display: inline-block;
    margin: 1rem 0;
    padding: 0.75rem 1.5rem;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.payment-card .download-qr:hover {
    transform: translateY(-2px);
}

.payment-card .payment-note {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 1.5rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    margin: 1rem auto;
    padding: 0.75rem 1.5rem;
    background-color: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: #e5e7eb;
    transform: translateX(-3px);
}

/* Basic Plan Styling */

.payment-card.basic {
    border-color: #4f46e5;
}

.payment-card.basic .payment-details .price {
    color: #4f46e5;
}

.payment-card.basic .download-qr {
    background-color: #4f46e5;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.payment-card.basic .download-qr:hover {
    background-color: #4338ca;
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
}

.payment-card.basic .payment-note {
    border-color: #4f46e5;
}



.payment-card.premium {
    border-color: #10b981;
}

.payment-card.premium .payment-details .price {
    color: #10b981;
}

.payment-card.premium .download-qr {
    background-color: #10b981;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.payment-card.premium .download-qr:hover {
    background-color: #059669;
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

.payment-card.premium .payment-note {
    border-color: #10b981;
}


.payment-card.yearly {
    border-color: #f59e0b;
}

.payment-card.yearly .payment-details .price {
    color: #f59e0b;
}

.payment-card.yearly .download-qr {
    background-color: #f59e0b;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.payment-card.yearly .download-qr:hover {
    background-color: #d97706;
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4);
}

.payment-card.yearly .payment-note {
    border-color: #f59e0b;
}

/* ...existing code... */

/* Payment Page Styles - Updated to be more compact */
.payment-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    position: relative;
    background: none; /* Remove background color */
    color: var(--text-color); /* Use theme text color */
}

.payment-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #1f2937;
    position: relative;
}

.payment-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    border-radius: 1.5px;
}

.payment-header p {
    font-size: 0.95rem;
    color: #6b7280;
    margin-top: 0.75rem;
}

/* ...existing code... */

.payment-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

/* Remove download-qr button styles as it's being deleted */
.payment-card .pay-link {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.payment-card .pay-link:hover {
    transform: translateY(-2px);
}

/* ...existing code... */

/* Basic Plan Styling */
.payment-header.basic h1::after {
    background: #4f46e5;
}

.payment-card.basic .payment-details .price {
    color: #4f46e5;
}

/* Remove download-qr styles */
.payment-card.basic .pay-link {
    background-color: #4f46e5;
}

.payment-card.basic .pay-link:hover {
    background-color: #4338ca;
}

/* ...existing code... */

/* Premium Plan Styling */
.payment-header.premium h1::after {
    background: #10b981;
}

.payment-card.premium .payment-details .price {
    color: #10b981;
}

/* Remove download-qr styles */
.payment-card.premium .pay-link {
    background-color: #10b981;
}

.payment-card.premium .pay-link:hover {
    background-color: #059669;
}

/* ...existing code... */

/* Yearly Plan Styling */
.payment-header.yearly h1::after {
    background: #f59e0b;
}

.payment-card.yearly .payment-details .price {
    color: #f59e0b;
}

/* Remove download-qr styles */
.payment-card.yearly .pay-link {
    background-color: #f59e0b;
}

.payment-card.yearly .pay-link:hover {
    background-color: #d97706;
}

/* ...existing code... */

/* Updated QR code styles for larger display */
.payment-card .qr-code {
    background-color: transparent; /* Remove background */
    padding: 0; /* Remove padding */
    border-radius: 0;
    display: block;
    margin: 1.25rem 0; /* Adjust margin for spacing */
    border: none; /* Remove border */
}

.payment-card .qr-code img {
    max-width: 100%; /* Allow image to be as large as possible */
    width: 250px; /* Set fixed width for larger display */
    height: auto;
    margin: 0 auto;
    display: block;
    border-radius: 8px; /* Subtle rounding of corners */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Subtle drop shadow */
}

/* ...existing code... */

/* Updated Payment Page Styles */
.payment-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    position: relative;
}

.payment-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1f2937;
    position: relative;
}

.payment-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    border-radius: 1.5px;
}

.payment-header p {
    font-size: 0.95rem;
    color: #6b7280;
    margin-top: 0.75rem;
}

.payment-header .price {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0.75rem 0;
    display: block;
}

.payment-header .price small {
    font-size: 1rem;
    font-weight: 500;
}

.payment-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.25rem; /* Reduced padding */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 320px; /* Reduced max-width */
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e7eb;
}

.payment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* Updated QR code styles for larger display */
.payment-card .qr-code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    display: block;
    margin: 0.75rem 0; /* Reduced margin */
    border: none;
}

.payment-card .qr-code img {
    width: 100%; /* Use full width of container */
    max-width: 280px; /* Increased max-width */
    height: auto;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ...existing code... */

/* Email instruction styles */
.email-instruction {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.5rem;
    line-height: 1.5;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    padding: 0.5rem;
    background-color: #f9fafb;
    border-radius: 6px;
}

.registered-email {
    font-weight: 600;
    color: #4f46e5;
}

.payment-header.premium .registered-email {
    color: #10b981;
}

.payment-header.yearly .registered-email {
    color: #f59e0b;
}

/* ...existing code... */

/* Payment Completion Styles */
.payment-complete-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.payment-completed-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: 'Suwannaphum', serif;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 320px;
}

.payment-completed-btn:hover {
    transform: translateY(-3px);
}

.payment-completed-btn.basic {
    background-color: #4f46e5;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}

.payment-completed-btn.basic:hover {
    background-color: #4338ca;
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3);
}

.payment-completed-btn.premium {
    background-color: #10b981;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.payment-completed-btn.premium:hover {
    background-color: #059669;
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

.payment-completed-btn.yearly {
    background-color: #f59e0b;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
}

.payment-completed-btn.yearly:hover {
    background-color: #d97706;
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.3);
}

/* Thank You Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 1rem;
    display: inline-block;
    animation: bounce 1s ease-in-out;
}

.modal-title {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.modal-message {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

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

/* ...existing code... */

/* Site Container - Default for most pages */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ...existing code... */

/* Create a specialized container class for the subscription page */
.subscription-container {
    max-width: 1100px; /* Wider width specifically for subscription page */
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Adjust plan widths to fit better in the subscription container */
.subscription-container .plans {
    gap: 1rem; /* Slightly reduce gap between plans */
}

.subscription-container .plan {
    max-width: 280px; /* Make each plan a bit narrower */
    padding: 1.5rem 1.25rem; /* Slightly reduce horizontal padding */
}

/* Responsive adjustments */
@media (max-width: 1100px) {
    .subscription-container {
        max-width: 800px; /* Fall back to regular container width on smaller screens */
    }
    
    .subscription-container .plans {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .subscription-container .plan {
        max-width: 300px; /* Give plans a bit more width on medium screens */
    }
}

@media (max-width: 768px) {
    .subscription-container .plan {
        max-width: 100%; /* Full width on mobile */
    }
}

/* ...existing code... */

/* Fix for night mode background colors */
body {
    font-family: 'Suwannaphum', serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ensure subscription page uses the correct background color in dark mode */
:root[data-theme="dark"] .subscription-container,
:root[data-theme="dark"] .container {
    background-color: var(--background-color);
}

/* Ensure subscription-related elements respond to dark mode */
:root[data-theme="dark"] .plan {
    background-color: var(--card-bg-secondary);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .plan-header h2,
:root[data-theme="dark"] .plan-price,
:root[data-theme="dark"] .plan-features li {
    color: var(--text-color);
}

:root[data-theme="dark"] .plan-description,
:root[data-theme="dark"] .plan-price small,
:root[data-theme="dark"] .plan-notice {
    color: var(--text-muted);
}

:root[data-theme="dark"] .plan-notice {
    background-color: var(--background-color);
}

:root[data-theme="dark"] .global-notice {
    background-color: var(--card-bg-secondary);
    color: var(--text-color);
}

/* Fix payment page dark mode */
:root[data-theme="dark"] .payment-card {
    background-color: var(--card-bg-secondary);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .payment-header h1 {
    color: var(--text-color);
}

:root[data-theme="dark"] .email-instruction {
    background-color: var(--background-color);
    color: var(--text-muted);
}

:root[data-theme="dark"] .payment-note {
    background-color: var(--background-color);
    color: var(--text-muted);
}

:root[data-theme="dark"] .modal-content {
    background-color: var(--card-bg-secondary);
}

:root[data-theme="dark"] .modal-title {
    color: var(--text-color);
}

:root[data-theme="dark"] .modal-message {
    color: var(--text-muted);
}

/* ...existing code... */

/* Limit Reached Modal Styles */
.limit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(3px);
}

.limit-modal-content {
    background-color: var(--background-color);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 550px;
    position: relative;
    animation: modalFadeIn 0.4s ease-out forwards;
}

.limit-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.limit-modal-close:hover {
    color: var(--text-color);
    transform: rotate(90deg);
}

.limit-modal-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
    text-align: center;
    color: var(--primary-color);
}

.limit-modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-align: center;
}

.limit-modal-message {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.6;
    font-size: 1.05rem;
}

.limit-modal-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.limit-modal-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 12px;
    background-color: var(--card-bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.limit-modal-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.limit-modal-option-icon {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-top: 0.2rem;
}

.limit-modal-option-content {
    flex: 1;
}

.limit-modal-option-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--text-color);
}

.limit-modal-option-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.limit-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.limit-modal-btn {
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    font-family: 'Suwannaphum', serif;
}

.limit-modal-btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.limit-modal-btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(var(--primary-rgb), 0.3);
}

.limit-modal-btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.limit-modal-btn-secondary:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.limit-modal-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.limit-modal-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.limit-modal-footer a:hover {
    text-decoration: underline;
}

/* Benefits list for limit modal */
.limit-modal-benefits {
    padding: 1rem;
    margin: 1rem 0;
    background-color: var(--card-bg-secondary);
    border-radius: 8px;
}

.limit-modal-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.limit-modal-benefits li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-color);
}

.limit-modal-benefits li i {
    color: var(--primary-color);
    font-size: 1rem;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .limit-modal-content {
        padding: 1.5rem;
    }
    
    .limit-modal-options {
        flex-direction: column;
    }
    
    .limit-modal-buttons {
        flex-direction: column;
    }
}

/* ...existing code... */

/* Add styles for text button in login required modal */
.text-button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 auto;
    transition: all 0.2s ease;
}

.text-button:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ...existing code... */

/* Styling for the download all button */
#download-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

#download-all:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

#download-all i {
    color: var(--primary-color);
}

/* Make history section scrollable if needed */
.history-items {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Add custom scrollbar styling */
.history-items::-webkit-scrollbar {
    width: 6px;
}

.history-items::-webkit-scrollbar-track {
    background: var(--card-bg-secondary);
    border-radius: 10px;
}

.history-items::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.history-items::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ...existing code... */

/* Multi-image preview styles */
.multi-preview-container {
    background-color: var(--background-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.multi-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.multi-image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.multi-image-item.processing {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
    border: 2px solid #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.multi-image-preview {
    width: 100%;
    height: 150px;
    position: relative;
    background-color: #f3f4f6;
}

.multi-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-number {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-bottom-left-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
}

.multi-image-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    padding: 0.25rem;
}

.multi-image-actions button {
    background-color: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

.multi-image-actions button:hover {
    color: var(--primary-color);
}

.preview-actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ...existing code... */
.result-separator {
    margin: 20px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.separator-line {
    flex-grow: 1;
    height: 1px;
    background-color: var(--border-color, #ddd);
}

.separator-text {
    padding: 0 15px;
    font-weight: bold;
    color: var(--text-muted, #666);
    font-family: 'Suwannaphum', serif;
    font-size: 14px;
}

/* Add at the end of your existing CSS file */

/* Khmer font styling */
.khmer-text {
    font-family: 'Suwannaphum', 'Khmer OS', 'Hanuman', serif;
    font-size: 16px;
    line-height: 1.8;
}

/* Combined results styling */
.combined-results .result-content {
    padding: 0;
}

.combined-results textarea {
    min-height: 400px;
    width: 100%;
    font-family: 'Suwannaphum', 'Khmer OS', 'Hanuman', serif;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    resize: vertical;
}

/* Make sure the text cursor color and selection matches the theme */
.combined-results textarea::selection {
    background-color: rgba(var(--accent-rgb), 0.3);
}

/* Dark mode specific adjustments */
[data-theme="dark"] .combined-results textarea {
    background-color: var(--bg-color-secondary);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Make all results content readable and well-formatted */
#results-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 10px 0;
}

/* Add at the end of your existing CSS file */

/* Image progress bar styling */
.multi-image-preview {
    position: relative;
    overflow: hidden;
}

.image-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 2;
    overflow: hidden;
}

.image-progress-bar {
    height: 100%;
    width: 0;
    background-color: var(--accent-color, #4CAF50);
    transition: width 0.3s ease-out;
}

/* Processing indicator for active image */
.multi-image-item.processing {
    box-shadow: 0 0 0 2px var(--accent-color, #4CAF50);
}

.multi-image-item.processing::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: var(--accent-color, #4CAF50);
    border-radius: 50%;
    z-index: 3;
    margin: 5px;
}

/* Make sure the multi-image-item has proper positioning */
.multi-image-item {
    position: relative;
}

/* Dark theme adjustments */
[data-theme="dark"] .image-progress-container {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Add at the end of your existing CSS file */

/* Adjust progress bar animations to be faster */
@keyframes progress-animation {
    0% { width: 0; }
    90% { width: 95%; }
    100% { width: 100%; }
}

/* Speed up progress bar for images */
.image-progress-bar {
    transition: width 1s linear !important;
}

/* Ensure progress bar completes faster */
.progress-bar-fill {
    animation-duration: 1s !important;
}
/* Ensure textarea text is selectable (add after your existing textarea styles) */
textarea[readonly] {
    cursor: text;
}

/* ...existing code... */

/* Khmer flag link styles - moved from language-button.css */
.khmer-flag-link {
  height: 30px;
  width:auto;  
  display: inline-flex;
  align-items: center;
  margin-right: 12px;
  transition: transform 0.2s ease;
}

.khmer-flag-link:hover {
  transform: translateY(-2px);
}

.khmer-flag-link:active {
  transform: translateY(0);
}

.khmer-flag {
  height: 30px;
  width: auto;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments for flag */
@media (max-width: 768px) {
  .khmer-flag-link {
    margin-right: 8px;
  }
  
  .khmer-flag {
    height: 20px;
  }
}

