/* Article Writer CSS - Step-by-step article creation interface */

/* Article Writer Container */
.article-writer-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: var(--space-6);
    min-height: calc(100vh - 80px);
}

/* App Title with Subtitle */
.app-subtitle {
    font-size: var(--text-sm);
    font-weight: var(--font-normal);
    color: var(--gray-500);
    margin-left: var(--space-2);
}

/* Progress Bar */
.article-progress-bar {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.step-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-weight: var(--font-medium);
    text-align: center;
    transition: color var(--transition-normal);
}

.progress-step.active .step-number {
    background: var(--orange-500);
    color: white;
    border-color: var(--orange-200);
    box-shadow: 0 0 0 4px var(--orange-50);
}

.progress-step.active .step-label {
    color: var(--orange-600);
    font-weight: var(--font-semibold);
}

.progress-step.completed .step-number {
    background: var(--success-500);
    color: white;
}

.progress-step.completed .step-label {
    color: var(--success-600);
}

.progress-line {
    height: 2px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-line-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--orange-500), var(--orange-400));
    transition: width 0.5s ease-out;
    border-radius: var(--radius-full);
}

/* Step Container */
.article-steps-container {
    background: transparent;
    overflow: hidden;
}

.article-step {
    min-height: 500px;
}

.article-step.hidden {
    display: none;
}

/* Step Content */
.step-content {
    max-width: 800px;
    margin: 0 auto;
}

.step-header {
    background: white;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
box-shadow: var(--shadow-sm);
border: 1px solid var(--gray-200);
    text-align: center;
    margin-bottom: var(--space-8);
}

.step-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-3);
}

.step-description {
    font-size: var(--text-lg);
    color: var(--gray-600);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-8);
}

.step-form {
    display: flex;
    flex-direction: column;
    background: white;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
box-shadow: var(--shadow-sm);
border: 1px solid var(--gray-200);
    gap: var(--space-8);
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.label {
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    font-size: var(--text-sm);
}

.input {
    width: 100%;
    padding: var(--space-5);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    font-size: var(--text-lg);
    background: white;
    transition: all var(--transition-normal);
    color: var(--gray-900);
    box-sizing: border-box;
}

.input.large {
    padding: var(--space-5);
    font-size: var(--text-lg);
}

.input:focus {
    outline: none;
    border-color: var(--orange-400);
    box-shadow: 0 0 0 3px rgba(238, 119, 35, 0.1);
    background: var(--orange-25);
}

.input::placeholder {
    color: var(--gray-500);
    font-style: italic;
    font-size: var(--text-sm);
}

.input-help {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.character-count {
    font-weight: var(--font-medium);
}

.input-tip {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* BYOK Status */
.byok-status {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}

.byok-status-free {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.byok-status-premium {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.status-icon {
    font-size: var(--text-lg);
}

.status-text {
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    flex: 1;
}

.status-count {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.status-upgrade {
    background: var(--orange-500);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border: none;
    cursor: pointer;
    transition: background var(--transition-normal);
}

.status-upgrade:hover {
    background: var(--orange-600);
}

/* Model Grid */
.article-model-grid {
    display: grid;
    
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.article-model-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.article-model-card:hover {
    border-color: var(--orange-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-model-card.selected {
    border-color: var(--orange-500);
    background: var(--orange-25);
    box-shadow: 0 0 0 3px var(--orange-100);
}

.model-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    position: relative;
}

.model-icon {
    font-size: var(--text-2xl);
    flex-shrink: 0;
}

.model-info {
    flex: 1;
}

.model-name {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.model-category {
    font-size: var(--text-sm);
    color: var(--orange-600);
    font-weight: var(--font-medium);
}

.model-premium-badge {
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    color: white;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    position: absolute;
    top: -8px;
    right: -8px;
}

.model-free-badge {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: white;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    position: absolute;
    top: -8px;
    right: -8px;
}

.model-details {
    margin-bottom: var(--space-4);
}

.model-details > div {
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    color: var(--gray-700);
}

.model-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.feature-tag {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.feature-tag.speed-fast {
    background: var(--success-100);
    color: var(--success-700);
}

.feature-tag.speed-medium {
    background: var(--blue-100);
    color: var(--blue-700);
}

.feature-tag.speed-slow {
    background: var(--warning-100);
    color: var(--warning-700);
}

.model-select-btn {
    width: 100%;
    background: var(--orange-500);
    color: white;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.model-select-btn:hover {
    background: var(--orange-600);
    transform: translateY(-1px);
}

.article-model-card.selected .model-select-btn {
    background: var(--success-500);
}

.article-model-card.selected .model-select-btn:hover {
    background: var(--success-600);
}

/* Article Type Grid */
.article-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.article-type-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.article-type-card:hover {
    border-color: var(--orange-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-type-card.selected {
    border-color: var(--orange-500);
    background: var(--orange-25);
    box-shadow: 0 0 0 3px var(--orange-100);
}

.type-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--space-4);
}

.type-icon {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-3);
}

.type-name {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.type-description {
    font-size: var(--text-sm);
    color: var(--gray-600);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
    text-align: center;
}

.type-details {
    margin-bottom: var(--space-4);
}

.type-details > div {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.type-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    justify-content: center;
}

.type-select-btn {
    width: 100%;
    background: var(--orange-500);
    color: white;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.type-select-btn:hover {
    background: var(--orange-600);
    transform: translateY(-1px);
}

.article-type-card.selected .type-select-btn {
    background: var(--success-500);
}

.article-type-card.selected .type-select-btn:hover {
    background: var(--success-600);
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-8);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    font-size: var(--text-base);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    background: var(--gray-400) !important;
    color: var(--gray-600) !important;
    border-color: var(--gray-400) !important;
}

.btn.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    background: var(--gray-400) !important;
    color: var(--gray-600) !important;
    border-color: var(--gray-400) !important;
}

.btn-primary:not(:disabled):not(.btn-disabled) {
    background: var(--orange-500);
    color: white;
    border-color: var(--orange-500);
}

/* Input validation feedback */
.input.valid {
    border-color: var(--success-500);
    background: var(--success-25);
}

.input.invalid {
    border-color: var(--error-500);
    background: var(--error-25);
}

/* Character counter styling */
.character-count {
    font-weight: var(--font-medium);
    transition: color var(--transition-normal);
}

.character-count.valid {
    color: var(--success-600);
}

.character-count.invalid {
    color: var(--error-600);
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--orange-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
    transform: translateY(-1px);
}

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

.btn-success:hover:not(:disabled) {
    background: var(--success-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

/* Outline Section */
.outline-container {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.outline-generation {
    text-align: center;
    padding: var(--space-8);
}

.outline-editor {
    margin-top: var(--space-6);
}

.outline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--gray-200);
}

.outline-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--gray-200);
}

/* Generation Section */
.article-generation-container {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.generation-controls {
    text-align: center;
    margin-bottom: var(--space-8);
}

.generation-note {
    display: block;
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.article-sections {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/* Final Editor */
.article-editor-container {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--gray-200);
}

.editor-stats {
    display: flex;
    gap: var(--space-4);
}

.stat-item {
    font-size: var(--text-sm);
    color: var(--gray-600);
    font-weight: var(--font-medium);
}

.editor-actions {
    display: flex;
    gap: var(--space-2);
}

.final-editor {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    min-height: 400px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .article-writer-container {
        padding: var(--space-4);
    }
    
    .progress-steps {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .progress-step {
        flex-direction: row;
        align-items: center;
        gap: var(--space-3);
        width: 100%;
    }
    
    .step-number {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .step-label {
        text-align: left;
        flex: 1;
    }
    
    .progress-line {
        display: none;
    }
    
    .article-step {
        padding: var(--space-6);
    }
    
    .step-title {
        font-size: var(--text-2xl);
    }
    
    .step-description {
        font-size: var(--text-base);
    }
    
    .article-model-grid,
    .article-type-grid {
        grid-template-columns: 1fr;
    }
    
    .step-actions {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .editor-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }
    
    .editor-stats {
        justify-content: space-between;
    }
    
    .editor-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .article-writer-container {
        padding: var(--space-3);
    }
    
    .article-progress-bar {
        padding: var(--space-4);
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: var(--text-xs);
    }
    
    .step-label {
        font-size: var(--text-xxs);
    }
    
    .step-title {
        font-size: var(--text-xl);
    }
    
    .model-card-header,
    .type-card-header {
        text-align: center;
    }
    
    .model-name,
    .type-name {
        font-size: var(--text-base);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

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

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Phase 2: Core Features CSS */

/* Outline Display */
.outline-display {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    line-height: var(--leading-relaxed);
}

.outline-display h3.outline-headline {
    color: var(--orange-600);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin: var(--space-4) 0 var(--space-3) 0;
    border-bottom: 2px solid var(--orange-100);
    padding-bottom: var(--space-2);
}

.outline-display h4.outline-section {
    color: var(--gray-800);
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    margin: var(--space-3) 0 var(--space-2) 0;
}

.outline-display h5.outline-subsection {
    color: var(--gray-700);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    margin: var(--space-2) 0 var(--space-1) 0;
}

.outline-display ul {
    margin: var(--space-2) 0;
    padding-left: var(--space-6);
}

.outline-display li.outline-point {
    margin-bottom: var(--space-1);
    color: var(--gray-700);
}

.outline-display p {
    margin: var(--space-2) 0;
    color: var(--gray-700);
}

/* Outline Editing */
.outline-editor-textarea {
    width: 100%;
    min-height: 300px;
    padding: var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    resize: vertical;
    background: var(--gray-25);
}

.outline-editor-textarea:focus {
    outline: none;
    border-color: var(--orange-500);
    background: white;
}

.outline-edit-btn {
    margin-bottom: var(--space-3);
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.outline-edit-btn:hover {
    background: var(--gray-200);
}

/* Article Sections */
.article-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
    transition: all var(--transition-normal);
}

.article-section:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
    gap: var(--space-4);
}

.section-info {
    flex: 1;
}

.section-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.section-description {
    color: var(--gray-600);
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
    line-height: var(--leading-relaxed);
}

.section-meta {
    display: flex;
    gap: var(--space-4);
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.section-target {
    font-weight: var(--font-medium);
}

.section-points {
    color: var(--gray-400);
}

.section-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-2);
    min-width: 150px;
}

.section-progress {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-align: right;
}

.status-pending {
    color: var(--gray-500);
}

.status-generating {
    color: var(--orange-600);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-complete {
    color: var(--success-600);
}

.section-generate-btn {
    background: var(--orange-500);
    color: white;
    border: none;
    white-space: nowrap;
}

.section-generate-btn:hover {
    background: var(--orange-600);
}

.section-generate-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
}

.section-regenerate-btn {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    white-space: nowrap;
}

.section-regenerate-btn:hover {
    background: var(--gray-200);
}

/* Section Content */
.section-content {
    border-top: 1px solid var(--gray-200);
    padding-top: var(--space-4);
    margin-top: var(--space-4);
}

.section-text {
    background: var(--gray-25);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

.section-text h4 {
    color: var(--gray-800);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin: var(--space-3) 0 var(--space-2) 0;
}

.section-text h5 {
    color: var(--gray-700);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    margin: var(--space-2) 0 var(--space-1) 0;
}

.section-text p {
    margin-bottom: var(--space-3);
    color: var(--gray-700);
}

.section-text ul {
    margin: var(--space-2) 0;
    padding-left: var(--space-6);
}

.section-text li {
    margin-bottom: var(--space-1);
    color: var(--gray-700);
}

.section-text strong {
    color: var(--gray-900);
    font-weight: var(--font-semibold);
}

.section-text em {
    color: var(--gray-600);
    font-style: italic;
}

/* Generation Controls */
.generation-controls {
    text-align: center;
    padding: var(--space-8);
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--space-6);
}

.generation-note {
    display: block;
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--gray-600);
    font-style: italic;
}

/* Final Editor Container */
.final-editor {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    min-height: 500px;
    overflow: hidden;
}

/* Quill Editor Customizations */
.ql-toolbar {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid var(--gray-200) !important;
    background: var(--gray-50) !important;
    padding: var(--space-3) !important;
}

.ql-container {
    border: none !important;
    font-family: var(--font-family) !important;
    font-size: var(--text-base) !important;
    line-height: var(--leading-relaxed) !important;
}

.ql-editor {
    padding: var(--space-6) !important;
    min-height: 400px !important;
}

.ql-editor h1 {
    font-size: var(--text-3xl) !important;
    font-weight: var(--font-bold) !important;
    color: var(--gray-900) !important;
    margin: var(--space-6) 0 var(--space-4) 0 !important;
    line-height: var(--leading-tight) !important;
}

.ql-editor h2 {
    font-size: var(--text-2xl) !important;
    font-weight: var(--font-semibold) !important;
    color: var(--gray-800) !important;
    margin: var(--space-5) 0 var(--space-3) 0 !important;
    line-height: var(--leading-tight) !important;
}

.ql-editor h3 {
    font-size: var(--text-xl) !important;
    font-weight: var(--font-semibold) !important;
    color: var(--gray-800) !important;
    margin: var(--space-4) 0 var(--space-2) 0 !important;
}

.ql-editor p {
    margin-bottom: var(--space-4) !important;
    color: var(--gray-700) !important;
}

.ql-editor ul, .ql-editor ol {
    margin: var(--space-3) 0 !important;
    padding-left: var(--space-6) !important;
}

.ql-editor li {
    margin-bottom: var(--space-2) !important;
    color: var(--gray-700) !important;
}

.ql-editor blockquote {
    border-left: 4px solid var(--orange-500) !important;
    padding-left: var(--space-4) !important;
    margin: var(--space-4) 0 !important;
    font-style: italic !important;
    color: var(--gray-600) !important;
    background: var(--orange-25) !important;
}

.ql-editor strong {
    color: var(--gray-900) !important;
    font-weight: var(--font-semibold) !important;
}

.ql-editor em {
    color: var(--gray-600) !important;
}

.ql-editor a {
    color: var(--orange-600) !important;
    text-decoration: none !important;
}

.ql-editor a:hover {
    color: var(--orange-700) !important;
    text-decoration: underline !important;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn.loading::after {
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-width: 1.5px;
    border-top-color: currentColor;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Success/Error States */
.article-section.success {
    border-color: var(--success-500);
    background: var(--success-25);
}

.article-section.error {
    border-color: var(--error-500);
    background: var(--error-25);
}

/* Progress Indicators */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin: var(--space-3) 0;
}

.progress-indicator .progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
}

.progress-indicator.active .progress-dot {
    background: var(--orange-500);
    animation: pulse 1.5s ease-in-out infinite;
}

.progress-indicator.complete .progress-dot {
    background: var(--success-500);
}

/* Mobile Responsiveness for Phase 2 */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .section-status {
        align-items: flex-start;
        width: 100%;
    }
    
    .generation-controls {
        padding: var(--space-6);
    }
    
    .ql-toolbar {
        padding: var(--space-2) !important;
    }
    
    .ql-editor {
        padding: var(--space-4) !important;
    }
    
    .outline-display {
        padding: var(--space-4);
    }
    
    .section-text {
        padding: var(--space-3);
    }
}

@media (max-width: 480px) {
    .article-section {
        padding: var(--space-4);
    }
    
    .section-meta {
        flex-direction: column;
        gap: var(--space-1);
    }
    
    .generation-controls {
        padding: var(--space-4);
    }
    
    .generation-controls .btn {
        width: 100%;
        padding: var(--space-4);
    }
    
    .final-editor {
        min-height: 400px;
    }
    
    .ql-editor {
        padding: var(--space-3) !important;
        min-height: 300px !important;
    }
}

/* Enhanced Button States */
.btn.success-state {
    background: var(--success-500) !important;
    color: white !important;
    border-color: var(--success-500) !important;
}

.btn.error-state {
    background: var(--error-500) !important;
    color: white !important;
    border-color: var(--error-500) !important;
}

.btn.warning-state {
    background: var(--warning-500) !important;
    color: white !important;
    border-color: var(--warning-500) !important;
}

/* Smooth Transitions */
.article-section,
.section-content,
.outline-display,
.generation-controls {
    transition: all var(--transition-normal);
}

.section-content[style*="display: block"] {
    animation: slideDown 0.3s ease-out;
}

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

/* Accessibility Improvements */
.btn:focus-visible,
.section-generate-btn:focus-visible,
.section-regenerate-btn:focus-visible {
    outline: 2px solid var(--orange-500);
    outline-offset: 2px;
}

.ql-editor:focus {
    outline: 2px solid var(--orange-500);
    outline-offset: 2px;
}

/* Print Styles for Articles */
@media print {
    .article-writer-container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .article-progress-bar,
    .step-actions,
    .generation-controls,
    .editor-toolbar,
    .ql-toolbar {
        display: none !important;
    }
    
    .final-editor,
    .ql-container,
    .ql-editor {
        border: none !important;
        background: white !important;
        box-shadow: none !important;
    }
    
    .section-text {
        background: white !important;
        border: none !important;
        padding: 0 !important;
    }
}

/* FIXED: Button state management */
.btn:disabled,
.btn.btn-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #9ca3af !important;
    color: #6b7280 !important;
    border-color: #9ca3af !important;
    transform: none !important;
}

.btn-primary:not(:disabled):not(.btn-disabled) {
    opacity: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    background: var(--orange-500) !important;
    color: white !important;
    border-color: var(--orange-500) !important;
}

/* Input validation styles */
.input.valid {
    border-color: var(--success-500) !important;
    background: var(--success-25) !important;
}

.input.invalid {
    border-color: var(--error-500) !important;
    background: var(--error-25) !important;
}

.character-count.valid {
    color: var(--success-600) !important;
}

.character-count.invalid {
    color: var(--error-600) !important;
}
.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--orange-500);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    line-height: 1;
    min-width: 16px;
    text-align: center;
}

.nav-link {
    position: relative;
}

.auto-save-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--success-600);
    margin-top: var(--space-2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auto-save-indicator.show {
    opacity: 1;
}

.auto-save-icon {
    font-size: var(--text-sm);
}

/* Model Selection Button (same as main app) */
.model-selection-section {
    margin-bottom: var(--space-6);
}

.model-select-btn {
    width: 100%;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    transition: all var(--transition-normal);
    min-height: 80px;
}

.model-select-btn:hover {
    border-color: var(--orange-300);
    background: var(--orange-25);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.model-select-btn:focus {
    outline: none;
    border-color: var(--orange-500);
    box-shadow: 0 0 0 3px var(--orange-100);
}

/* Selected Model Display */
.selected-model-display {
    background: var(--orange-25);
    border: 2px solid var(--orange-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}

.selected-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.selected-icon {
    font-size: var(--text-2xl);
    flex-shrink: 0;
}

.selected-info {
    flex: 1;
}

.selected-name {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.selected-desc {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-bottom: var(--space-1);
}

.selected-meta {
    font-size: var(--text-xs);
    color: var(--orange-600);
    font-weight: var(--font-medium);
}

.change-btn {
    background: var(--orange-500);
    color: white;
    border: none;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.change-btn:hover {
    background: var(--orange-600);
    transform: translateY(-1px);
}

/* Model Gallery Modal */
.model-gallery-modal {
    max-width: 900px;
    width: 90vw;
    max-height: 85vh;
}

.model-mode-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}

.mode-icon {
    font-size: var(--text-lg);
}

.mode-text {
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.mode-desc {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.model-mode-indicator.premium {
    background: linear-gradient(135deg, var(--orange-100), var(--orange-50));
    border: 1px solid var(--orange-200);
}

.model-mode-indicator.premium .mode-icon {
    color: var(--orange-600);
}

.model-mode-indicator.premium .mode-text {
    color: var(--orange-700);
}

.model-filters {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.filter-btn {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--gray-300);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.filter-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.filter-btn.active {
    background: var(--orange-500);
    color: white;
    border-color: var(--orange-500);
}

/* Article Model Grid */
.article-model-grid {
    display: grid;
    gap: var(--space-4);
    max-height: 50vh;
    padding: var(--space-4) var(--space-4);
}

/* Enhanced Model Cards for Articles */
.article-model-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.article-model-card:hover {
    border-color: var(--orange-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-model-card.selected {
    border-color: var(--orange-500);
    background: var(--orange-25);
    box-shadow: 0 0 0 3px var(--orange-100);
}

.article-model-card .model-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.article-model-card .model-icon {
    font-size: var(--text-xl);
    flex-shrink: 0;
}

.article-model-card .model-info {
    flex: 1;
}

.article-model-card .model-name {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.article-model-card .model-provider {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-weight: var(--font-medium);
}

.article-model-card .model-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}

.article-model-card .model-badge {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}

.model-badge.speed-fast {
    background: var(--success-100);
    color: var(--success-700);
}

.model-badge.speed-balanced {
    background: var(--blue-100);
    color: var(--blue-700);
}

.model-badge.speed-advanced {
    background: var(--purple-100);
    color: var(--purple-700);
}

.model-badge.free {
    background: var(--gray-100);
    color: var(--gray-700);
}

.model-badge.premium {
    background: var(--orange-100);
    color: var(--orange-700);
}

.article-model-card .model-description {
    font-size: var(--text-sm);
    color: var(--gray-600);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-3);
}

.article-model-card .model-select-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-model-card .select-model-btn {
    background: var(--orange-500);
    color: white;
    border: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.article-model-card .select-model-btn:hover {
    background: var(--orange-600);
    transform: translateY(-1px);
}

.article-model-card.selected .select-model-btn {
    background: var(--success-500);
}

.article-model-card .model-cost {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.user-model-count {margin: 0;}
/* Responsive Design */
@media (max-width: 768px) {
    .model-gallery-modal {
        width: 95vw;
        max-height: 90vh;
    }
    
    .article-model-grid {
        grid-template-columns: 1fr;
        max-height: 60vh;
    }
    
    .model-filters {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
}





/* Enhanced Article Writer CSS - New Features for Headlines, Keywords, and Outline Customization */

/* Enhanced Progress Bar for 8 Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    min-width: 80px;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.step-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-weight: var(--font-medium);
    text-align: center;
    transition: color var(--transition-normal);
    line-height: 1.2;
}

/* Headlines Generation Styles */
.headlines-container {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.headlines-generation {
    text-align: center;
    padding: var(--space-8);
}

.headlines-selection {
    margin-top: var(--space-6);
}

.headlines-grid {
    display: grid;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.headline-option {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.headline-option:hover {
    border-color: var(--orange-300);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.headline-option.selected {
    border-color: var(--orange-500);
    background: var(--orange-25);
    box-shadow: 0 0 0 3px var(--orange-100);
}

.headline-radio {
    margin-top: var(--space-1);
    accent-color: var(--orange-500);
}

.headline-text {
    flex: 1;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--gray-900);
    line-height: var(--leading-relaxed);
}

.headline-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* Keywords Selection Styles */
.keywords-container {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-top: var(--space-6);
}

.keywords-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.keyword-option {
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-4);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.keyword-option:hover {
    border-color: var(--orange-300);
    background: var(--orange-50);
    transform: translateY(-1px);
}

.keyword-option.selected {
    border-color: var(--orange-500);
    background: var(--orange-100);
    color: var(--orange-700);
}

.keyword-checkbox {
    accent-color: var(--orange-500);
}

.keyword-text {
    user-select: none;
}

/* Outline Variations Styles */
.outline-variations-container {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.outline-variations-selection {
    margin-top: var(--space-6);
}

.outline-variations-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-top: var(--space-4);
}

.outline-variation {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.outline-variation:hover {
    border-color: var(--orange-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.outline-variation.selected {
    border-color: var(--orange-500);
    background: var(--orange-25);
    box-shadow: 0 0 0 3px var(--orange-100);
}

.outline-variation-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.outline-variation-radio {
    accent-color: var(--orange-500);
    transform: scale(1.2);
}

.outline-variation-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    flex: 1;
}

.outline-variation-meta {
    font-size: var(--text-sm);
    color: var(--gray-500);
    background: var(--gray-100);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
}

.outline-variation-content {
    margin-left: var(--space-8);
}

.outline-variation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.outline-variation-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: var(--text-base);
    color: var(--gray-700);
}

.outline-variation-item:last-child {
    border-bottom: none;
}

.outline-variation-number {
    background: var(--orange-100);
    color: var(--orange-700);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    min-width: 24px;
    text-align: center;
}

/* Outline Customization Styles */
.outline-customization-container {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.customization-tools {
    margin-bottom: var(--space-6);
}

.customization-tools h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

.add-heading-section {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.add-heading-section .input {
    padding: var(--space-3);
}
.add-heading-section button {
    padding: var(--space-4) var(--space-8);
}
.outline-editor {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: var(--space-6);
}

.outline-help {
    background: var(--blue-25);
    border: 1px solid var(--blue-200);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-6);
}

.outline-help p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--blue-700);
}

.outline-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.outline-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transition: all var(--transition-normal);
    cursor: grab;
}

.outline-item:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.outline-item.dragging {
    opacity: 0.5;
    transform: rotate(3deg);
    box-shadow: var(--shadow-lg);
    cursor: grabbing;
}

.outline-item-drag {
    color: var(--gray-400);
    cursor: grab;
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
}

.outline-item-drag:hover {
    color: var(--gray-600);
}

.outline-item-number {
    background: var(--orange-100);
    color: var(--orange-700);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    min-width: 32px;
    text-align: center;
}

.outline-item-text {
    flex: 1;
    font-size: var(--text-base);
    color: var(--gray-900);
    font-weight: var(--font-medium);
    cursor: text;
    padding: var(--space-2) var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.outline-item-text:hover {
    background: white;
    border-color: var(--gray-200);
}

.outline-item-text:focus {
    outline: none;
    background: white;
    border-color: var(--orange-500);
    box-shadow: 0 0 0 3px var(--orange-100);
}

.outline-item-actions {
    display: flex;
    gap: var(--space-2);
}

.outline-item-btn {
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.outline-item-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.outline-item-btn.delete:hover {
    background: var(--error-50);
    border-color: var(--error-300);
    color: var(--error-700);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--gray-200);
}

.section-header h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin: 0;
}

.section-description {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

/* Loading States */
.loading-headlines,
.loading-keywords,
.loading-outlines {
    text-align: center;
    padding: var(--space-8);
    color: var(--gray-500);
    font-style: italic;
}

.loading-headlines::after,
.loading-keywords::after,
.loading-outlines::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: var(--space-2);
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--orange-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Empty States */
.empty-headlines,
.empty-keywords,
.empty-outlines {
    text-align: center;
    padding: var(--space-8);
    color: var(--gray-500);
}

.empty-headlines .empty-icon,
.empty-keywords .empty-icon,
.empty-outlines .empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
}

.empty-headlines h3,
.empty-keywords h3,
.empty-outlines h3 {
    color: var(--gray-700);
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
}

.empty-headlines p,
.empty-keywords p,
.empty-outlines p {
    color: var(--gray-500);
    font-size: var(--text-base);
}

/* Enhanced Button States */
.btn.generating {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn.generating::after {
    content: '';
    position: absolute;
    top: 50%;
    right: var(--space-3);
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Step Validation Indicators */
.step-validation {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.step-validation.valid {
    background: var(--success-25);
    border: 1px solid var(--success-200);
    color: var(--success-700);
}

.step-validation.invalid {
    background: var(--error-25);
    border: 1px solid var(--error-200);
    color: var(--error-700);
}

.step-validation.pending {
    background: var(--warning-25);
    border: 1px solid var(--warning-200);
    color: var(--warning-700);
}

.validation-icon {
    font-size: var(--text-base);
}

/* Enhanced Progress Tracking */
.generation-progress {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin: var(--space-4) 0;
}

.progress-bar {
    background: var(--gray-200);
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
    margin-bottom: var(--space-3);
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--orange-500), var(--orange-400));
    height: 100%;
    transition: width 0.3s ease;
    border-radius: var(--radius-full);
}

.progress-text {
    font-size: var(--text-sm);
    color: var(--gray-600);
    text-align: center;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .progress-steps {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .progress-step {
        flex-direction: row;
        align-items: center;
        gap: var(--space-3);
        width: 100%;
        justify-content: flex-start;
    }
    
    .step-number {
        margin-bottom: 0;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        font-size: var(--text-xs);
    }
    
    .step-label {
        text-align: left;
        flex: 1;
        font-size: var(--text-sm);
    }
    
    .progress-line {
        display: none;
    }
    
    .headlines-grid {
        grid-template-columns: 1fr;
    }
    
    .keywords-grid {
        justify-content: center;
    }
    
    .outline-variations-list {
        gap: var(--space-4);
    }
    
    .outline-variation {
        padding: var(--space-4);
    }
    
    .outline-variation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
    
    .outline-variation-content {
        margin-left: 0;
    }
    
    .add-heading-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .outline-item {
        flex-wrap: wrap;
    }
    
    .outline-item-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: var(--space-2);
    }
}

@media (max-width: 480px) {
    .article-writer-container {
        padding: var(--space-3);
    }
    
    .article-progress-bar {
        padding: var(--space-4);
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: var(--text-xs);
    }
    
    .step-label {
        font-size: var(--text-xs);
    }
    
    .headline-option {
        padding: var(--space-3);
    }
    
    .headline-text {
        font-size: var(--text-sm);
    }
    
    .keyword-option {
        padding: var(--space-1) var(--space-3);
        font-size: var(--text-xs);
    }
    
    .outline-variation {
        padding: var(--space-3);
    }
    
    .outline-variation-title {
        font-size: var(--text-base);
    }
    
    .outline-item {
        padding: var(--space-3);
    }
    
    .outline-item-number {
        min-width: 28px;
        font-size: var(--text-xs);
    }
    
    .outline-item-text {
        font-size: var(--text-sm);
    }
}

/* Animation Keyframes */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Enhanced Accessibility */
.outline-item:focus-within {
    outline: 2px solid var(--orange-500);
    outline-offset: 2px;
}

.headline-option:focus-within,
.keyword-option:focus-within,
.outline-variation:focus-within {
    outline: 2px solid var(--orange-500);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .headline-option,
    .keyword-option,
    .outline-variation,
    .outline-item {
        border-width: 3px;
    }
    
    .headline-option.selected,
    .keyword-option.selected,
    .outline-variation.selected {
        border-width: 4px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .headline-option,
    .keyword-option,
    .outline-variation,
    .outline-item {
        transition: none;
    }
    
    .fade-in-up,
    .slide-in {
        animation: none;
    }
    
    .btn.generating::after {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .article-progress-bar,
    .step-actions,
    .section-header button,
    .customization-tools,
    .outline-item-actions {
        display: none !important;
    }
    
    .outline-item {
        break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 0.5rem;
    }
    
    .headline-text,
    .outline-item-text {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Dark Mode Support (if implemented) */
@media (prefers-color-scheme: dark) {
    .theme.dark .headlines-container,
    .theme.dark .keywords-container,
    .theme.dark .outline-variations-container,
    .theme.dark .outline-customization-container {
        background: var(--gray-800);
        border-color: var(--gray-700);
    }
    
    .theme.dark .headline-option,
    .theme.dark .keyword-option,
    .theme.dark .outline-variation,
    .theme.dark .outline-item {
        background: var(--gray-700);
        border-color: var(--gray-600);
        color: var(--gray-100);
    }
    
    .theme.dark .headline-option:hover,
    .theme.dark .keyword-option:hover,
    .theme.dark .outline-variation:hover,
    .theme.dark .outline-item:hover {
        background: var(--gray-600);
        border-color: var(--gray-500);
    }
}

/* Custom Scrollbar for Better UX */
.outline-variations-list::-webkit-scrollbar,
.outline-items::-webkit-scrollbar {
    width: 8px;
}

.outline-variations-list::-webkit-scrollbar-track,
.outline-items::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

.outline-variations-list::-webkit-scrollbar-thumb,
.outline-items::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

.outline-variations-list::-webkit-scrollbar-thumb:hover,
.outline-items::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Enhanced Headlines Generation Animation */
.headlines-loading {
    text-align: center;
    padding: var(--space-8);
    background: linear-gradient(135deg, var(--orange-50), var(--blue-50));
    border-radius: var(--radius-lg);
    border: 2px solid var(--orange-200);
    margin: var(--space-4) 0;
}

.headlines-loading-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    animation: bounce 2s ease-in-out infinite;
}

.headlines-loading-text {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--orange-700);
    margin-bottom: var(--space-3);
}

.headlines-loading-subtext {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-bottom: var(--space-4);
    animation: fadeInOut 2s ease-in-out infinite;
}

.headlines-progress {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange-300);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.progress-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.progress-dot:nth-child(3) {
    animation-delay: 0.6s;
}

.progress-dot:nth-child(4) {
    animation-delay: 0.9s;
}

.ai-thinking {
    background: var(--gray-100);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--orange-500);
    font-size: var(--text-sm);
    color: var(--gray-700);
    margin-top: var(--space-4);
    position: relative;
}

.ai-thinking::before {
    content: '🤖';
    position: absolute;
    left: -2px;
    top: -8px;
    background: white;
    padding: var(--space-1);
    border-radius: 50%;
    font-size: var(--text-xs);
    animation: float 3s ease-in-out infinite;
}

.typing-animation {
    display: inline-block;
    animation: typewriter 3s steps(40) infinite;
    border-right: 2px solid var(--orange-500);
    white-space: nowrap;
    overflow: hidden;
}

/* Keyframe Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        background: var(--orange-300);
    }
    50% {
        transform: scale(1.5);
        background: var(--orange-500);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes typewriter {
    0% {
        width: 0;
    }
    50% {
        width: 100%;
    }
    100% {
        width: 0;
    }
}

/* Enhanced Button Loading */
.btn.generating-headlines {
    background: linear-gradient(45deg, var(--orange-500), var(--orange-600));
    background-size: 200% 200%;
    animation: gradient-shift 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.btn.generating-headlines::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .headlines-loading {
        padding: var(--space-6);
    }
    
    .headlines-loading-icon {
        font-size: 2rem;
    }
    
    .headlines-loading-text {
        font-size: var(--text-base);
    }
}

/* Enhanced Outline Variations Generation Animation */
.outline-variations-loading {
    text-align: center;
    padding: var(--space-8);
    background: linear-gradient(135deg, var(--purple-50), var(--indigo-50));
    border-radius: var(--radius-lg);
    border: 2px solid var(--purple-200);
    margin: var(--space-4) 0;
}

.outline-variations-loading-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    animation: outline-spin 3s ease-in-out infinite;
}

.outline-variations-loading-text {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--purple-700);
    margin-bottom: var(--space-3);
}

.outline-variations-loading-subtext {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-bottom: var(--space-4);
    animation: fadeInOut 2s ease-in-out infinite;
}

.outline-variations-progress {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.outline-variations-progress .progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--purple-300);
    animation: pulse-outline 1.8s ease-in-out infinite;
}

.outline-variations-progress .progress-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.outline-variations-progress .progress-dot:nth-child(3) {
    animation-delay: 0.6s;
}

.outline-variations-progress .progress-dot:nth-child(4) {
    animation-delay: 0.9s;
}

.outline-variations-progress .progress-dot:nth-child(5) {
    animation-delay: 1.2s;
}

.outline-variations-progress .progress-dot:nth-child(6) {
    animation-delay: 1.5s;
}

.outline-ai-thinking {
    background: var(--purple-50);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--purple-500);
    font-size: var(--text-sm);
    color: var(--gray-700);
    margin-top: var(--space-4);
    position: relative;
}

.outline-ai-thinking::before {
    content: '📋';
    position: absolute;
    left: -2px;
    top: -8px;
    background: white;
    padding: var(--space-1);
    border-radius: 50%;
    font-size: var(--text-xs);
    animation: float 2.5s ease-in-out infinite;
}

.outline-typing-animation {
    display: inline-block;
    animation: typewriter-outline 3.5s steps(50) infinite;
    border-right: 2px solid var(--purple-500);
    white-space: nowrap;
    overflow: hidden;
}

/* Outline Success Animation */
.outline-variations-success {
    text-align: center;
    padding: var(--space-6);
    background: linear-gradient(135deg, var(--success-50), var(--purple-50));
    border-radius: var(--radius-lg);
    border: 2px solid var(--success-200);
    margin: var(--space-3) 0;
}

.outline-variations-success-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
    animation: bounce 1.2s ease-in-out;
}

.outline-variations-success-text {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--success-700);
    margin-bottom: var(--space-2);
}

.outline-variations-success-subtext {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

/* Enhanced Button Loading for Outline */
.btn.generating-outline-variations {
    background: linear-gradient(45deg, var(--purple-500), var(--purple-600));
    background-size: 200% 200%;
    animation: gradient-shift-purple 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.btn.generating-outline-variations::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

/* Structure Preview Animation */
.structure-preview {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.preview-section {
    background: var(--purple-100);
    color: var(--purple-700);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    text-align: left;
    animation: slide-in-outline 0.6s ease-out;
    opacity: 0.8;
    border-left: 3px solid var(--purple-400);
}

/* Outline Animation Keyframes */
@keyframes outline-spin {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(45deg) scale(1.1);
    }
    50% {
        transform: rotate(90deg) scale(1);
    }
    75% {
        transform: rotate(135deg) scale(1.1);
    }
}

@keyframes pulse-outline {
    0%, 100% {
        transform: scale(1);
        background: var(--purple-300);
    }
    50% {
        transform: scale(1.4);
        background: var(--purple-500);
    }
}

@keyframes typewriter-outline {
    0% {
        width: 0;
    }
    50% {
        width: 100%;
    }
    100% {
        width: 0;
    }
}

@keyframes gradient-shift-purple {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes slide-in-outline {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 0.8;
        transform: translateX(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .outline-variations-loading {
        padding: var(--space-6);
    }
    
    .outline-variations-loading-icon {
        font-size: 2rem;
    }
    
    .outline-variations-loading-text {
        font-size: var(--text-base);
    }
    
    .structure-preview {
        max-width: 100%;
    }
}
/* Countdown Status Styling */
.countdown-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    text-align: center;
}

.countdown-icon {
    font-size: var(--text-lg);
    animation: tick 1s ease-in-out infinite;
}

.countdown-text {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--warning-600);
    font-family: var(--font-mono);
}

.countdown-subtitle {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-style: italic;
}

/* Countdown Animation */
@keyframes tick {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Enhanced Section Status States */
.status-countdown {
    color: var(--warning-600);
    background: var(--warning-50);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--warning-200);
}

/* Generate Now Button Enhancement */
.btn.generate-now {
    background: var(--warning-500) !important;
    border-color: var(--warning-500) !important;
    color: white !important;
    animation: pulse-warning 2s ease-in-out infinite;
}

.btn.generate-now:hover {
    background: var(--warning-600) !important;
    border-color: var(--warning-600) !important;
    transform: translateY(-1px);
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .countdown-status {
        gap: var(--space-05);
    }
    
    .countdown-text {
        font-size: var(--text-xs);
    }
    
    .countdown-subtitle {
        font-size: var(--text-xxs);
    }
}

/* Super Compact Single Line BYOK Status */
.byok-status {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
}

.byok-status-free,
.byok-status-premium {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.status-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.status-icon {
    font-size: var(--text-base);
}

.status-text {
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    font-size: var(--text-sm);
    margin-right: var(--space-2);
}

.status-description {
    font-size: var(--text-xs);
    color: var(--gray-600);
}

.status-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
}

.status-count {
    color: var(--success-600);
    font-weight: var(--font-medium);
}

.hidden {
    display: none !important;
}
.byok-status-premium {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.byok-status-premium.hidden {
    display: none !important;
}

.byok-status-free.hidden {
    display: none !important;
}
















/* Premium Model Cards for Article Writer - Based on models.js styling */
/* Add this to your article-writer.css file */

/* Modal Content Structure Fix */
.modal-content {
    padding: 0;
    overflow: hidden;
}

/* Article Model Gallery Content - Full Width Container */
#articleModelGalleryContent {
    width: 100%;
    padding: 0;
    margin: 0;
}

/* User Model Count Info & Free Model Count */
.user-model-count,
.free-model-count {
    width: 100%;
    margin: 0;
    padding: 16px 24px;
    border-radius: 0;
    box-sizing: border-box;
    display: block;
    text-align: center;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.25);
}

.user-model-count {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.free-model-count {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

.user-model-count small,
.free-model-count small {
    opacity: 0.9;
    font-weight: 400;
    display: block;
    margin-top: 4px;
    font-size: 13px;
}

/* User Model Card & Regular Model Card Base Styles */
.user-model-card,
.model-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    min-height: 200px;
    animation: fadeInUp 0.4s ease-out;
}

.user-model-card:hover,
.model-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
    transform: translateY(-4px);
}

.model-card:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.user-model-card.selected,
.model-card.selected {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.user-model-card.premium {
    background: linear-gradient(135deg, #fefce8, #fffbeb);
    border-color: #f59e0b;
}

.user-model-card.premium:hover {
    border-color: #d97706;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.2);
}

/* Free/Premium Badges */
.user-model-free-badge,
.user-model-premium-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    color: white;
}

.user-model-free-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.user-model-premium-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

/* Model Card Header */
.user-model-card-header,
.model-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

/* Model Card Icons */
.user-model-card-icon,
.model-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.user-model-card-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}

.model-card-icon {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

/* Model Card Info */
.user-model-card-info,
.model-card-info {
    flex: 1;
}

.user-model-card-provider {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.user-model-card-title,
.model-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0;
}

.model-card-title {
    margin-bottom: 8px;
}

.model-card-meta {
    display: flex;
    gap: 8px;
}

.speed-badge {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.speed-badge.fast {
    background: #ecfdf5;
    color: #065f46;
}

.speed-badge.medium {
    background: #eff6ff;
    color: #1e40af;
}

.speed-badge.slow {
    background: #fef3c7;
    color: #92400e;
}

/* Model Descriptions */
.user-model-card-description,
.model-card-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Model Features */
.user-model-card-features,
.model-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.model-features {
    gap: 6px;
}

.user-model-feature-tag,
.model-features span {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

/* Model Footer */
.user-model-card-footer,
.model-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-model-pricing {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-model-pricing.free {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.user-model-pricing.premium {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Model Use Buttons */
.user-model-card .model-use-btn,
.model-card .model-use-btn {
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.user-model-card .model-use-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.model-card .model-use-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.user-model-card .model-use-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.model-card .model-use-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

.user-model-card.selected .model-use-btn,
.model-card.selected .model-use-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.user-model-card.selected .model-use-btn:hover,
.model-card.selected .model-use-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Models Grid */
.models-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Loading and Error States */
.enhanced-models-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

.enhanced-models-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc2626;
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 12px;
    margin: 20px 0;
}

.enhanced-models-error h3 {
    color: #991b1b;
    margin-bottom: 16px;
}

.enhanced-models-error ul {
    max-width: 300px;
    margin: 0 auto;
}

.enhanced-models-error li {
    margin-bottom: 8px;
    color: #7f1d1d;
}

/* Search Highlight */
.search-highlight {
    border-color: #fbbf24 !important;
    background: #fffbeb !important;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1) !important;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Provider-specific icon colors */
.user-model-card-icon.google {
    background: linear-gradient(135deg, #4285f4, #34a853);
}

.user-model-card-icon.anthropic {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.user-model-card-icon.openai {
    background: linear-gradient(135deg, #10a37f, #1a7f72);
}

.user-model-card-icon.meta {
    background: linear-gradient(135deg, #1877f2, #42a5f5);
}

.user-model-card-icon.mistral {
    background: linear-gradient(135deg, #ff7000, #ff8c42);
}

.user-model-card-icon.qwen {
    background: linear-gradient(135deg, #722ed1, #9254de);
}

.user-model-card-icon.deepseek {
    background: linear-gradient(135deg, #13c2c2, #36cfc9);
}

.user-model-card-icon.cohere {
    background: linear-gradient(135deg, #39c5bb, #52c41a);
}

/* Accessibility improvements */
.user-model-card:focus,
.model-card:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.model-use-btn:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Modal Gallery Specific Overrides */
.model-gallery-modal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
}

.model-gallery-modal #articleModelGalleryContent {
    max-height: none;
    overflow: visible;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .models-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .models-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .article-model-grid {
        padding: 0 12px 12px 12px;
    }
    
    .user-model-card,
    .model-card {
        padding: 20px;
    }
    
    .user-model-card-header,
    .model-card-header {
        gap: 12px;
    }
    
    .user-model-card-icon,
    .model-card-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .user-model-card-title,
    .model-card-title {
        font-size: 16px;
    }
    
    .user-model-card-footer,
    .model-card-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .model-use-btn {
        width: 100%;
        justify-content: center;
    }
    
    .user-model-count,
    .free-model-count {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .user-model-count small,
    .free-model-count small {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .article-model-grid {
        padding: 0 8px 8px 8px;
    }
    
    .user-model-card,
    .model-card {
        padding: 16px;
        margin: 0 4px;
    }
    
    .user-model-card-description,
    .model-card-description {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .user-model-card-features,
    .model-features {
        justify-content: center;
    }
    
    .user-model-feature-tag,
    .model-features span {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .speed-badge {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .user-model-pricing {
        font-size: 12px;
        padding: 4px 8px;
        text-align: center;
        width: 100%;
    }
    
    .user-model-count,
    .free-model-count {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Print styles */
@media print {
    .user-model-card,
    .model-card {
        break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
        background: white !important;
    }
    
    .model-use-btn {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .user-model-card,
    .model-card {
        border-width: 3px;
    }
    
    .user-model-card.selected,
    .model-card.selected {
        border-width: 4px;
    }
}














































.contextual-editing-notice {
    background: linear-gradient(135deg, var(--blue-50), var(--purple-50));
    border: 1px solid var(--blue-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--text-sm);
}

.contextual-editing-notice .notice-icon {
    font-size: var(--text-lg);
    flex-shrink: 0;
    margin-top: var(--space-1);
}

.contextual-editing-notice .notice-content {
    flex: 1;
    line-height: var(--leading-relaxed);
    color: var(--gray-700);
}

.contextual-editing-notice .notice-content strong {
    color: var(--blue-700);
    font-weight: var(--font-semibold);
}

@media (max-width: 768px) {
    .contextual-editing-notice {
        padding: var(--space-3);
        font-size: var(--text-xs);
    }
    
    .contextual-editing-notice .notice-icon {
        font-size: var(--text-base);
    }
}

/* === CONTEXTUAL EDITING NOTICE === */
.contextual-editing-notice {
    background: linear-gradient(135deg, var(--blue-50), var(--purple-50));
    border: 1px solid var(--blue-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--text-sm);
    animation: slideInDown 0.4s ease-out;
}

.contextual-editing-notice .notice-icon {
    font-size: var(--text-lg);
    flex-shrink: 0;
    margin-top: var(--space-1);
    animation: sparkle 2s ease-in-out infinite;
}

.contextual-editing-notice .notice-content {
    flex: 1;
    line-height: var(--leading-relaxed);
    color: var(--gray-700);
}

.contextual-editing-notice .notice-content strong {
    color: var(--blue-700);
    font-weight: var(--font-semibold);
}

/* aeWriter Step 8 Container */
.ae-editor-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    width: 1400px;
    margin: 0 auto;
}

/* Header */
.ae-editor-header {
    background: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-xl);
    position: sticky;
    top: 0;
    z-index: 100;
}

.ae-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ae-editor-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.ae-editor-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
}

.ae-breadcrumb-separator {
    color: #cbd5e1;
}

.ae-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ae-header-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.ae-header-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ae-header-btn.ae-btn-primary {
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    color: white;
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-xl);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    z-index: 9;
}

.ae-header-btn.ae-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--orange-600), var(--orange-700));
}

.ae-header-btn.ae-btn-success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.ae-header-btn.ae-btn-success:hover {
    background: #059669;
}

/* Main Content Area */
.ae-editor-main {
    flex: 1;
    display: flex;
    gap: 24px;
    padding-top: 24px;
}

/* Left Panel - Editor */
.ae-editor-panel {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ae-editor-panel-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #fafbfc;
    margin-bottom: 24px;
}

.ae-article-title-input {
    width: 100%;
    font-size: 24px;
    font-weight: 600;
    border: none;
    outline: none;
    background: transparent;
    color: #1e293b;
    padding: 8px 0;
    font-family: inherit;
}

.ae-article-title-input::placeholder {
    color: #94a3b8;
}

.ae-title-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
}

.ae-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Editor Content */
.ae-editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Override Quill Styles for aeWriter Look */
#step8 .ql-toolbar {
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 12px 24px !important;
    background: white !important;
}

#step8 .ql-container {
    border: none !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.7 !important;
    flex: 1;
}

#step8 .ql-editor {
    padding: 32px 24px !important;
    min-height: 500px !important;
}

#step8 .ql-editor h1, 
#step8 .ql-editor h2, 
#step8 .ql-editor h3 {
    font-weight: 600 !important;
    color: #1e293b !important;
}

#step8 .ql-editor p {
    margin-bottom: 16px !important;
    color: #374151 !important;
}

/* Right Panel - Tools & Analytics */
.ae-tools-panel {
    width: 380px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ae-tool-card {
    background: white;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.ae-tool-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ae-tool-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ae-tool-card-content {
    padding: 20px;
}

/* SEO Score Card */
.ae-seo-score {
    text-align: center;
    margin-bottom: 20px;
}

.ae-score-circle {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
}

.ae-score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
}

.ae-score-circle-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 8;
}

.ae-score-circle-progress {
    fill: none;
    stroke: #10b981;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.ae-score-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    color: #10b981;
}

.ae-score-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* Stats Grid */
.ae-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.ae-stat-item {
    text-align: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ae-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.ae-stat-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Keywords List */
.ae-keywords-list {
    margin-bottom: 16px;
}

.ae-keyword-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.ae-keyword-text {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.ae-keyword-count {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #dcfce7;
    color: #166534;
    font-weight: 500;
}
/* Replace this CSS rule */
.ae-keyword-count {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #dcfce7;
    color: #166534;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* Optional: Different colors based on count */
.ae-keyword-count[data-count="0"] {
    background: #f3f4f6;
    color: #6b7280;
}

.ae-keyword-count[data-count="1"] {
    background: #fef3c7;
    color: #92400e;
}

.ae-keyword-count[data-count="2"],
.ae-keyword-count[data-count="3"] {
    background: #dcfce7;
    color: #166534;
}

/* AI Tools */
.ae-ai-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ae-ai-tool-btn {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.ae-ai-tool-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ae-ai-tool-btn.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

/* Export Options */
.ae-export-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ae-export-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.ae-export-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Progress Indicator */
.ae-progress-bar {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}

.ae-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    width: 70%;
    transition: width 0.3s ease;
}

/* Auto-save indicator */
.ae-auto-save-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #10b981;
    margin-left: auto;
}

.ae-auto-save-indicator.hidden {
    display: none;
}

/* Icon styles */
.ae-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ae-tools-panel {
        width: 320px;
    }
}

@media (max-width: 968px) {
    .ae-editor-main {
        flex-direction: column;
        gap: 20px;
    }

    .ae-tools-panel {
        width: 100%;
    }

    .ae-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .ae-export-grid {
        grid-template-columns: 1fr 1fr;
    }
}d {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .ae-editor-main {
        padding: 16px;
    }

    .ae-header-actions {
        gap: 8px;
    }

    .ae-header-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .ae-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

}

/* Keywords Animation Styles - Add to article-writer.css */

/* Keywords Loading Animation */
.keywords-loading {
    text-align: center;
    padding: var(--space-8);
    background: linear-gradient(135deg, var(--green-50), var(--blue-50));
    border-radius: var(--radius-lg);
    border: 2px solid var(--green-200);
    margin: var(--space-4) 0;
}

.keywords-loading-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    animation: keywords-bounce 2s ease-in-out infinite;
}

.keywords-loading-text {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--green-700);
    margin-bottom: var(--space-3);
}

.keywords-loading-subtext {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-bottom: var(--space-4);
    animation: fadeInOut 2s ease-in-out infinite;
}

.keywords-progress {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.keywords-progress .progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green-300);
    animation: pulse-keywords 1.5s ease-in-out infinite;
}

.keywords-progress .progress-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.keywords-progress .progress-dot:nth-child(3) {
    animation-delay: 0.6s;
}

.keywords-progress .progress-dot:nth-child(4) {
    animation-delay: 0.9s;
}

.keywords-progress .progress-dot:nth-child(5) {
    animation-delay: 1.2s;
}

.keywords-ai-thinking {
    background: var(--green-50);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--green-500);
    font-size: var(--text-sm);
    color: var(--gray-700);
    margin-top: var(--space-4);
    position: relative;
}

.keywords-ai-thinking::before {
    content: '🏷️';
    position: absolute;
    left: -2px;
    top: -8px;
    background: white;
    padding: var(--space-1);
    border-radius: 50%;
    font-size: var(--text-xs);
    animation: float 2.5s ease-in-out infinite;
}

.keywords-typing-animation {
    display: inline-block;
    animation: typewriter-keywords 3s steps(40) infinite;
    border-right: 2px solid var(--green-500);
    white-space: nowrap;
    overflow: hidden;
}

.keywords-preview {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.preview-keyword {
    background: var(--green-100);
    color: var(--green-700);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    animation: slide-in-keyword 0.6s ease-out;
    opacity: 0.7;
}

/* Keywords Success Animation */
.keywords-success {
    text-align: center;
    padding: var(--space-6);
    background: linear-gradient(135deg, var(--success-50), var(--green-50));
    border-radius: var(--radius-lg);
    border: 2px solid var(--success-200);
    margin: var(--space-3) 0;
}

.keywords-success-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
    animation: bounce 1.2s ease-in-out;
}

.keywords-success-text {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--success-700);
    margin-bottom: var(--space-2);
}

.keywords-success-subtext {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

/* Keywords Animation Keyframes */
@keyframes keywords-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse-keywords {
    0%, 100% {
        transform: scale(1);
        background: var(--green-300);
    }
    50% {
        transform: scale(1.4);
        background: var(--green-500);
    }
}

@keyframes typewriter-keywords {
    0% {
        width: 0;
    }
    50% {
        width: 100%;
    }
    100% {
        width: 0;
    }
}

@keyframes slide-in-keyword {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 0.7;
        transform: translateX(0);
    }
}

/* Mobile Responsive for Keywords */
@media (max-width: 768px) {
    .keywords-loading {
        padding: var(--space-6);
    }
    
    .keywords-loading-icon {
        font-size: 2rem;
    }
    
    .keywords-loading-text {
        font-size: var(--text-base);
    }
    
    .keywords-preview {
        flex-wrap: wrap;
    }
}
/* Save Article System CSS - Add to article-writer.css */

/* Save Article Button Styling */
.ae-save-article-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ae-save-article-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

/* Save Warning Modal */
.save-warning-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.save-warning-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 90vw;
    margin: 20px;
    animation: slideUp 0.3s ease-out;
}

.save-warning-header {
    padding: 24px 24px 0;
    border-bottom: 1px solid #e2e8f0;
}

.save-warning-header h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-warning-content {
    padding: 24px;
    line-height: 1.6;
    color: #374151;
}

.save-warning-content p {
    margin: 0 0 16px 0;
}

.save-warning-content p:last-child {
    margin-bottom: 0;
}

.save-warning-content strong {
    color: #1f2937;
    font-weight: 600;
}

.save-warning-actions {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.save-warning-actions .btn {
    min-width: 100px;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: 1px solid #f59e0b;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    transform: translateY(-1px);
}

/* Success State Animation */
.ae-save-article-btn.success {
    background: #10b981 !important;
    border-color: #10b981 !important;
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Loading State for Save Button */
.ae-save-article-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.ae-save-article-btn:disabled svg {
    animation: spin 1s linear infinite;
}

/* Save Count Indicator */
.ae-save-count {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 500;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .save-warning-modal {
        margin: 16px;
        max-width: none;
    }
    
    .save-warning-header {
        padding: 20px 20px 0;
    }
    
    .save-warning-content {
        padding: 20px;
    }
    
    .save-warning-actions {
        padding: 0 20px 20px;
        flex-direction: column;
    }
    
    .save-warning-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .save-warning-header h3 {
        font-size: 18px;
    }
    
    .save-warning-content {
        font-size: 14px;
    }
}

/* Toast-like notification for save success */
.save-success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
    max-width: 350px;
    font-size: 14px;
    font-weight: 500;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* Saved Articles Modal CSS - Add to article-writer.css (Optional) */

/* Modal Overlay */
.saved-articles-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
    padding: 20px;
    box-sizing: border-box;
}

/* Modal Container */
.saved-articles-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

/* Modal Header */
.saved-articles-header {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.saved-articles-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.saved-articles-header .modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
    color: #6b7280;
}

.saved-articles-header .modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Modal Content */
.saved-articles-content {
    padding: 0 24px;
    overflow-y: auto;
    flex: 1;
    max-height: 50vh;
}

/* Article Items */
.saved-article-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 20px 0;
    transition: background 0.2s;
}

.saved-article-item:last-child {
    border-bottom: none;
}

.saved-article-item:hover {
    background: #f8fafc;
    margin: 0 -24px;
    padding: 20px 24px;
    border-radius: 8px;
}

/* Article Header */
.saved-article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 16px;
}

.saved-article-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

.saved-article-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.saved-article-btn {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.saved-article-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.saved-article-btn.delete {
    color: #dc2626;
    border-color: #fecaca;
}

.saved-article-btn.delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* Article Meta */
.saved-article-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Article Preview */
.saved-article-preview {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 12px;
    font-style: italic;
}

/* Share Link */
.saved-article-link {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-link-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', monospace;
    background: #f9fafb;
    color: #6b7280;
}

.share-link-input:focus {
    outline: none;
    border-color: var(--orange-600);
    background: white;
}

.copy-link-btn {
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    color: white;
    border: none;
    padding: var(--space-2) var(--space-6);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    z-index: 9;
}

.copy-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--orange-600), var(--orange-700));
}

/* Modal Footer */
.saved-articles-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 16px 16px;
    flex-shrink: 0;
}

.saved-articles-footer p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    line-height: 1.4;
}


/* Empty State */
.saved-articles-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.saved-articles-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .saved-articles-modal {
        margin: 16px;
        max-height: 90vh;
    }
    
    .saved-articles-header {
        padding: 20px;
    }
    
    .saved-articles-content {
        padding: 0 20px;
    }
    
    .saved-articles-footer {
        padding: 16px 20px;
    }
    
    .saved-article-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .saved-article-actions {
        align-self: stretch;
        justify-content: flex-end;
    }
    
    .saved-article-link {
        flex-direction: column;
        gap: 8px;
    }
    
    .copy-link-btn {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .saved-articles-modal-overlay {
        padding: 16px;
    }
    
    .saved-articles-header h3 {
        font-size: 18px;
    }
    
    .saved-article-title {
        font-size: 15px;
    }
    
    .saved-article-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .saved-article-btn {
        justify-content: center;
        padding: 8px 12px;
    }
}

/* Success animation for copy link */
.copy-link-btn.copied {
    background: #10b981 !important;
    border-color: #10b981 !important;
    animation: successPulse 0.6s ease-out;
}

.copy-link-btn.copied::after {
    content: '✓ Copied!';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    margin-top: 4px;
    animation: fadeInUp 0.3s ease-out;
}
/* Custom Delete Confirmation Modal CSS - Add to article-writer.css */

/* Delete Confirmation Modal */
.delete-confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15000; /* Higher than saved articles modal */
    animation: fadeIn 0.2s ease-out;
}

.delete-confirmation-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 420px;
    width: 90vw;
    margin: 20px;
    animation: scaleIn 0.3s ease-out;
    overflow: hidden;
}

.delete-confirmation-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid #fee2e2;
    background: linear-gradient(135deg, #fef2f2, #fff);
}

.delete-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.delete-confirmation-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #dc2626;
}

.delete-confirmation-content {
    padding: 20px 24px;
}

.delete-confirmation-content p {
    margin: 0 0 16px 0;
    line-height: 1.6;
    color: #374151;
}

.delete-confirmation-content p:last-of-type {
    margin-bottom: 20px;
}

.delete-confirmation-content strong {
    color: #1f2937;
    font-weight: 600;
}

.delete-warning {
    font-size: 14px;
    color: #7f1d1d;
    background: #fef2f2;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #fca5a5;
}

.article-info {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.info-badge {
    background: #f3f4f6;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.delete-confirmation-actions {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.delete-confirmation-actions .btn {
    min-width: 120px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: 1px solid #dc2626;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
}

.cancel-delete {
    color: #6b7280;
}

.cancel-delete:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

/* Empty State for Saved Articles */
.saved-articles-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.saved-articles-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.saved-articles-empty h4 {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.saved-articles-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Button count indicator for view saved button */
.view-saved-btn[data-count]::after {
    content: attr(data-count);
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

/* Animation for article removal */
.saved-article-item.removing {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease-out;
}

/* Modal animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

/* Responsive design */
@media (max-width: 768px) {
    .delete-confirmation-modal {
        margin: 16px;
        max-width: none;
    }
    
    .delete-confirmation-header {
        padding: 20px 20px 16px;
    }
    
    .delete-icon {
        font-size: 40px;
        margin-bottom: 8px;
    }
    
    .delete-confirmation-header h3 {
        font-size: 18px;
    }
    
    .delete-confirmation-content {
        padding: 16px 20px;
    }
    
    .delete-confirmation-actions {
        padding: 0 20px 20px;
        flex-direction: column-reverse;
    }
    
    .delete-confirmation-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .delete-confirmation-overlay {
        padding: 12px;
    }
    
    .delete-confirmation-content {
        font-size: 14px;
    }
    
    .article-info {
        flex-direction: column;
        gap: 4px;
    }
}

/* Article Writer Custom Error Handling CSS */
/* Add this to your article-writer.css file */

/* Error Popup Overlay */
.article-error-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    padding: var(--space-4);
    box-sizing: border-box;
}

.article-error-popup.active {
    opacity: 1;
}

/* Error Modal */
.article-error-modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease-out;
}

.article-error-popup.active .article-error-modal {
    transform: scale(1) translateY(0);
}

/* Error Header */
.article-error-modal .modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    position: relative;
}

/* Error Severity Styling */
.article-error-modal .modal-header.error-critical {
    background: linear-gradient(135deg, var(--error-50), var(--error-25));
    border-bottom-color: var(--error-200);
}

.article-error-modal .modal-header.error-severe {
    background: linear-gradient(135deg, var(--warning-50), var(--warning-25));
    border-bottom-color: var(--warning-200);
}

.article-error-modal .modal-header.error-warning {
    background: linear-gradient(135deg, var(--orange-50), var(--orange-25));
    border-bottom-color: var(--orange-200);
}

.article-error-modal .modal-header.error-info {
    background: linear-gradient(135deg, var(--blue-50), var(--blue-25));
    border-bottom-color: var(--blue-200);
}

/* Error Icon */
.error-icon {
    font-size: var(--text-3xl);
    flex-shrink: 0;
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Error Header Text */
.error-header-text {
    flex: 1;
}

.error-header-text h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin: 0 0 var(--space-1) 0;
}

.error-step {
    font-size: var(--text-sm);
    color: var(--gray-600);
    font-weight: var(--font-medium);
    margin: 0;
}

/* Modal Close Button */
.article-error-modal .modal-close {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
}

.article-error-modal .modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* Error Content */
.article-error-modal .modal-content {
    padding: var(--space-6);
    max-height: 60vh;
    overflow-y: auto;
}

/* Error Message */
.error-message {
    margin-bottom: var(--space-5);
}

.error-message p {
    font-size: var(--text-base);
    color: var(--gray-800);
    line-height: var(--leading-relaxed);
    margin: 0;
}

/* Error Suggestions */
.error-suggestions {
    margin-bottom: var(--space-6);
    background: var(--gray-50);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--orange-500);
}

.error-suggestions h4 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin: 0 0 var(--space-3) 0;
}

.error-suggestions ul {
    margin: 0;
    padding-left: var(--space-5);
    list-style-type: disc;
}

.error-suggestions li {
    font-size: var(--text-sm);
    color: var(--gray-700);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-2);
}

.error-suggestions li:last-child {
    margin-bottom: 0;
}

/* Error Actions */
.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: flex-end;
    align-items: center;
}

.error-action-btn {
    background: var(--orange-500);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.error-action-btn:hover {
    background: var(--orange-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.error-action-btn:active {
    transform: translateY(0);
}

/* Primary Action Button */
.error-action-btn:first-child {
    background: var(--success-500);
    order: -1;
}

.error-action-btn:first-child:hover {
    background: var(--success-600);
}

/* Secondary Action Buttons */
.error-actions .btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.error-actions .btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

/* Special Action Button Variants */
.error-action-btn.credits-btn {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
}

.error-action-btn.credits-btn:hover {
    background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
}

.error-action-btn.premium-btn {
    background: linear-gradient(135deg, var(--purple-500), var(--purple-600));
}

.error-action-btn.premium-btn:hover {
    background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
}

.error-action-btn.retry-btn {
    background: var(--orange-500);
}

.error-action-btn.retry-btn:hover {
    background: var(--orange-600);
}

/* Toast-style Error Notifications */
.article-error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid var(--error-200);
    border-left: 4px solid var(--error-500);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-4);
    max-width: 400px;
    z-index: 9999;
    transform: translateX(420px);
    transition: transform 0.3s ease-out;
}

.article-error-toast.show {
    transform: translateX(0);
}

.article-error-toast.warning {
    border-left-color: var(--warning-500);
    border-color: var(--warning-200);
}

.article-error-toast.info {
    border-left-color: var(--blue-500);
    border-color: var(--blue-200);
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.toast-icon {
    font-size: var(--text-lg);
    flex-shrink: 0;
    margin-top: var(--space-1);
}

.toast-message {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--gray-800);
    line-height: var(--leading-relaxed);
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: color var(--transition-normal);
}

.toast-close:hover {
    color: var(--gray-700);
}

/* Loading State for Retry Actions */
.error-action-btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.error-action-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success State Animation */
.error-action-btn.success {
    background: var(--success-500) !important;
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .article-error-popup {
        padding: var(--space-3);
    }
    
    .article-error-modal {
        max-width: none;
        width: 100%;
        max-height: 95vh;
    }
    
    .article-error-modal .modal-header {
        padding: var(--space-4);
        flex-direction: column;
        text-align: center;
        gap: var(--space-2);
    }
    
    .error-icon {
        font-size: var(--text-2xl);
    }
    
    .error-header-text h3 {
        font-size: var(--text-base);
    }
    
    .article-error-modal .modal-close {
        position: absolute;
        top: var(--space-3);
        right: var(--space-3);
    }
    
    .article-error-modal .modal-content {
        padding: var(--space-4);
        max-height: 70vh;
    }
    
    .error-actions {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .error-action-btn {
        width: 100%;
        justify-content: center;
        padding: var(--space-3);
    }
    
    .article-error-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .article-error-toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .error-icon {
        font-size: var(--text-xl);
    }
    
    .article-error-modal .modal-header {
        padding: var(--space-3);
    }
    
    .article-error-modal .modal-content {
        padding: var(--space-3);
        max-height: 75vh;
    }
    
    .error-suggestions {
        padding: var(--space-3);
    }
    
    .error-suggestions h4 {
        font-size: var(--text-sm);
    }
    
    .error-suggestions li {
        font-size: var(--text-xs);
    }
    
    .error-actions {
        gap: var(--space-2);
    }
    
    .error-action-btn {
        font-size: var(--text-xs);
        padding: var(--space-2) var(--space-3);
    }
}

/* Dark Mode Support (if applicable) */
@media (prefers-color-scheme: dark) {
    .theme.dark .article-error-modal {
        background: var(--gray-800);
        color: var(--gray-100);
    }
    
    .theme.dark .article-error-modal .modal-header {
        border-bottom-color: var(--gray-700);
    }
    
    .theme.dark .error-suggestions {
        background: var(--gray-700);
        color: var(--gray-200);
    }
    
    .theme.dark .article-error-toast {
        background: var(--gray-800);
        color: var(--gray-100);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .article-error-modal {
        border: 3px solid var(--gray-900);
    }
    
    .error-action-btn {
        border: 2px solid transparent;
    }
    
    .error-action-btn:focus {
        border-color: var(--gray-900);
        outline: 2px solid var(--orange-500);
        outline-offset: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .article-error-popup,
    .article-error-modal,
    .error-action-btn {
        transition: none;
    }
    
    .error-icon {
        animation: none;
    }
    
    .error-action-btn.loading::after {
        animation: none;
    }
    
    .error-action-btn.success {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .article-error-popup,
    .article-error-toast {
        display: none !important;
    }
}

/* Focus Management */
.article-error-modal *:focus {
    outline: 2px solid var(--orange-500);
    outline-offset: 2px;
}

/* Scrollbar Styling for Error Modal Content */
.article-error-modal .modal-content::-webkit-scrollbar {
    width: 6px;
}

.article-error-modal .modal-content::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

.article-error-modal .modal-content::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

.article-error-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}