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

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

.privacy-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.privacy-icon {
    font-size: 1.5rem;
}

.privacy-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: white;
    text-align: center;
}

main {
    padding: 40px;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-color);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #eef2ff;
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--primary-color);
}

.upload-content h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-content p {
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.file-info {
    font-size: 0.875rem;
    margin-top: 12px;
    color: var(--text-secondary);
}

.file-preview {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.btn-remove {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-remove:hover {
    background: #dc2626;
}

.preview-content {
    padding: 20px;
    text-align: center;
    max-height: 500px;
    overflow: auto;
}

.preview-content img,
.preview-content canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.controls-section {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.control-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s;
}

.control-group select:hover,
.control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.progress-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 12px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #7c3aed);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.results-section {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

#extractedText {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: none;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    color: var(--text-primary);
    background: white;
}

#extractedText:focus {
    outline: none;
}

.text-stats {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

footer {
    text-align: center;
    padding: 20px;
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.btn-help {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    scroll-behavior: smooth;
}

.btn-help:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

html {
    scroll-behavior: smooth;
}

.btn-back {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

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

/* Help Section Styles */
.help-container {
    border-top: 2px solid var(--border-color);
    background: var(--bg-color);
}

.help-main {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.help-section {
    margin-bottom: 40px;
    padding: 30px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.help-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

.help-section h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 15px;
}

.help-content {
    color: var(--text-primary);
    line-height: 1.8;
}

.help-content p {
    margin-bottom: 15px;
    font-size: 1.05rem;
}

.help-steps {
    margin: 20px 0;
    padding-left: 30px;
}

.help-steps li {
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.help-steps li strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.help-steps ul {
    margin-top: 10px;
    padding-left: 25px;
}

.help-steps ul li {
    margin-bottom: 8px;
    list-style-type: disc;
}

.help-content ul {
    margin: 15px 0;
    padding-left: 30px;
}

.help-content ul li {
    margin-bottom: 10px;
    list-style-type: disc;
}

.help-tip {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 8px;
}

.help-tip strong {
    color: #92400e;
}

.audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.audience-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.audience-item h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.audience-item ul {
    padding-left: 20px;
    margin: 0;
}

.audience-item ul li {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.support-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.support-item {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.support-item h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 12px;
    margin-top: 0;
}

.support-item p {
    margin: 0;
    font-size: 0.95rem;
}

.share-section {
    margin-top: 30px;
    padding: 25px;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

.share-section h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.social-share {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.share-btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid;
    cursor: pointer;
    font-size: 0.95rem;
}

.share-facebook {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.share-facebook:hover {
    background: #166fe5;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.share-twitter {
    background: #1da1f2;
    color: white;
    border-color: #1da1f2;
}

.share-twitter:hover {
    background: #1a91da;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.share-linkedin {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

.share-linkedin:hover {
    background: #006399;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.share-whatsapp {
    background: #25d366;
    color: white;
    border-color: #25d366;
}

.share-whatsapp:hover {
    background: #22c55e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.share-reddit {
    background: #ff4500;
    color: white;
    border-color: #ff4500;
}

.share-reddit:hover {
    background: #e63900;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.share-copy {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.share-copy:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.copy-message {
    margin-top: 15px;
    padding: 12px;
    background: var(--success-color);
    color: white;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.privacy-highlight {
    background: #dbeafe;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin-top: 25px;
    border-radius: 8px;
}

.privacy-highlight h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 12px;
    margin-top: 0;
}

.privacy-highlight p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.7;
}

.privacy-highlight strong {
    color: var(--primary-color);
}

.help-footer {
    text-align: center;
    padding: 30px;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.help-footer p {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 20px;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .controls-section {
        flex-direction: column;
    }

    .control-group {
        width: 100%;
    }

    .btn-primary {
        width: 100%;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-actions {
        width: 100%;
    }

    .btn-secondary {
        flex: 1;
    }

    /* Help page responsive */
    .help-main {
        padding: 20px;
    }

    .help-section {
        padding: 20px;
    }

    .help-section h2 {
        font-size: 1.5rem;
    }

    .audience-grid,
    .support-options {
        grid-template-columns: 1fr;
    }

    .social-share {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        text-align: center;
    }

    .privacy-banner {
        flex-direction: column;
        padding: 15px;
    }

    .privacy-text {
        font-size: 0.85rem;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

