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

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-card: #141414;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --accent-gradient: linear-gradient(135deg, #6b21a8 0%, #7e22ce 50%, #6b21a8 100%);
    --accent-color: #7e22ce;
    --border-color: #262626;
    --hover-bg: #1f1f1f;
}

body.light-mode {
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --accent-gradient: linear-gradient(135deg, #6b21a8 0%, #7e22ce 50%, #6b21a8 100%);
    --accent-color: #7e22ce;
    --border-color: #e5e7eb;
    --hover-bg: #f3f4f6;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.card {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease, border 0.3s ease;
}

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

.header {
    text-align: center;
    padding: 60px 30px 50px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f1419 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(126, 34, 206, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 20px;
    opacity: 0.95;
    text-transform: uppercase;
    color: white;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 1;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 400;
    margin-bottom: 20px;
}

.format-badges {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    background: rgba(126, 34, 206, 0.2);
    backdrop-filter: blur(10px);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(126, 34, 206, 0.4);
    transition: all 0.3s ease;
}

.badge:hover {
    background: rgba(126, 34, 206, 0.35);
    border-color: rgba(126, 34, 206, 0.6);
    transform: translateY(-2px);
}

.upload-section {
    padding: 40px 30px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.upload-area:hover {
    border-color: var(--accent-color);
    background: var(--hover-bg);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--accent-color);
    background: var(--hover-bg);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.file-types {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.images-section {
    padding: 0 30px 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.page-count {
    background: var(--accent-gradient);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    cursor: grabbing;
}

.image-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.image-info {
    padding: 10px;
    background: var(--bg-secondary);
}

.image-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-order {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}

.image-item:hover .remove-btn {
    opacity: 1;
}

.remove-btn:hover {
    background: #ff3b30;
    transform: scale(1.1);
}

.actions-section {
    padding: 30px;
    background: var(--bg-secondary);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    border-top: 1px solid var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(126, 34, 206, 0.4);
}

.btn-secondary {
    background: var(--accent-gradient);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(126, 34, 206, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

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

.loading {
    padding: 40px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Fixed Controls - Top Right */
.fixed-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 10px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(126, 34, 206, 0.3);
}

.theme-icon {
    font-size: 1.2rem;
}

.theme-text {
    font-size: 0.85rem;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.language-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 10px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
}

.language-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(126, 34, 206, 0.3);
}

.language-icon {
    font-size: 1.2rem;
}

.language-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    min-width: 180px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: var(--hover-bg);
}

.language-option.active {
    background: var(--accent-gradient);
    color: white;
}

.language-option .flag {
    font-size: 1.3rem;
}

.language-option span:last-child {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .fixed-controls {
        top: 15px;
        right: 15px;
        gap: 8px;
    }
    
    .theme-toggle,
    .language-btn {
        padding: 8px 14px;
    }
    
    .theme-text,
    .language-text {
        display: none;
    }
    
    .language-dropdown {
        min-width: 150px;
    }
    
    .header {
        padding: 40px 20px 35px;
    }
    
    .logo {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
    
    .upload-section,
    .images-section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .actions-section {
        padding: 20px;
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .logo {
        font-size: 0.9rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
/* Section Title */
.section-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-weight: 600;
}

/* Features Section */
.features-section {
    padding: 50px 30px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: default;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(126, 34, 206, 0.15);
    border-color: var(--accent-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.feature-card h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* Steps Section */
.steps-section {
    padding: 50px 30px;
    background: var(--bg-card);
}

.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.step-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    flex: 1;
    min-width: 150px;
    transition: all 0.3s ease;
}

.step-card:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 auto 15px;
}

.step-card h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.step-arrow {
    font-size: 2rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Trust Badge */
.trust-badge {
    padding: 30px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.badge-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    border: 2px solid #10b981;
    border-radius: 16px;
    padding: 25px 30px;
}

.badge-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.badge-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge-text strong {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.badge-text span {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* FAQ Section */
.faq-section {
    padding: 50px 30px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.faq-container {
    max-width: 700px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--accent-color);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
}

.faq-toggle {
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: 300;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 25px;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 0 25px 20px;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* SEO Content Section */
.seo-content-section {
    padding: 50px 30px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.seo-article {
    max-width: 800px;
    margin: 0 auto;
}

.seo-article h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.seo-article h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin: 30px 0 15px;
    font-weight: 600;
}

.seo-article p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 1rem;
}

.seo-article ul,
.seo-article ol {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 15px 0 20px 25px;
}

.seo-article li {
    margin-bottom: 10px;
}

.seo-article strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Footer Styles */
.footer {
    margin-top: 30px;
    text-align: center;
}

.footer-content {
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 25px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.footer-content p {
    margin: 5px 0 10px;
    font-size: 0.9rem;
}

.footer-keywords {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
    line-height: 1.6;
}

.footer-keywords span {
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .features-section,
    .steps-section,
    .faq-section,
    .trust-badge {
        padding: 30px 20px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    .steps-container {
        flex-direction: column;
    }
    
    .step-arrow {
        transform: rotate(90deg);
    }
    
    .badge-content {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        padding: 20px 15px;
        border-radius: 8px;
    }
    
    .footer-keywords {
        font-size: 0.75rem;
    }
    
    .seo-content-section {
        padding: 30px 20px;
    }
    
    .seo-article h2 {
        font-size: 1.5rem;
    }
    
    .seo-article h3 {
        font-size: 1.2rem;
    }
    
    .seo-article p,
    .seo-article li {
        font-size: 0.95rem;
    }
}