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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
}

.title {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: -0.025em;
}

.rotating-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    animation: rotateArrow 3s ease-in-out infinite;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

@keyframes rotateArrow {
    0% { transform: scaleX(1); }
    50% { transform: scaleX(-1); }
    100% { transform: scaleX(1); }
}

/* Main Content */
.main {
    padding: 48px 0;
}

.upload-section {
    background: white;
    border-radius: 24px;
    padding: 48px;
    margin-bottom: 48px;
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 32px;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 32px;
    border: 2px dashed #e2e8f0;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.file-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.file-label:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.15);
}

.file-label:hover::before {
    left: 100%;
}

.upload-icon {
    width: 56px;
    height: 56px;
    color: #667eea;
    margin-bottom: 16px;
    stroke-width: 1.5;
}

.upload-text {
    font-size: 1.375rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.upload-subtext {
    font-size: 1rem;
    color: #64748b;
    font-weight: 400;
}

/* Options Panel */
.options-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 20px;
    padding: 32px;
    margin-top: 24px;
    border: 1px solid #e2e8f0;
}

.flip-options {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.option-label:hover {
    color: #667eea;
}

.option-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.option-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    transform: scale(1.05);
}

.option-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.batch-naming {
    margin-bottom: 32px;
}

.custom-name-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-name-input {
    width: 100%;
    max-width: 320px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-weight: 500;
}

.custom-name-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.process-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    letter-spacing: -0.025em;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.process-btn:active {
    transform: translateY(0);
}

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

/* Progress */
.progress-container {
    margin-top: 32px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

.progress-text {
    text-align: center;
    color: #64748b;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Preview Section */
.preview-section {
    background: white;
    border-radius: 24px;
    padding: 48px;
    margin-bottom: 48px;
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.preview-section h2 {
    margin-bottom: 32px;
    color: #1a202c;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.image-container {
    text-align: center;
}

.image-container h3 {
    margin-bottom: 16px;
    color: #4a5568;
    font-size: 1.25rem;
    font-weight: 600;
}

.image-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.download-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    letter-spacing: -0.025em;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.4);
}

.flip-new-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    letter-spacing: -0.025em;
    margin-left: 16px;
}

.flip-new-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
}

.batch-download {
    text-align: center;
}

.batch-download h2 {
    color: #1a202c;
    margin-bottom: 16px;
    font-size: 2rem;
    font-weight: 700;
}

.batch-download p {
    color: #64748b;
    margin-bottom: 32px;
    font-size: 1.125rem;
    font-weight: 400;
}

/* Features Section */
.features-section {
    background: white;
    border-radius: 24px;
    padding: 64px 48px;
    margin-bottom: 48px;
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.features-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 48px;
    letter-spacing: -0.025em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.feature-card h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 16px;
    letter-spacing: -0.025em;
}

.feature-card p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 400;
}

/* Content Section */
.content-section {
    background: white;
    border-radius: 24px;
    padding: 64px 48px;
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.content-grid {
    display: grid;
    gap: 48px;
}

.content-block h2 {
    color: #1a202c;
    font-size: 2rem;
    margin-bottom: 24px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.content-block h3 {
    color: #374151;
    font-size: 1.375rem;
    margin: 32px 0 16px 0;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.content-block p {
    color: #64748b;
    margin-bottom: 24px;
    font-size: 1.125rem;
    line-height: 1.7;
    font-weight: 400;
}

.content-block ul, .content-block ol {
    color: #64748b;
    margin: 16px 0 24px 24px;
    font-size: 1.125rem;
}

.content-block li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.content-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    margin: 24px 0;
    border: 1px solid #e2e8f0;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 32px 0;
    text-align: center;
    color: #64748b;
    margin-top: 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile Download Feedback */
.mobile-download-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-width: 280px;
    text-align: center;
}

.mobile-download-feedback.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Hide on desktop */
@media (min-width: 769px) {
    .mobile-download-feedback {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .upload-section, .preview-section, .content-section, .features-section {
        padding: 32px 24px;
        margin-bottom: 32px;
    }
    
    .file-label {
        padding: 48px 24px;
    }
    
    .upload-text {
        font-size: 1.25rem;
    }
    
    .flip-options {
        flex-direction: column;
        gap: 16px;
    }
    
    .image-comparison {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .content-block h2 {
        font-size: 1.75rem;
    }
    
    .content-block h3 {
        font-size: 1.25rem;
    }
    
    .features-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.25rem;
    }
    
    .upload-section, .preview-section, .content-section, .features-section {
        padding: 24px 16px;
    }
    
    .options-panel {
        padding: 24px;
    }
    
    .process-btn, .download-btn {
        width: 100%;
        padding: 14px 24px;
    }
    
    .flip-new-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 16px;
    }
    
    .features-title {
        font-size: 1.75rem;
    }
    
    .feature-card {
        padding: 24px;
    }
}