/* ===================================
   اكتبلي PRO - نظام التصميم المتطور v2.0
   Premium Design System
   =================================== */

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* CSS Variables */
/* CSS Variables - Premium Light Theme Default */
:root {
    /* Colors - Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    /* Slate-50 */
    --bg-tertiary: #f1f5f9;
    /* Slate-100 */
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;

    /* Text Colors */
    --text-primary: #0f172a;
    /* Slate-900 */
    --text-secondary: #334155;
    /* Slate-700 */
    --text-tertiary: #64748b;
    /* Slate-500 */
    --text-muted: #94a3b8;
    /* Slate-400 */

    /* Accent Colors */
    --accent-primary: #4f46e5;
    /* Indigo-600 */
    --accent-secondary: #7c3aed;
    /* Violet-600 */
    --accent-tertiary: #db2777;
    /* Pink-600 */
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
    --accent-gradient-hover: linear-gradient(135deg, #4338ca 0%, #6d28d9 50%, #be185d 100%);
    --accent-glow: rgba(79, 70, 229, 0.2);
    --accent-glow-strong: rgba(99, 102, 241, 0.35);

    /* Success/Warning/Error */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Border */
    --border-color: #e2e8f0;
    /* Slate-200 */
    --border-color-hover: #cbd5e1;
    /* Slate-300 */

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows (Premium Light) */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.1), 0 12px 16px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 30px rgba(79, 70, 229, 0.25), 0 0 60px rgba(79, 70, 229, 0.1);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s ease;

    /* Font */
    --font-primary: 'Cairo', 'Tajawal', sans-serif;
}

/* Dark Theme Override */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    /* Slate-900 */
    --bg-secondary: #1e293b;
    /* Slate-800 */
    --bg-tertiary: #334155;
    /* Slate-700 */
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.9);

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-muted: #64748b;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);

    --accent-glow: rgba(99, 102, 241, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Static Background - Mesh Gradient */
.static-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 10%, rgba(219, 39, 119, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 50% 60% at 50% 90%, rgba(124, 58, 237, 0.06) 0%, transparent 50%);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Glass Card - Premium Glassmorphism */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.glass-card:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Header */
.header {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-icon-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon {
    font-size: 2rem;
    position: relative;
    z-index: 1;
}

/* Logo wrapper - static style */
.logo-icon-wrapper {
    background: var(--accent-gradient);
    border-radius: 50%;
    padding: 8px;
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    margin-right: var(--spacing-xs);
    vertical-align: top;
}

.nav-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: var(--spacing-2xl) 0 var(--spacing-xl);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xl);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-2xl);
}

.hero-stat {
    text-align: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.hero-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.hero-stat .stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat .stat-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* Main Content */
.main-content {
    padding: var(--spacing-xl) 0 var(--spacing-2xl);
}

.app-layout-single {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 1.4rem;
    font-weight: 700;
}

/* icon-animated - حركة معطلة */

.section-badges {
    display: flex;
    gap: var(--spacing-sm);
}

.section-badge {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ai-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-primary);
}

.ai-pulse {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulseDot 1.5s ease-in-out infinite;
}

/* Form Styles */
.article-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.form-group {
    position: relative;
}

.group-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    color: var(--text-primary);
}

.label-icon {
    font-size: 1.1rem;
}

/* Floating Label Input */
.floating-label .input-container {
    position: relative;
}

.floating-label input {
    width: 100%;
    padding: 1.2rem 1rem 0.8rem 3rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all var(--transition-normal);
    font-family: inherit;
}

.floating-label label {
    position: absolute;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    transition: all var(--transition-fast);
    font-size: 1rem;
}

.floating-label input:focus,
.floating-label input:not(:placeholder-shown) {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.floating-label input:focus+label,
.floating-label input:not(:placeholder-shown)+label {
    top: 0.6rem;
    transform: translateY(0);
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.input-icon-left {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    z-index: 1;
}

.input-hint {
    margin-top: var(--spacing-sm);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Magic Button */
.btn-magic {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.5rem 1rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.btn-magic:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: var(--shadow-glow);
}

.btn-magic:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.magic-loading {
    display: none;
}

.btn-magic.loading .magic-icon,
.btn-magic.loading .magic-text {
    display: none;
}

.btn-magic.loading .magic-loading {
    display: flex;
}

.dot-loader {
    display: flex;
    gap: 4px;
}

.dot-loader::before,
.dot-loader::after,
.dot-loader span {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: dotPulse 1s ease-in-out infinite;
}

.dot-loader::after {
    animation-delay: 0.2s;
}

.dot-loader span {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.5);
        opacity: 0.5;
    }
}


/* Suggested Keywords */
.suggested-keywords {
    display: none;
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.suggested-keywords.visible {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.keywords-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.keyword-tag:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.keyword-tag.selected {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Enhanced Keywords Section */
.keywords-section .selected-count {
    margin-right: auto;
    padding: 2px 10px;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-full);
}

.quick-keywords {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
    flex-wrap: wrap;
}

.quick-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quick-tag {
    padding: 4px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-tag:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

.quick-tag.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

.keywords-input-wrapper.enhanced {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.keywords-input-wrapper.enhanced:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.keywords-input-wrapper.enhanced .keywords-input-icon {
    position: absolute;
    right: 1rem;
    font-size: 1.2rem;
}

.keywords-input-wrapper.enhanced .keywords-input {
    flex: 1;
    padding: 1rem 3rem 1rem 1rem;
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
}

.keywords-input-wrapper.enhanced .keywords-input:focus {
    outline: none;
}

.selected-keywords-display {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
    border-radius: var(--radius-md);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.selected-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success);
}

.btn-clear-all {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-clear-all:hover {
    background: var(--error);
    color: white;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--success);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.selected-tag .remove-tag {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.selected-tag .remove-tag:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Keywords Header Improved */
.keywords-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.keywords-header-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.keywords-header-title .icon {
    font-size: 1.1rem;
}

.keywords-count {
    padding: 4px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.keywords-actions {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.btn-add-all {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-add-all:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Magic Generate Button Enhanced */
.btn-magic-generate {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.btn-magic-generate:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.btn-magic-generate.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-magic-generate .magic-sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(15deg);
    }
}

.btn-magic-generate.loading .magic-sparkle,
.btn-magic-generate.loading .magic-text {
    display: none;
}

.btn-magic-generate.loading .magic-loading {
    display: flex !important;
}

/* Word Count Cards */
.word-count-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.word-count-card {
    position: relative;
    cursor: pointer;
}

.word-count-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.word-count-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    text-align: center;
}

.word-count-card:hover .card-content {
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.word-count-card input:checked+.card-content {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: var(--shadow-glow);
}

.card-icon-wrap {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    font-size: 1.5rem;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.card-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.card-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.recommended-badge {
    position: absolute;
    top: -8px;
    right: 50%;
    transform: translateX(50%);
    padding: 2px 10px;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* Company Info Section */
.company-info-section {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.company-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.label-badge.optional {
    background: var(--bg-quaternary);
    color: var(--text-tertiary);
    font-size: 0.7rem;
}

@media (max-width: 768px) {
    .company-fields {
        grid-template-columns: 1fr;
    }
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

/* Select Wrapper */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 1rem 2.5rem 1rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    appearance: none;
}

.select-wrapper select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.select-arrow {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    font-size: 0.8rem;
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: var(--spacing-md);
}

.language-option {
    flex: 1;
    cursor: pointer;
}

.language-option input {
    position: absolute;
    opacity: 0;
}

.language-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.language-option input:checked+.language-content {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.language-flag {
    font-size: 1.5rem;
}

.language-name {
    font-weight: 600;
}

/* Advanced Section */
.advanced-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-lg);
}

.advanced-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    transition: color var(--transition-fast);
    width: 100%;
}

.advanced-toggle:hover {
    color: var(--text-primary);
}

.toggle-arrow {
    margin-right: auto;
    transition: transform var(--transition-normal);
}

.advanced-toggle.active .toggle-arrow {
    transform: rotate(180deg);
}

.advanced-options {
    display: none;
    padding-top: var(--spacing-lg);
    animation: slideDown 0.3s ease;
}

.advanced-options.visible {
    display: block;
}

.options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.option-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.85rem;
}

.option-chip input {
    display: none;
}

.option-chip.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.option-chip.featured.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--success);
    color: var(--success);
}

/* Option Section */
.option-section {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.option-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.option-section-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Creativity Slider */
.creativity-slider-container {
    padding: 0 var(--spacing-sm);
}

.creativity-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to left, var(--accent-primary), var(--accent-tertiary));
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.creativity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--bg-secondary);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.creativity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.creativity-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--bg-secondary);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-sm);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.slider-labels span:nth-child(2) {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1rem;
}

/* Intent Options */
.intent-options,
.audience-options {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.intent-option,
.audience-option {
    flex: 1;
    min-width: 100px;
    cursor: pointer;
}

.intent-option input,
.audience-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.intent-content,
.audience-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    text-align: center;
}

.intent-option:hover .intent-content,
.audience-option:hover .audience-content {
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.intent-option input:checked+.intent-content,
.audience-option input:checked+.audience-content {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.intent-icon,
.audience-icon {
    font-size: 1.5rem;
}

.intent-name,
.audience-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.intent-option input:checked+.intent-content .intent-name,
.audience-option input:checked+.audience-content .audience-name {
    color: var(--accent-primary);
}

/* FAQ Count Slider */
.faq-count-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.faq-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.faq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.faq-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
}

.faq-count-value {
    min-width: 70px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--accent-gradient);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: var(--radius-full);
    text-align: center;
}

/* Generate Button - Premium */
.btn-generate {
    position: relative;
    padding: 1.2rem 2rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(79, 70, 229, 0.45);
    background: var(--accent-gradient-hover);
}

.btn-generate:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.btn-generate.loading .btn-content {
    display: none;
}

.btn-generate.loading .btn-loading {
    display: flex;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }
}

.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Live Writing Section */
.live-writing-section {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--accent-primary);
    font-weight: 600;
}

.live-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: livePulse 1s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
}

.live-stats {
    display: flex;
    gap: var(--spacing-lg);
}

.live-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.live-progress {
    margin-bottom: var(--spacing-lg);
}

.progress-track {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.step.active {
    color: var(--accent-primary);
}

.step.completed {
    color: var(--success);
}

.step-icon {
    font-size: 1.2rem;
}

.live-content {
    min-height: 200px;
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    line-height: 1.8;
    position: relative;
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--accent-primary);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Output Section */
.output-section {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.output-title {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.output-badges {
    display: flex;
    gap: var(--spacing-sm);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-pill.human {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-pill.seo {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.output-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.btn-action {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-action:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.btn-action.highlight {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

/* SEO Panel */
.seo-panel {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.seo-score-ring {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.seo-score-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.score-bg {
    fill: none;
    stroke: var(--bg-card);
    stroke-width: 8;
}

.score-progress {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: 264;
    transition: stroke-dashoffset 1s ease;
}

.score-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.score-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.seo-metrics {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.metric {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.metric-name {
    color: var(--text-secondary);
}

.metric-value {
    color: var(--text-primary);
    font-weight: 600;
}

.metric-bar {
    height: 6px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.metric-fill.green {
    background: var(--success);
}

.metric-fill.blue {
    background: var(--info);
}

/* Article Stats */
.article-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.stat-item .stat-icon {
    font-size: 1.5rem;
}

.stat-item .stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-item .stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* SEO Recommendations */
.seo-recommendations {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.recommendations-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.recommendations-header h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.recommendation-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.recommendation-item.pass {
    border-right: 4px solid var(--success);
}

.recommendation-item.fail {
    border-right: 4px solid var(--error);
}

.recommendation-status {
    font-size: 1.2rem;
}

.recommendation-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.recommendation-item.fail .recommendation-text {
    color: var(--text-primary);
}

.btn-fix {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-fix:hover {
    background: var(--accent-primary);
    color: white;
}

.empty-recommendations {
    text-align: center;
    padding: var(--spacing-md);
    color: var(--text-tertiary);
    font-style: italic;
}

/* Advanced SEO Recommendation Enhancements */
.recommendation-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recommendation-content .recommendation-text {
    flex: unset;
}

.priority-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    width: fit-content;
}

.recommendation-item.high.fail {
    border-right-width: 4px;
    background: linear-gradient(90deg, var(--bg-secondary), rgba(239, 68, 68, 0.05));
}

.seo-summary {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(34, 197, 94, 0.08));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-md);
}

.seo-summary-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.seo-summary-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--success));
    border-radius: var(--radius-full);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.seo-summary-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-primary);
    white-space: nowrap;
}

/* Meta Cards */
.meta-cards {
    display: grid;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.meta-card {
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.meta-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    font-size: 0.85rem;
}

.meta-label {
    font-weight: 600;
}

.meta-count {
    margin-right: auto;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.meta-value {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.meta-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.meta-keywords span {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--accent-primary);
}

/* Article Wrapper */
.article-wrapper {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.article-toolbar {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.toolbar-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.toolbar-btn.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.15);
}

.article-output {
    padding: var(--spacing-xl);
    max-height: 600px;
    overflow-y: auto;
    line-height: 1.9;
}

.article-output h1 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.article-output h2 {
    font-size: 1.4rem;
    margin: var(--spacing-xl) 0 var(--spacing-md);
    color: var(--text-primary);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--accent-primary);
}

.article-output h3 {
    font-size: 1.2rem;
    margin: var(--spacing-lg) 0 var(--spacing-md);
    color: var(--text-primary);
}

.article-output p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.article-output ul,
.article-output ol {
    margin: var(--spacing-md) 0;
    padding-right: var(--spacing-xl);
}

.article-output li {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.article-output blockquote {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border-right: 4px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    font-style: italic;
}

.code-block {
    padding: var(--spacing-lg);
    max-height: 600px;
    overflow: auto;
}

.code-block code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

.text-output {
    padding: var(--spacing-xl);
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    position: relative;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
}

.btn-icon .badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--accent-primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-sm {
    width: 400px;
}

.modal-lg {
    width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.2rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
    max-height: 70vh;
    overflow-y: auto;
}

/* Download Options */
.download-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.download-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.download-option:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.download-icon {
    font-size: 2rem;
}

.download-name {
    font-weight: 700;
    color: var(--text-primary);
}

.download-desc {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.history-info h4 {
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
}

.history-meta {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.history-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-tertiary);
}

.empty-icon {
    display: block;
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

/* Toast */
.toast {
    position: fixed;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    opacity: 0;
    transition: all var(--transition-normal);
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: var(--error);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-logo {
    font-size: 1.3rem;
    font-weight: 800;
}

.footer-brand p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.footer-stats {
    display: flex;
    gap: var(--spacing-xl);
}

.footer-stat {
    text-align: center;
}

.footer-stat .stat-number {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.footer-stat .stat-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-stats {
        gap: var(--spacing-lg);
    }

    .word-count-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .article-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .seo-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .seo-score-ring {
        align-self: center;
    }

    .download-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .word-count-cards {
        grid-template-columns: 1fr;
    }

    .language-selector {
        flex-direction: column;
    }
}

/* ===================================
   Live Writing Section - Enhanced
   =================================== */
#liveWritingSection {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.05));
    border: 2px solid var(--accent-primary);
    box-shadow: var(--shadow-glow);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-xl);
}

.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    color: var(--accent-primary);
}

.live-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
        transform: scale(1.1);
    }
}

.live-stats {
    display: flex;
    gap: var(--spacing-xl);
}

.live-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-icon {
    font-size: 1.1rem;
}

.live-progress {
    margin-bottom: var(--spacing-lg);
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.8rem;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.progress-step.active {
    color: var(--accent-primary);
    font-weight: 600;
}

.progress-step.completed {
    color: var(--success);
}

.step-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.progress-step.active .step-icon {
    background: var(--accent-primary);
    color: white;
}

.progress-step.completed .step-icon {
    background: var(--success);
    color: white;
}

#liveContent {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.8;
    direction: rtl;
}

#liveContent h1,
#liveContent h2,
#liveContent h3 {
    color: var(--text-primary);
    margin: var(--spacing-lg) 0 var(--spacing-md);
}

#liveContent h1 {
    font-size: 1.6rem;
}

#liveContent h2 {
    font-size: 1.3rem;
    color: var(--accent-primary);
}

#liveContent h3 {
    font-size: 1.1rem;
}

#liveContent p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

#liveContent ul,
#liveContent ol {
    margin: var(--spacing-md) var(--spacing-lg);
    color: var(--text-secondary);
}

#liveContent li {
    margin-bottom: var(--spacing-sm);
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background: var(--accent-primary);
    margin-right: 2px;
    animation: blink 0.8s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ===================================
   Keywords Section - Professional
   =================================== */
.keywords-section {
    position: relative;
}

.keywords-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.keywords-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.keywords-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-md);
    font-size: 1.2rem;
    background: var(--bg-card);
    color: var(--text-tertiary);
}

.keywords-input {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
}

.keywords-input:focus {
    outline: none;
}

.keywords-input::placeholder {
    color: var(--text-muted);
}

.btn-magic-generate {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    white-space: nowrap;
}

.btn-magic-generate:hover {
    filter: brightness(1.1);
}

.btn-magic-generate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-magic-generate .magic-sparkle {
    font-size: 1.1rem;
}

.suggested-keywords {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    display: none;
}

.suggested-keywords.visible {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.keywords-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.keywords-header-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    color: var(--accent-primary);
}

.keywords-header-title .icon {
    font-size: 1.1rem;
}

.keywords-count {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
}

.keywords-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.keyword-tag:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.keyword-tag.selected {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.keyword-tag .tag-icon {
    font-size: 0.9rem;
}

.keyword-tag.selected .tag-icon::before {
    content: "✓";
}

.keywords-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.btn-add-all {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--success);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-add-all:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Scrollbar for Live Content */
#liveContent::-webkit-scrollbar {
    width: 6px;
}

#liveContent::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

#liveContent::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

#liveContent::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* ===================================
   Article Content Styles (Generated)
   =================================== */

/* Table of Contents */
.article-output .table-of-contents,
#liveContent .table-of-contents,
#articleOutput .table-of-contents {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.table-of-contents h2 {
    font-size: 1.1rem !important;
    color: var(--accent-primary) !important;
    margin-bottom: var(--spacing-md) !important;
}

.table-of-contents ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.table-of-contents li {
    margin-bottom: var(--spacing-sm) !important;
}

.table-of-contents a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.table-of-contents a::before {
    content: "→";
    color: var(--accent-primary);
}

.table-of-contents a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    padding-right: var(--spacing-md);
}

/* Article Images */
.article-output .article-image,
#liveContent .article-image,
#articleOutput .article-image,
.article-output figure,
#liveContent figure,
#articleOutput figure {
    margin: var(--spacing-xl) 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.article-image img,
figure img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.article-image figcaption,
figure figcaption {
    padding: var(--spacing-md);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    background: var(--bg-quaternary);
    border-top: 1px solid var(--border-color);
}

/* External Links */
.article-output a[target="_blank"],
#liveContent a[target="_blank"],
#articleOutput a[target="_blank"],
.external-link {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-primary);
    transition: all var(--transition-fast);
}

.article-output a[target="_blank"]:hover,
#liveContent a[target="_blank"]:hover,
#articleOutput a[target="_blank"]:hover,
.external-link:hover {
    color: var(--accent-secondary);
    border-bottom-style: solid;
}

.article-output a[target="_blank"]::after,
#articleOutput a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.75em;
    opacity: 0.7;
}

/* Meta Description */
.article-output .meta-description,
#liveContent .meta-description,
#articleOutput .meta-description {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    font-style: italic;
    color: var(--text-secondary);
    position: relative;
}

.meta-description::before {
    content: "📝 وصف SEO";
    position: absolute;
    top: -10px;
    right: var(--spacing-md);
    background: var(--bg-secondary);
    padding: 0 var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
    font-style: normal;
}

/* Blockquotes */
.article-output blockquote,
#liveContent blockquote,
#articleOutput blockquote {
    border-right: 4px solid var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
    padding: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Tables */
.article-output table,
#liveContent table,
#articleOutput table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-xl) 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.article-output th,
#liveContent th,
#articleOutput th {
    background: var(--accent-gradient);
    color: white;
    padding: var(--spacing-md);
    text-align: right;
    font-weight: 600;
}

.article-output td,
#liveContent td,
#articleOutput td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.article-output tr:hover,
#liveContent tr:hover,
#articleOutput tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* ===================================
   التحسينات الاحترافية - V2
   =================================== */

/* ===== Hero Section Enhanced ===== */
.hero {
    position: relative;
    padding: var(--spacing-2xl) 0;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.2);
    }
}

.hero-badge {
    animation: badgeFloat 3s ease-in-out infinite;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.4);
    backdrop-filter: blur(10px);
}

@keyframes badgeFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899, #6366f1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.tagline {
    font-size: 1.15rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: var(--spacing-xl);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-2xl);
    margin-top: var(--spacing-lg);
}

.hero-stat {
    position: relative;
    padding: var(--spacing-md) var(--spacing-xl);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.hero-stat:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.hero-stat .stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    line-height: 1.2;
}

.hero-stat .stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== Live Writing Enhanced Stages ===== */
.live-stages {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.stage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--border-color);
    transition: all 0.4s ease;
}

.stage.active {
    border-color: var(--accent-primary);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.stage.active::before {
    background: var(--accent-gradient);
    animation: stageProgress 2s linear infinite;
}

@keyframes stageProgress {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.stage.completed {
    border-color: var(--success);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
}

.stage.completed::before {
    background: var(--success);
}

.stage-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--bg-card);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.stage.active .stage-icon {
    background: var(--accent-gradient);
    transform: scale(1.1);
    animation: iconPulse 1s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

.stage.completed .stage-icon {
    background: var(--success);
}

.stage-info {
    text-align: center;
}

.stage-title {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.stage-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.stage.active .stage-title {
    color: var(--accent-primary);
}

.stage.completed .stage-title {
    color: var(--success);
}

.stage-status {
    margin-top: var(--spacing-sm);
}

.status-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stage.active .status-spinner {
    opacity: 1;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.stage.completed .status-spinner {
    border-color: var(--success);
    background: var(--success);
}

.stage.completed .status-spinner::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ===== Live Progress Enhanced ===== */
.live-progress {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
}

.progress-track {
    flex: 1;
    height: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
    background-size: 200% 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    animation: progressShimmer 2s linear infinite;
    position: relative;
}

@keyframes progressShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    animation: progressGlow 1.5s ease-in-out infinite;
}

@keyframes progressGlow {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.progress-percent {
    min-width: 50px;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--accent-gradient);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: var(--radius-full);
    text-align: center;
}

/* ===== Live Content Enhanced ===== */
.live-content {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding: var(--spacing-xl);
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    line-height: 2;
    position: relative;
}

.live-content::-webkit-scrollbar {
    width: 6px;
}

.live-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

.live-content::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: var(--radius-full);
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.3em;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: cursorBlink 0.8s step-end infinite;
    vertical-align: text-bottom;
    margin-right: 2px;
    box-shadow: 0 0 10px var(--accent-primary);
}

@keyframes cursorBlink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ===== Enhanced Buttons ===== */
.btn-generate {
    position: relative;
    padding: 1.3rem 2.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.15rem;
    font-weight: 800;
    color: white;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-generate:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-generate:active {
    transform: translateY(0) scale(0.98);
}

.btn-generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-generate:hover::before {
    left: 100%;
}

/* ===== Enhanced Word Count Cards ===== */
.word-count-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.word-count-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.word-count-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.word-count-card:hover .card-content {
    border-color: var(--border-color-hover);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.word-count-card.active .card-content,
.word-count-card input:checked+.card-content {
    border-color: var(--accent-primary);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.word-count-card.recommended .card-content {
    border-color: rgba(168, 85, 247, 0.5);
}

.recommended-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    left: -1px;
    padding: var(--spacing-xs);
    background: var(--accent-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-icon-wrap {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.word-count-card.active .card-icon-wrap,
.word-count-card input:checked+.card-content .card-icon-wrap {
    background: var(--accent-gradient);
    transform: scale(1.1);
}

.card-icon {
    font-size: 1.5rem;
}

.card-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.card-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-card);
    border-radius: var(--radius-full);
}

/* ===== Enhanced Input Section ===== */
.input-section {
    position: relative;
    overflow: hidden;
}

.input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
}

/* ===== Enhanced Output Section ===== */
.output-section {
    position: relative;
    overflow: hidden;
}

.output-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--success), #22d3ee);
}

/* ===== Responsive Enhancements ===== */
@media (max-width: 768px) {
    .live-stages {
        grid-template-columns: repeat(2, 1fr);
    }

    .word-count-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }

    .hero-stat {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .hero-stat .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .live-stages {
        grid-template-columns: 1fr 1fr;
    }

    .stage {
        padding: var(--spacing-md);
    }

    .stage-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .stage-desc {
        display: none;
    }
}

/* ===================================
   التحسينات الاحترافية - V3
   Input, Output, Actions, SEO Panel
   =================================== */

/* ===== Enhanced Floating Label Inputs ===== */
.floating-label .input-container {
    position: relative;
    transition: all 0.3s ease;
}

.floating-label input {
    width: 100%;
    padding: 1.4rem 1.2rem 0.8rem 3.5rem;
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1.05rem;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.floating-label input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.floating-label input:focus+label {
    color: var(--accent-primary);
    transform: translateY(0) scale(0.85);
}

.input-icon-left {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    z-index: 1;
    transition: all 0.3s ease;
}

.floating-label input:focus~.input-icon-left {
    transform: translateY(-50%) scale(1.1);
}

/* ===== Enhanced Keywords Section ===== */
.keywords-section {
    position: relative;
}

.keywords-input-wrapper.enhanced {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.keywords-input-wrapper.enhanced:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.btn-magic-generate {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    margin: 0.5rem;
    white-space: nowrap;
}

.btn-magic-generate:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

.btn-magic-generate:active {
    transform: scale(0.98);
}

.btn-magic-generate.loading {
    opacity: 0.8;
    pointer-events: none;
}

.btn-magic-generate.loading .magic-sparkle,
.btn-magic-generate.loading .magic-text {
    display: none;
}

.btn-magic-generate.loading .magic-loading {
    display: flex !important;
}

.magic-sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
    }
}

/* ===== Quick Tags Enhanced ===== */
.quick-keywords {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.2);
    flex-wrap: wrap;
}

.quick-tag {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.3s ease;
}

.quick-tag:hover::before {
    left: 100%;
}

.quick-tag:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.quick-tag.active {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ===== Selected Keywords Enhanced ===== */
.selected-keywords-display {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--success);
}

.btn-clear-all {
    padding: 0.4rem 1rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-full);
    color: var(--error);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-clear-all:hover {
    background: var(--error);
    color: white;
    transform: scale(1.05);
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--success);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    animation: tagPop 0.2s ease;
}

@keyframes tagPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.selected-tag .remove-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selected-tag .remove-tag:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* ===== Enhanced Output Section ===== */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.output-badges {
    display: flex;
    gap: var(--spacing-sm);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.badge-pill:hover {
    transform: translateY(-2px) scale(1.05);
}

.badge-pill.human {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.15));
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

.badge-pill.seo {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.4);
}

/* ===== Enhanced Action Buttons ===== */
.output-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.4s ease;
}

.btn-action:hover::before {
    left: 100%;
}

.btn-action:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-action.highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--warning);
}

.btn-action.highlight:hover {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

/* ===== Enhanced SEO Panel ===== */
.seo-panel {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-xl);
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.seo-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
}

.seo-score-ring {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.seo-score-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 10px rgba(99, 102, 241, 0.3));
}

.score-bg {
    fill: none;
    stroke: var(--bg-card);
    stroke-width: 10;
}

.score-progress {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: 264;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: scoreCount 1.5s ease-out;
}

@keyframes scoreCount {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.score-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.seo-metrics {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.metric {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.metric-name {
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    color: var(--text-primary);
    font-weight: 700;
}

.metric-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: var(--radius-full);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.metric-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    animation: metricGlow 1.5s ease-in-out infinite;
}

@keyframes metricGlow {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

.metric-fill.green {
    background: linear-gradient(90deg, var(--success), #10b981);
}

.metric-fill.blue {
    background: linear-gradient(90deg, var(--info), #06b6d4);
}

/* ===== Enhanced Article Stats ===== */
.article-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.stat-item .stat-icon {
    font-size: 1.8rem;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.stat-item .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ===== Enhanced Meta Cards ===== */
.meta-cards {
    display: grid;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.meta-card {
    padding: var(--spacing-lg);
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.meta-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.1);
}

.meta-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
}

.meta-icon {
    font-size: 1.2rem;
}

.meta-label {
    font-weight: 700;
    color: var(--text-primary);
}

.meta-count {
    margin-right: auto;
    padding: 0.2rem 0.6rem;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
}

.meta-value {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ===== Enhanced Article Wrapper ===== */
.article-wrapper {
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.article-toolbar {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.toolbar-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
    border-color: var(--border-color);
}

.toolbar-btn.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ===== Enhanced Toast ===== */
.toast {
    position: fixed;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--success);
    box-shadow: 0 15px 40px rgba(34, 197, 94, 0.2);
}

.toast.error {
    border-color: var(--error);
    box-shadow: 0 15px 40px rgba(239, 68, 68, 0.2);
}

.toast.warning {
    border-color: var(--warning);
    box-shadow: 0 15px 40px rgba(245, 158, 11, 0.2);
}

.toast.info {
    border-color: var(--accent-primary);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.2);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    background: var(--toast-color, var(--success));
    animation: toastProgress 4s linear forwards;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* ===== Smooth Reveal Animation ===== */
@keyframes smoothReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Ripple Expand Keyframe ===== */
@keyframes rippleExpand {
    from {
        transform: scale(0);
        opacity: 0.6;
    }

    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== Company Info Section Enhanced ===== */
.company-info-section {
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(168, 85, 247, 0.05));
    border: 1px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
}

.company-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.label-badge.optional {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
}

/* ===== Enhanced Modals ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(180deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

/* ===== Enhanced Download Options ===== */
.download-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.download-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xl);
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.download-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.download-option:hover::before {
    transform: scaleX(1);
}

.download-option:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.2);
}

.download-icon {
    font-size: 2.5rem;
    animation: downloadBounce 2s ease-in-out infinite;
}

@keyframes downloadBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.download-name {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.download-desc {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-tertiary);
}

/* ===== Additional Responsive ===== */
@media (max-width: 768px) {
    .company-fields {
        grid-template-columns: 1fr;
    }

    .article-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .seo-panel {
        flex-direction: column;
        text-align: center;
    }

    .download-options {
        grid-template-columns: 1fr;
    }

    .output-header {
        flex-direction: column;
        align-items: stretch;
    }

    .output-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .article-stats {
        grid-template-columns: 1fr;
    }

    .stat-item {
        justify-content: center;
        text-align: center;
        flex-direction: column;
    }
}

/* ===================================
   التحسينات المتقدمة - V4
   Loading, 3D, Confetti, Neon, Glass
   =================================== */

/* ===== Loading Skeleton ===== */
.skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin: 0.5em 0;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-paragraph {
    height: 4em;
    margin: 0.5em 0;
}

.skeleton-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.skeleton-card {
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
}

/* ===== 3D Card Effect ===== */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card-3d-inner {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-3d:hover .card-3d-inner {
    transform: rotateY(5deg) rotateX(5deg);
}

/* 3D Tilt on Mouse Move - for JS */
.tilt-card {
    transition: transform 0.1s ease;
    transform-style: preserve-3d;
}

.tilt-card .tilt-content {
    transform: translateZ(30px);
}

/* ===== Neon Glow Effects ===== */
.neon-glow {
    position: relative;
}

.neon-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.3),
        0 0 40px rgba(99, 102, 241, 0.2),
        0 0 60px rgba(99, 102, 241, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.neon-glow:hover::after {
    opacity: 1;
}

.neon-text {
    text-shadow:
        0 0 10px rgba(99, 102, 241, 0.8),
        0 0 20px rgba(99, 102, 241, 0.6),
        0 0 40px rgba(99, 102, 241, 0.4);
}

.neon-border {
    box-shadow:
        0 0 0 1px rgba(99, 102, 241, 0.5),
        0 0 20px rgba(99, 102, 241, 0.3),
        inset 0 0 20px rgba(99, 102, 241, 0.05);
}

/* ===== Enhanced Glassmorphism ===== */
.glass-ultra {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1),
            rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.glass-dark {
    background: linear-gradient(135deg,
            rgba(15, 23, 42, 0.9),
            rgba(30, 41, 59, 0.8));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== Confetti Container ===== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-100vh) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* ===== Success Celebration ===== */
.celebrate-burst {
    position: relative;
}

.celebrate-burst::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: burstExpand 0.6s ease-out;
}

@keyframes burstExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

/* ===== Animated Background Particles Enhanced ===== */
.particle-system {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: floatParticle 20s infinite linear;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
    }

    100% {
        transform: translateY(-100vh) translateX(50px) rotate(360deg);
    }
}

/* ===== Typing Animation ===== */
.type-writer {
    overflow: hidden;
    border-right: 3px solid var(--accent-primary);
    white-space: nowrap;
    animation:
        typing 3s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--accent-primary);
    }
}

/* ===== Ripple Effect ===== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.ripple:active::after {
    transform: scale(0, 0);
    opacity: 1;
    transition: 0s;
}

/* ===== Pulse Ring Animation ===== */
.pulse-ring {
    position: relative;
}

.pulse-ring::before,
.pulse-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    border: 2px solid var(--accent-primary);
    transform: translate(-50%, -50%);
    animation: pulseRing 2s ease-out infinite;
}

.pulse-ring::after {
    animation-delay: 1s;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* ===== Counter Animation ===== */
.counter-animate {
    display: inline-block;
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Gradient Border Animation ===== */
.gradient-border {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: linear-gradient(45deg, #6366f1, #a855f7, #ec4899, #6366f1);
    background-size: 400% 400%;
    animation: gradientBorderMove 3s ease infinite;
    z-index: -1;
}

@keyframes gradientBorderMove {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ===== Hover Lift Effect ===== */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(99, 102, 241, 0.15);
}

/* ===== Shine Effect ===== */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    animation: shineMove 3s infinite;
}

@keyframes shineMove {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

/* ===== Morphing Button ===== */
.btn-morph {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-morph:hover {
    border-radius: 50px;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* ===== Stagger Animation ===== */
.stagger-animate>* {
    opacity: 0;
    animation: staggerFadeIn 0.5s ease forwards;
}

.stagger-animate>*:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-animate>*:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-animate>*:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-animate>*:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-animate>*:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-animate>*:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Magnetic Button Effect ===== */
.magnetic-wrap {
    position: relative;
    display: inline-block;
}

.magnetic-area {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 1;
}

/* ===== Focus Ring Animated ===== */
.focus-ring-animated:focus {
    outline: none;
    box-shadow:
        0 0 0 3px var(--bg-primary),
        0 0 0 6px var(--accent-primary);
    animation: focusRingPulse 1s ease-in-out infinite;
}

@keyframes focusRingPulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px var(--bg-primary), 0 0 0 6px var(--accent-primary);
    }

    50% {
        box-shadow: 0 0 0 5px var(--bg-primary), 0 0 0 10px rgba(99, 102, 241, 0.3);
    }
}

/* ===== Tooltip Enhanced ===== */
.tooltip-pro {
    position: relative;
}

.tooltip-pro::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.tooltip-pro::after {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--bg-secondary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tooltip-pro:hover::before,
.tooltip-pro:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ===== Loading Dots ===== */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: loadingDotsBounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loadingDotsBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== Success Checkmark ===== */
.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: var(--success);
    stroke-miterlimit: 10;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.4);
    animation: successCircle 0.6s ease-in-out;
}

.success-checkmark .checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: successStroke 0.6s ease-in-out forwards;
}

.success-checkmark .checkmark-check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: successStroke 0.3s 0.6s ease-in-out forwards;
}

@keyframes successStroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes successCircle {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    100% {
        box-shadow: 0 0 0 20px rgba(34, 197, 94, 0);
    }
}

/* ===== Floating Action Button ===== */
.fab {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    border: none;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

/* ===== Enhanced Form Validation ===== */
.input-valid {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2) !important;
}

.input-invalid {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
    animation: inputShake 0.4s ease;
}

@keyframes inputShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.validation-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    animation: slideIn 0.3s ease;
}

.validation-message.success {
    color: var(--success);
}

.validation-message.error {
    color: var(--error);
}

/* ===== Smooth Page Transitions ===== */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease;
}

.page-transition-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s ease;
}

/* ===== WXR Download Option ===== */
.download-option.wxr-option {
    position: relative;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.download-option.wxr-option:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.2));
    border-color: var(--success);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}

.download-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.6);
    }
}

/* ===================================
   Magic Toolbar & Image Regeneration
   =================================== */

/* Floating Magic Toolbar */
.magic-toolbar {
    position: absolute;
    display: none;
    /* Hidden by default */
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 1000;
    gap: 8px;
    align-items: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.magic-toolbar.visible {
    display: flex;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.magic-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.magic-btn.warning:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.magic-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 4px;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Image Regeneration Overlay */
.article-image {
    position: relative;
    display: inline-block;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.article-image:hover .btn-regenerate-img {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.btn-regenerate-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--accent-primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.btn-regenerate-img:hover {
    background: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-regenerate-img.loading {
    opacity: 1;
    cursor: wait;
}

.btn-regenerate-img .refresh-icon {
    font-size: 1.2rem;
    transition: transform 0.5s ease;
}

.btn-regenerate-img:hover .refresh-icon {
    transform: rotate(180deg);
}

/* Download PDF Option */
.download-option[data-format="pdf"] {
    border-color: #ef4444;
    /* Red for PDF */
}

.download-option[data-format="pdf"]:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ===================================
   New Professional Features & Checkboxes
   =================================== */
.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
    margin-top: var(--spacing-xl);
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.feature-icon {
    font-size: 1.8rem;
    min-width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
}

.feature-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.feature-text h3 .gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Visual Selection Grid (For Article Types) */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.selection-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    min-height: 110px;
    position: relative;
    overflow: hidden;
}

.selection-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.selection-card.active {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.05);
    /* Indigo tint */
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.selection-card.active::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--accent-primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selection-card .card-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
    transition: transform var(--transition-fast);
}


/* SEO Tools Styles */
.toolbar-btn.highlight-seo {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.1));
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.toolbar-btn.highlight-seo:hover,
.toolbar-btn.highlight-seo.active {
    background: var(--success);
    color: white;
    border-color: var(--success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.seo-tools-output {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.seo-tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.seo-tool-card h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Google Preview Simulator */
.google-preview-box {
    background: #ffffff;
    /* Always white for Google */
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #dfe1e5;
    font-family: Arial, sans-serif;
    max-width: 650px;
}

[data-theme="dark"] .google-preview-box {
    background: #202124;
    border-color: #3c4043;
}

.google-result {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.google-url-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #202124;
}

[data-theme="dark"] .google-url-line {
    color: #bdc1c6;
}

.google-cite {
    font-style: normal;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .google-cite {
    color: #bdc1c6;
}

.google-title {
    color: #1a0dab;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    margin: 0;
}

.google-title:hover {
    text-decoration: underline;
}

[data-theme="dark"] .google-title {
    color: #8ab4f8;
}

.google-desc {
    color: #4d5156;
    font-size: 14px;
    line-height: 1.58;
}

[data-theme="dark"] .google-desc {
    color: #bdc1c6;
}

/* Schema Generator */
.schema-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    position: relative;
    max-height: 300px;
    overflow-y: auto;
}

.btn-copy-small {
    padding: 4px 10px;
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-small:hover {
    background: var(--accent-primary);
    color: white;
}

.selection-card .card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Enhanced Writing Style Chips */
.style-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.style-chip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.style-chip:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.style-chip.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Light Theme Specific Overrides for Glass */
:root:not([data-theme='dark']) .glass-card {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

:root:not([data-theme='dark']) .glass-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
}

:root:not([data-theme='dark']) .static-bg {
    background:
        radial-gradient(ellipse 70% 50% at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 85% 15%, rgba(219, 39, 119, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 40% 50% at 50% 85%, rgba(124, 58, 237, 0.04) 0%, transparent 50%);
    background-color: #fafbff;
}

/* Features Section */
.features-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.feature-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: var(--radius-md);
}

.feature-text h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.feature-text p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .features-section {
        grid-template-columns: 1fr;
    }
}