/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

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

/* Navigation Header */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #2563eb;
}

.nav-brand i {
    margin-right: 10px;
    font-size: 28px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #2563eb;
}

/* Buttons */
.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: #2563eb;
    border: 2px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #2563eb;
    background: #f1f5f9;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-text p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.hero-buttons .btn-primary {
    background: white;
    color: #2563eb;
}

.hero-buttons .btn-secondary {
    background: transparent;
    color: white;
    border-color: rgba(255,255,255,0.3);
}

.hero-buttons .btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

/* Hero Image/Demo */
.image-optimizer-demo {
    background: rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.optimizer-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #10b981;
}

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

.demo-file {
    text-align: center;
}

.demo-label {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.demo-size {
    display: block;
    font-size: 18px;
    font-weight: bold;
}

.demo-arrow {
    font-size: 24px;
    opacity: 0.8;
}

.size-reduction {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #10b981;
    font-weight: 600;
}

/* Upload Section */
.upload-section {
    padding: 80px 0;
    background: white;
}

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

.upload-area {
    border: 3px dashed #cbd5e1;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #2563eb;
    background: #f1f5f9;
}

.upload-area.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.upload-content i {
    font-size: 48px;
    color: #94a3b8;
    margin-bottom: 20px;
}

.upload-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #1e293b;
}

.upload-content p {
    color: #64748b;
    margin-bottom: 30px;
}

.privacy-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 16px;
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    border-radius: 8px;
    font-size: 14px;
    color: #0369a1;
    font-weight: 500;
}

.privacy-notice i {
    color: #0ea5e9;
    font-size: 16px;
}

.upload-options {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.quality-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quality-control label {
    font-weight: 600;
    color: #374151;
}

#qualitySlider {
    width: 200px;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
}

#qualityValue {
    font-weight: bold;
    color: #2563eb;
    min-width: 40px;
}

.preset-buttons {
    display: flex;
    gap: 10px;
}

.preset-btn {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.preset-btn:hover,
.preset-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

/* Processing Section */
.processing-section {
    padding: 40px 0;
    background: #f1f5f9;
}

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

.processing-header h3 {
    color: #1e293b;
}

.processing-list {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.processing-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #e5e7eb;
}

.processing-item:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.queue-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 2px;
}

.retry-btn {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.3s ease;
}

.retry-btn:hover {
    background: #d97706;
}

.retry-container {
    min-width: 60px;
}

/* Overall Progress Bar */
.overall-progress {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.overall-progress-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.overall-progress-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.overall-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.file-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-status.processing {
    background: #fbbf24;
    animation: pulse 2s infinite;
}

.file-status.completed {
    background: #10b981;
    color: white;
}

.file-status.error {
    background: #ef4444;
    color: white;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Results Section */
.results-section {
    padding: 60px 0;
    background: white;
}

.results-section h3 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 28px;
    color: #1e293b;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
}

.result-item {
    background: #f8fafc;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

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

.result-filename {
    font-weight: 600;
    color: #1e293b;
}

.result-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #64748b;
}

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

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

.image-container img {
    width: 100%;
    max-width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.image-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #374151;
}

.image-size {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
}

.result-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comparison-tools {
    display: flex;
    gap: 10px;
}

.tool-btn {
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: #e2e8f0;
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background: #f8fafc;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1e293b;
}

.section-header p {
    font-size: 18px;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    font-size: 32px;
    color: white;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1e293b;
}

.feature-card p {
    color: #64748b;
    line-height: 1.6;
}

/* About Section */
.about-section {
    padding: 80px 0;
    background: white;
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    margin-bottom: 60px;
    align-items: start;
}

.about-text h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1e293b;
    margin-top: 30px;
}

.about-text h3:first-child {
    margin-top: 0;
}

.about-text p {
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 20px;
}

.about-features {
    list-style: none;
    padding: 0;
}

.about-features li {
    padding: 12px 0;
    color: #64748b;
    line-height: 1.6;
    border-bottom: 1px solid #f1f5f9;
}

.about-features li:last-child {
    border-bottom: none;
}

.about-features strong {
    color: #2563eb;
    font-weight: 600;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.about-cta {
    background: #f8fafc;
    padding: 50px;
    border-radius: 16px;
    text-align: center;
    border: 2px solid #e2e8f0;
}

.about-cta h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1e293b;
}

.about-cta p {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 30px;
}

/* FAQ Section */
.faq-section {
    padding: 80px 0;
    background: #f8fafc;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

.faq-item {
    padding: 30px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #2563eb;
}

.faq-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1e293b;
}

.faq-item p {
    color: #64748b;
    line-height: 1.6;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    color: #1e293b;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.auth-switch a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

/* Premium Modal Styles */
.premium-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.plan-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.plan-card.featured {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.plan-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #1e293b;
}

.plan-card.featured h3 {
    color: white;
}

.price {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2563eb;
}

.plan-card.featured .price {
    color: white;
}

.price span {
    font-size: 14px;
    color: #64748b;
    font-weight: normal;
}

.plan-card.featured .price span {
    color: rgba(255,255,255,0.8);
}

.savings {
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 20px;
}

.features-list {
    list-style: none;
    text-align: left;
    margin-bottom: 30px;
}

.features-list li {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: #374151;
}

.plan-card.featured .features-list li {
    color: white;
}

.features-list i {
    color: #10b981;
    margin-right: 10px;
    font-size: 14px;
}

.plan-card.featured .features-list i {
    color: #10b981;
}

.plan-card .btn-primary {
    width: 100%;
    margin-top: auto;
}

.plan-card.featured .btn-primary {
    background: white;
    color: #667eea;
}

.plan-card.featured .btn-primary:hover {
    background: #f1f5f9;
    color: #5b6ee6;
}

.payment-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #64748b;
    font-size: 14px;
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.payment-security i {
    color: #10b981;
}

/* Premium Features Indicator */
.premium-feature {
    position: relative;
}

.premium-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(45deg, #ffd700, #ff8c00);
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.premium-limitation {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    color: #92400e;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.premium-limitation i {
    color: #f59e0b;
}

.upgrade-prompt {
    text-align: center;
    margin: 20px 0;
}

.upgrade-btn {
    background: linear-gradient(45deg, #ffd700, #ff8c00);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

/* Advertisement Section */
.advertisement-section {
    padding: 40px 0;
    background: #f1f5f9;
}

.ad-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.ad-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-content ins {
    width: 100%;
    height: 250px;
    display: block;
}

/* Results Ad */
.results-ad {
    margin-top: 40px;
    padding: 30px;
    background: #f8fafc;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.results-ad .ad-label {
    margin-bottom: 20px;
    color: #94a3b8;
}

.results-ad ins {
    max-width: 100%;
    min-height: 200px;
}

/* Sidebar Advertisement */
.sidebar-ad {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
}

.sidebar-ad .ad-label {
    text-align: center;
    margin-bottom: 10px;
}

.sidebar-ad ins {
    width: 130px;
    height: 600px;
    display: block;
}

/* AdSense responsive adjustments */
@media (max-width: 1400px) {
    .sidebar-ad {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .ad-content {
        padding: 15px;
        min-height: 200px;
    }
    
    .ad-content ins {
        height: 200px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }
    
    .nav-menu {
        margin-top: 15px;
        gap: 20px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 36px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .about-stats {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .about-cta {
        padding: 30px 20px;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 24px;
    }
}