:root {
    --background: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --primary: #eb3c25;
    --primary-hover: #1dd871;
    --success: #22c55e;
    --accent: #f59e0b;
    --border: #e2e8f0;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

[data-theme="dark"] {
    --background: #0f172a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --card-bg: #1e293b;
    --border: #334155;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.app-container {
    width: 100%;
    max-width: 800px;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.app-banner {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: cover;
    display: block;
}

/* Editor Card */
.editor-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tool-btn {
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.tool-btn:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.tool-btn:active {
    transform: translateY(0);
}

/* Emoji Picker */
.emoji-wrapper {
    position: relative;
}

.emoji-picker {
    position: absolute;
    top: 110%;
    right: 0;
    width: 350px;
    height: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.emoji-picker.hidden {
    display: none;
}

.emoji-search-wrapper {
    padding: 0.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.emoji-search {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
}

.emoji-search:focus {
    border-color: var(--primary);
}

.emoji-categories {
    display: flex;
    overflow-x: auto;
    padding: 0.5rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
}

.category-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    flex-shrink: 0;
}

.category-btn:hover {
    background: var(--border);
}

.emoji-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.emoji-category {
    margin-bottom: 1rem;
}

.category-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.category-emojis {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
}

.emoji-item {
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem;
    text-align: center;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.emoji-item:hover {
    background: var(--background);
}

/* Editor Area */
.editor-wrapper {
    position: relative;
}

.editor {
    width: 100%;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.2s;
}

.editor:focus {
    border-color: var(--primary);
}

.editor:empty:before {
    content: attr(placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: flex-end;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.char-counter {
    font-family: 'JetBrains Mono', monospace;
    background: var(--background);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

/* Social Limits */
.social-limits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius-md);
}

.limit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.limit-item .icon {
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.limit-item.linkedin .icon {
    background-image: url('https://cdn-icons-png.flaticon.com/512/174/174857.png');
}

.limit-item.instagram .icon {
    background-image: url('https://cdn-icons-png.flaticon.com/512/174/174855.png');
}

.limit-item.facebook .icon {
    background-image: url('https://cdn-icons-png.flaticon.com/512/124/124010.png');
}

.limit-item.x .icon {
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/5/57/X_logo_2023_%28white%29.png');
    filter: invert(1);
}

.limit-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.limit-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0%;
    background: var(--success);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.progress.warning {
    background: var(--accent);
}

.progress.danger {
    background: #ef4444;
}

.percentage {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 3ch;
    text-align: right;
}

/* Actions */
.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.primary-btn,
.secondary-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.secondary-btn {
    background: var(--background);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.secondary-btn:hover {
    background: var(--border);
}

/* Footer */
.app-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    font-weight: 500;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s, transform 0.3s;
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    .editor-card {
        padding: 1.5rem;
    }

    .actions {
        flex-direction: column;
    }

    .emoji-picker {
        width: 280px;
        right: -50px;
    }
}

/* Landing Page Styles */
.landing-separator {
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--success), var(--accent));
    margin: 4rem 0 2rem 0;
    border-radius: 2px;
}

.landing-section {
    margin-top: 2rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(235, 60, 37, 0.05), rgba(29, 216, 113, 0.05));
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2rem auto;
    line-height: 1.7;
}

.cta-button {
    background: linear-gradient(135deg, var(--primary), #ff6b4a);
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(235, 60, 37, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(235, 60, 37, 0.4);
}

.cta-button-large {
    font-size: 1.2rem;
    padding: 1.25rem 3rem;
}

/* Content Sections */
.content-section {
    margin-bottom: 4rem;
    padding: 0 1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    text-align: center;
}

.section-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.section-highlight {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    margin-top: 2rem;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.step-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--success));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem auto;
}

.step-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.step-description {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.benefit-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--success);
}

.benefit-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.benefit-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.benefit-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* FAQ Grid */
.faq-grid {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.faq-item {
    background: var(--background);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.faq-question {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.faq-answer {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Blog Section */
.blog-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.blog-item {
    font-size: 1.05rem;
    color: var(--text-main);
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent);
    transition: all 0.3s ease;
    cursor: pointer;
}

.blog-item:hover {
    transform: translateX(5px);
    background: var(--background);
    border-left-color: var(--success);
}

/* Final CTA Section */
.final-cta-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--success));
    border-radius: var(--radius-lg);
    margin: 3rem 0 2rem 0;
    color: white;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.cta-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.final-cta-section .cta-button {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.final-cta-section .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Legal Footer */
.legal-footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.legal-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.legal-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.legal-link:hover {
    color: var(--primary);
}

.legal-separator {
    color: var(--text-muted);
}

.legal-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* AdSense Containers */
.adsense-container {
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.adsense-horizontal {
    max-width: 728px;
    min-height: 90px;
    width: 100%;
}

.adsense-sidebar {
    float: right;
    margin: 0 0 1rem 2rem;
    max-width: 300px;
    min-height: 250px;
}

.adsense-footer {
    max-width: 728px;
    min-height: 90px;
    width: 100%;
    margin: 3rem auto 2rem auto;
}

/* Placeholder styles (remove when adding real AdSense code) */
.adsense-placeholder {
    width: 100%;
    height: 100%;
    min-height: 90px;
    background: linear-gradient(135deg, rgba(235, 60, 37, 0.05), rgba(29, 216, 113, 0.05));
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

.adsense-sidebar .adsense-placeholder {
    min-height: 250px;
}

/* Responsive Landing Page */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-section {
        padding: 3rem 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .cta-title {
        font-size: 1.8rem;
    }

    .cta-description {
        font-size: 1rem;
    }

    .cta-button-large {
        font-size: 1rem;
        padding: 1rem 2rem;
    }

    .content-section {
        padding: 0 0.5rem;
    }

    /* Responsive AdSense */
    .adsense-horizontal {
        max-width: 100%;
        min-height: 50px;
    }

    .adsense-sidebar {
        float: none;
        margin: 2rem auto;
        max-width: 100%;
    }

    .adsense-footer {
        max-width: 100%;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .legal-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .legal-separator {
        display: none;
    }

    .adsense-container {
        margin: 1.5rem auto;
    }
}