* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ======================================== */
/* TOP NAVIGATION */
/* ======================================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-icon i {
    font-size: 28px;
    color: white;
}

.brand-text h1 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.brand-text p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.history-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 40px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.history-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ======================================== */
/* HERO SECTION */
/* ======================================== */
.hero-section {
    text-align: center;
    margin-bottom: 50px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
}

.mobile-break {
    display: inline;
}

/* ======================================== */
/* CARD */
/* ======================================== */
.card {
    background: white;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    margin-bottom: 50px;
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.language-selector label {
    font-weight: 500;
    color: #555;
}

.lang-buttons {
    display: flex;
    gap: 12px;
}

.lang-btn {
    padding: 8px 20px;
    border-radius: 40px;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.lang-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.lang-btn:hover:not(.active) {
    border-color: #667eea;
    background: #f8f9ff;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.tab-btn.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Textarea */
textarea {
    width: 100%;
    padding: 18px;
    font-size: 15px;
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    font-family: inherit;
    resize: vertical;
    background: #fafafa;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.input-wrapper {
    position: relative;
}

.input-tools {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.tool-btn {
    background: white;
    border: 1px solid #e0e0e0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    color: #888;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #e0e0e0;
    border-radius: 20px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.upload-zone:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-icon i {
    font-size: 56px;
    color: #667eea;
    margin-bottom: 16px;
}

.upload-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.upload-btn, .camera-btn {
    padding: 10px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.upload-btn {
    background: #667eea;
    color: white;
}

.upload-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.camera-btn {
    background: #28a745;
    color: white;
}

.camera-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Image Preview */
.image-preview {
    position: relative;
    margin-top: 20px;
}

.image-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 16px;
    border: 2px solid #f0f0f0;
}

.remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* OCR Result */
.ocr-result {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 16px;
}

.ocr-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.use-text-btn {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border: none;
    border-radius: 40px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.use-text-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    margin-top: 24px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 60px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.generate-btn:disabled {
    opacity: 0.6;
    transform: none;
}

/* Loading */
.loading-state {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Result Section */
.result-section {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border-radius: 20px;
}

.result-content {
    line-height: 1.6;
    color: #444;
    white-space: pre-wrap;
    margin: 16px 0;
    padding: 16px;
    background: white;
    border-radius: 12px;
}

.result-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.copy-btn {
    background: #667eea;
    color: white;
}

.download-btn {
    background: #28a745;
    color: white;
}

/* Error Message */
.error-message {
    background: #fee;
    color: #c33;
    padding: 14px 18px;
    border-radius: 12px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ======================================== */
/* FEATURES SECTION */
/* ======================================== */
.features-section {
    margin-bottom: 50px;
}

.features-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.feature-card i {
    font-size: 40px;
    color: #667eea;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* ======================================== */
/* HOW IT WORKS SECTION */
/* ======================================== */
.how-it-works {
    margin-bottom: 50px;
    background: white;
    border-radius: 28px;
    padding: 40px;
}

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 40px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.step {
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.step p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* ======================================== */
/* FAQ SECTION */
/* ======================================== */
.faq-section {
    margin-bottom: 50px;
    background: white;
    border-radius: 28px;
    padding: 40px;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.faq-item h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.faq-item p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* ======================================== */
/* FOOTER - COMPLETE FIXED VERSION */
/* ======================================== */
.footer {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 28px;
    padding: 40px 40px 20px 40px;
    margin-top: 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h4 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    display: inline-block;
}

.footer-section ul li a:hover {
    color: white;
    transform: translateX(5px);
}

/* Footer Social Icons */
.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.footer-social a {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.footer-social a:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
}

/* Contact Info in Footer */
.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info li i {
    width: 20px;
    color: #667eea;
    font-size: 14px;
}

/* Footer Bottom */
.footer-bottom {
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: 6px;
}

.footer-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.footer-links .separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

.copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-bottom: 8px;
}

.footer-note {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
}

/* ======================================== */
/* SIDEBAR */
/* ======================================== */
.sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease-in-out;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.close-sidebar {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-stats {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.clear-history-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 13px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.history-item {
    background: white;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.history-date {
    font-size: 11px;
    color: #999;
}

.history-view-btn, .history-delete-btn {
    padding: 4px 10px;
    font-size: 11px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.history-view-btn {
    background: #667eea;
    color: white;
}

.history-delete-btn {
    background: #fee;
    color: #dc3545;
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* ======================================== */
/* HIDDEN CLASS */
/* ======================================== */
.hidden {
    display: none !important;
}

/* ======================================== */
/* MOBILE RESPONSIVE */
/* ======================================== */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }
    
    .sidebar {
        width: 100%;
        right: -100%;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .mobile-break {
        display: block;
    }
    
    .card {
        padding: 20px;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .features-title, .section-title {
        font-size: 24px;
    }
    
    .features-grid, .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .footer {
        padding: 30px 20px 15px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .contact-info li {
        justify-content: center;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .footer-links {
        gap: 5px;
    }
    
    .footer-links a {
        font-size: 11px;
        padding: 3px 6px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ======================================== */
/* FOOTER - UPDATED VERSION */
/* ======================================== */
.footer {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 28px;
    padding: 40px 40px 20px 40px;
    margin-top: 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h4 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    display: inline-block;
}

.footer-section ul li a:hover {
    color: white;
    transform: translateX(5px);
}

/* Footer Social Icons */
.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.footer-social a {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.footer-social a:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
}

/* Contact Info in Footer */
.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.contact-info li i {
    width: 20px;
    color: #667eea;
    font-size: 14px;
}

.contact-info li a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
    word-break: break-all;
}

.contact-info li a:hover {
    color: white;
}

/* Footer Bottom */
.footer-bottom {
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: 6px;
}

.footer-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.footer-links .separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

.copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-bottom: 8px;
}

.footer-note {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
}

/* Mobile Responsive for Footer */
@media (max-width: 768px) {
    .footer {
        padding: 30px 20px 15px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .contact-info li {
        justify-content: center;
    }
    
    .footer-links {
        gap: 5px;
    }
    
    .footer-links a {
        font-size: 11px;
        padding: 3px 6px;
    }
}