:root {
    /* Color Palette - Professional Light Mode */
    --bg-main: #f8fafc;
    /* Slate 50 - Off white background */
    --bg-surface: #ffffff;
    /* Pure White cards */
    --bg-surface-hover: #f1f5f9;
    /* Slate 100 */

    --text-primary: #0f172a;
    /* Slate 900 - High contrast text */
    --text-secondary: #475569;
    /* Slate 600 - Muted text */

    --accent-primary: #2563eb;
    /* Corporate Blue 600 */
    --accent-primary-hover: #1d4ed8;
    /* Blue 700 */

    --accent-success: #059669;
    /* Emerald 600 */
    --accent-success-hover: #047857;
    /* Emerald 700 */

    --border-color: #e2e8f0;
    /* Slate 200 */
    --border-focus: #3b82f6;
    /* Blue 500 */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.02);

    --border-radius: 8px;
    /* Tighter radius for professional look */
    --transition-speed: 0.15s;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Header */
.app-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 0;
    box-shadow: var(--shadow-sm);
    text-align: left;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-align: left;
}

.app-logo {
    height: 48px;
    /* Tighter logo */
    width: 48px;
    border-radius: 8px;
    /* Keeping blend mode off for light theme, or remove logo styling entirely if desired */
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Main Layout */
.app-main {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
    flex: 1;
}

@media (max-width: 900px) {
    .app-main {
        grid-template-columns: 1fr;
    }
}

/* Editor Section */
.editor-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    background-color: var(--bg-surface);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.ms-auto {
    margin-left: auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn.primary {
    background-color: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn.primary:hover {
    background-color: var(--accent-primary-hover);
    box-shadow: var(--shadow-md);
}

.btn.secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn.secondary:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.btn.accent {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn.accent:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn.success {
    background-color: var(--accent-success) !important;
    color: white !important;
    border-color: var(--accent-success) !important;
}

/* Textarea */
.textarea-wrapper {
    flex: 1;
    display: flex;
    position: relative;
}

#text-input {
    width: 100%;
    min-height: 400px;
    resize: vertical;
    padding: 1.5rem;
    font-family: inherit;
    font-size: 1.05rem;
    line-height: 1.7;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    outline: none;
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-sm);
}

#text-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#text-input::placeholder {
    color: #475569;
}

/* Sidebar Stats */
.stats-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 2rem;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-secondary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* SEO Article Section */
.seo-article {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
    padding-bottom: 3rem;
    margin-top: 2rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.seo-article h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.article-content {
    color: var(--text-secondary);
    font-size: 1rem;
}

.article-content p {
    margin-bottom: 1rem;
}

/* Footer Section */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 3rem;
    background-color: var(--bg-surface);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

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

@media (min-width: 640px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.animate-pop {
    animation: pulse 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}