:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --secondary: #f59e0b;
    --dark: #1f2937;
    --dark-light: #374151;
    --light: #f9fafb;
    --gray: #6b7280;
    --gray-light: #9ca3af;
    --gray-lighter: #e5e7eb;
    --success: #10b981;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.nav-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 4rem 0 6rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" opacity="0.05"><polygon fill="white" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.highlight {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.floating-card {
    position: absolute;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transition: var(--transition);
}

.floating-card.before {
    top: 0;
    left: 0;
    transform: rotate(-5deg);
    z-index: 2;
}

.floating-card.after {
    bottom: 0;
    right: 0;
    transform: rotate(5deg);
    z-index: 1;
}

.floating-card:hover {
    transform: rotate(0deg) scale(1.05);
}

.card-image {
    width: 200px;
    height: 150px;
    object-fit: cover;
    display: block;
}

.card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
}

.hero-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Upload Section */
.upload-section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--gray);
}

.upload-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--gray-lighter);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    background: var(--light);
    cursor: pointer;
    margin-bottom: 2rem;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.drop-zone-content i {
    font-size: 3rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.drop-zone-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.drop-zone-content p {
    color: var(--gray);
}

/* Preview Section */
.preview-section {
    display: none;
}

.preview-header {
    margin-bottom: 1.5rem;
}

.preview-header h4 {
    font-size: 1.5rem;
    color: var(--dark);
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.preview-card {
    background: var(--light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.preview-image-container {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    position: relative;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.result-placeholder {
    flex-direction: column;
    color: var(--gray);
}

.result-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray-light);
}

.preview-label {
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid var(--gray-lighter);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-process {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow);
}

.btn-process:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: var(--shadow);
}

.btn-success:hover {
    background: #0da271;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--gray);
    border: 1px solid var(--gray-lighter);
}

.btn-outline:hover {
    background: var(--light);
    transform: translateY(-2px);
}

/* Loading Section */
.loading-section {
    display: none;
    text-align: center;
    padding: 3rem 2rem;
}

.loading-spinner h4 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.loading-spinner p {
    color: var(--gray);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-lighter);
    border-left: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Comparison Section */
.comparison-section {
    display: none;
    margin-top: 3rem;
}

.comparison-slider {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.comparison-container {
    position: relative;
    width: 100%;
    height: 400px;
}

.comparison-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comparison-before {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    width: 50%;
    border-right: 2px solid white;
}

.comparison-slider-handle {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
    cursor: ew-resize;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.comparison-slider-handle i {
    color: var(--dark);
    background: white;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 0.8rem;
}

.comparison-label {
    position: absolute;
    top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: var(--radius);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.before-label {
    left: 1rem;
}

.after-label {
    right: 1rem;
}

/* Features Section */
.features-section {
    padding: 4rem 0;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--light);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.feature-card h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.feature-card p {
    color: var(--gray);
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 3rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-text p {
    margin-bottom: 0.5rem;
}

.footer-subtext {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Responsive Design - Fixed Mobile Issues */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-text h1 {
        font-size: 2rem;
        line-height: 1.3;
        padding: 0 10px;
    }
    
    .hero-description {
        font-size: 1.1rem;
        line-height: 1.5;
        padding: 0 10px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .hero-visual {
        min-height: auto;
        flex-direction: column;
        gap: 2rem;
    }
    
    .floating-card {
        position: relative !important;
        transform: none !important;
        margin: 0 auto !important;
        width: 100%;
        max-width: 280px;
    }
    
    .floating-card.before, .floating-card.after {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        bottom: auto !important;
        right: auto !important;
    }
    
    /* Fixed AI Powered badge centering on mobile */
    .hero-badge {
        position: relative;
        transform: none;
        margin: 1rem auto 0 auto;
        width: fit-content;
        left: auto;
        top: auto;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-card {
        padding: 1.5rem;
    }
    
    .comparison-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .drop-zone {
        padding: 2rem 1rem;
    }
    
    .drop-zone-content h3 {
        font-size: 1.25rem;
    }
    
    .hero-buttons .btn {
        max-width: 250px;
    }
    
    .floating-card {
        max-width: 250px;
    }
}