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

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #10b981;
    --error: #ef4444;
    --background: #f9fafb;
    --card-bg: #ffffff;
    --text: #111827;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Landing Page Styles */
.landing-page {
    min-height: 100vh;
    padding: 2rem 1rem;
}

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

.landing-header {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

.landing-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: fadeInDown 0.8s ease-out;
}

.tagline {
    font-size: 1.3rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.landing-content {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 1s ease-out 0.4s both;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.btn-large {
    font-size: 1.2rem;
    padding: 1rem 3rem;
    margin-top: 1.5rem;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* App Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.btn-back {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-button.active {
    background: var(--card-bg);
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.card h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.description {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

input[type="file"]:hover {
    border-color: var(--primary);
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-light);
}

.image-preview {
    margin-top: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    max-width: 100%;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: #059669;
}

.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading .btn-text {
    display: none;
}

.btn-loading {
    display: none;
}

.btn.loading .btn-loading {
    display: inline;
}

.result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 0.5rem;
}

.result h3 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.result p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.message-box {
    margin: 1rem 0;
}

.decoded-message {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    margin-top: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Courier New', monospace;
}

.metadata {
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
}

.metadata p {
    margin-bottom: 0.5rem;
}

.error {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    color: var(--error);
}

.hidden {
    display: none !important;
}

#encodedImagePreview img,
#decodedImagePreview img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
    box-shadow: var(--shadow);
}

@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .tabs {
        flex-direction: column;
    }
}

/* Home page styles */
.intro {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text);
}

.feature-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.feature-section:last-of-type {
    border-bottom: none;
}

.feature-section h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.feature-section p {
    line-height: 1.6;
    color: var(--text);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.feature-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

.steps {
    margin-top: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.step-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 1.1rem;
}

.step-content p {
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

.cta-section {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 0.5rem;
}

.cta-section h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.cta-section p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Use Cases Grid */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.use-case {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.use-case h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.use-case p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Technology Section */
.tech-intro {
    margin-bottom: 1.5rem;
}

.tech-details {
    display: grid;
    gap: 1rem;
}

.tech-item {
    background: var(--background);
    padding: 1.25rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary);
}

.tech-item h4 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.tech-item p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* FAQ Section */
.faq-list {
    display: grid;
    gap: 1rem;
}

.faq-item {
    background: var(--background);
    padding: 1.25rem;
    border-radius: 0.5rem;
}

.faq-item h4 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.faq-item p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* About Section */
.about-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.about-section p:last-child {
    margin-bottom: 0;
}

/* Footer */
.landing-footer {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    color: white;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    opacity: 0.8;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul a {
    color: white;
    opacity: 0.8;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-section ul a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* 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: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text);
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: var(--text);
}

.modal-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 1.1rem;
}

.modal-content p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Responsive adjustments for new sections */
@media (max-width: 640px) {
    .use-cases-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .landing-header h1 {
        font-size: 2rem;
    }
    
    .landing-content {
        padding: 2rem 1rem;
    }
}

/* Legal Pages (Privacy Policy, Terms of Service) */
.legal-page {
    min-height: 100vh;
    padding: 2rem 1rem;
}

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

.legal-nav {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    transition: background 0.3s;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

.legal-content {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-lg);
}

.legal-content h1 {
    font-size: 2.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.legal-content .last-updated {
    color: var(--text-light);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.legal-content section {
    margin-bottom: 2rem;
}

.legal-content h2 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.legal-content h3 {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.legal-content p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.legal-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-light);
}

.legal-content ul li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.legal-content a {
    color: var(--primary);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-footer {
    margin-top: 2rem;
    padding: 1.5rem;
    text-align: center;
    color: white;
    opacity: 0.8;
}

.legal-footer p {
    margin-bottom: 0.5rem;
}

.legal-footer a {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem;
}

.legal-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .legal-content {
        padding: 2rem 1rem;
    }
    
    .legal-content h1 {
        font-size: 2rem;
    }
}

