/* ====== FORCE DARK THEME - HIGH SPECIFICITY ====== */
body #page .entry-content,
body .site-content .container,
body .entry-content,
body #content,
body .site-content {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #f8fafc !important;
}

/* Target specific header elements */
.site-header,
#masthead,
#header,
header,
.entry-header,
.wp-block-post-title,
.post-title,
h1.entry-title,
.page-title,
.entry-title {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #f8fafc !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Fix any white background containers */
.container,
.wp-block-group,
.wp-block-cover,
.section,
.row,
.col {
    background-color: transparent !important;
    background: transparent !important;
}

/* ====== KILL WHITE HEADER ====== */
.entry-header, 
.wp-block-post-title,
.post-title,
h1.entry-title,
.page-title,
.entry-title {
    background: transparent !important;
    color: var(--text-primary) !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Specifically for your theme */
.site-header,
.header,
#masthead,
#header {
    background: var(--bg-primary) !important;
}

/* Force dark background everywhere */
body,
#page,
#content {
    background: var(--bg-primary) !important;
}


/* ====== NICHE DISCOVERY ENGINE - PROFESSIONAL CHAT UI ====== */

:root {
    /* hokumanu.com Color Scheme */
    --bg-primary: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-light: #334155;
    
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border: #475569;
    --radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* ====== RESET & BASE ====== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-primary) !important;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

/* Fix WordPress theme backgrounds */
#page, #content, .entry-content, .site-content, .container {
    background: var(--bg-primary) !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Fix link colors - Add this after your existing 'body' rules */
a,
a:link,
a:visited,
a:hover,
a:focus {
    color: #22d3ee !important;
    text-decoration: underline;
}

/* ====== PLUGIN CONTAINER ====== */
.niche-discovery-engine {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: var(--bg-primary);
    min-height: 100vh;
}

/* ====== HEADER ====== */
/* ====== HEADER STYLES ====== */

/* Welcome Greeting - Centered above title */
.welcome-greeting {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.welcome-name {
    color: var(--primary);
    font-weight: 600;
}

/* Title Section */
.nde-title-section {
    text-align: center;
    margin-bottom: 20px;
}

.nde-title-section h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 8px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-style: italic;
}

/* Description */
.nde-description {
    background: var(--bg-surface-light);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid var(--border);
}

.nde-description p {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.nde-description p:last-child {
    margin-bottom: 0;
}

/* Session Info */
.session-info {
    background: var(--bg-surface-light);
    border-radius: 8px;
    padding: 14px;
    border: 1px solid var(--border);
}

.session-info.can-start {
    border-color: var(--success);
}

.session-info.cannot-start {
    border-color: var(--warning);
}

.session-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.status-icon {
    font-size: 1.2rem;
}

.status-text {
    font-weight: 500;
    color: var(--text-primary);
}

.session-limit {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.session-limit strong {
    color: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nde-title-section h1 {
        font-size: 1.7rem;
    }
    
    .title-subtitle {
        font-size: 1rem;
    }
    
    .welcome-greeting {
        font-size: 1rem;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    
    .nde-description {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .nde-title-section h1 {
        font-size: 1.5rem;
    }
    
    .title-subtitle {
        font-size: 0.95rem;
    }
}
.nde-header {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.nde-header h1 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 12px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nde-subtitle {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 1rem;
}

.nde-subtitle p {
    margin-bottom: 8px;
}

.patreon-greeting {
    background: var(--bg-surface-light);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 8px;
}

.session-info {
    background: var(--bg-surface-light);
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    font-size: 0.9rem;
}

/* ====== CHAT CONTAINER ====== */
.nde-chat-container {
    background: var(--bg-surface);
    border-radius: var(--radius);
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Chat messages container */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ====== CHAT BUBBLES ====== */

/* System messages (centered, no bubble) */
.chat-system {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 8px 0;
    font-style: italic;
    max-width: 80%;
    margin: 0 auto;
}

/* Questions (left side, blue bubble) */
.chat-question {
    align-self: flex-start;
    max-width: 75%;
}

.question-bubble {
    background: var(--bg-surface-light);
    border-radius: 18px 18px 18px 6px;
    padding: 14px 18px;
    position: relative;
    border: 1px solid var(--border);
}

.question-label {
    display: block;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-text {
    font-size: 1.05rem;
    line-height: 1.4;
    color: var(--text-primary);
}

/* Answers (right side, blue bubble) */
.chat-answer {
    align-self: flex-end;
    max-width: 75%;
}

.answer-bubble {
    background: var(--primary);
    border-radius: 18px 18px 6px 18px;
    padding: 14px 18px;
    position: relative;
}

.answer-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.answer-text {
    font-size: 1.05rem;
    line-height: 1.4;
    color: white;
}

/* AI responses (full width, special styling) */
.chat-ai {
    background: var(--bg-surface-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 8px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--secondary);
}

.ai-label {
    color: var(--secondary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-content {
    line-height: 1.6;
}

.ai-content h3 {
    color: var(--primary);
    margin: 16px 0 8px 0;
    font-size: 1.2rem;
}

.ai-content h4 {
    color: var(--text-primary);
    margin: 12px 0 6px 0;
    font-size: 1.1rem;
}

.ai-content p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.ai-content strong {
    color: var(--primary);
}

.ai-content ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.ai-content li {
    margin-bottom: 6px;
    color: var(--text-secondary);
}
/* Fix color for the AI analysis loading header */
.chat-ai h3 {
    color: #cbd5e1 !important; /* Or use your preferred light color like #f8fafc */
}
/* Add these rules to your niche-engine.css file */
/* Style for the first line (h3) */
.chat-ai h3 {
    color: #00e0d0 !important; /* Light turquoise */
    font-size: 1.4rem !important; /* Keeps current size, ensures it's larger */
    margin-bottom: 8px !important;
}

/* Style for the second line (paragraph) - keep as is */
.chat-ai p {
    color: var(--text-secondary) !important; /* Should already be light gray */
    font-size: 1rem !important;
    margin-bottom: 8px !important;
}

/* Style for the last line (processing-time paragraph) */
.chat-ai p.processing-time {
    color: var(--text-muted) !important; /* Muted color from your theme */
    font-size: 0.85rem !important; /* Smaller */
    font-style: italic !important;
    margin-top: 10px !important;
}

/* ====== INPUT AREA ====== */
.nde-input-area {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
}

/* Question counter (hidden by default) */
.question-display {
    display: none;
}

/* Text area */
#nde-user-input {
    width: 100%;
    min-height: 100px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

#nde-user-input:focus {
    outline: none;
    border-color: var(--primary);
}

#nde-user-input::placeholder {
    color: var(--text-muted);
}

/* Character counter */
.char-counter-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.char-counter {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.char-counter .count {
    color: var(--text-primary);
    font-weight: 600;
}

.min-chars-notice {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ====== BUTTONS ====== */
.input-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.nde-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
    text-decoration: none;
}

.nde-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nde-btn-primary {
    background: var(--primary);
    color: white;
}

.nde-btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.nde-btn-secondary {
    background: var(--bg-surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.nde-btn-secondary:hover:not(:disabled) {
    background: var(--bg-surface);
    transform: translateY(-2px);
}

/* Progress bar */
.progress-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ====== START CONTAINER ====== */
.nde-start-container {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border);
}

.start-instructions {
    text-align: left;
    margin-bottom: 30px;
}

.start-instructions h3 {
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.start-instructions ul {
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
}

.start-instructions li {
    margin-bottom: 10px;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
}

.start-instructions li:before {
    content: "✓";
    color: var(--primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.disclaimer-box {
    margin-top: 20px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
}

.disclaimer-box strong {
    color: var(--warning);
}

/* ====== MODALS ====== */
.nde-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.nde-modal-content {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    border: 1px solid var(--border);
    text-align: center;
}

/* Action Buttons */
.action-buttons-container {
    background: var(--bg-surface-light);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
    border: 1px solid var(--border);
}

.action-buttons-header {
    text-align: center;
    margin-bottom: 24px;
}

.action-buttons-header h3 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.action-buttons-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-btn {
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.action-btn i {
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.action-btn span {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.action-btn small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.export-text-btn:hover i { color: #10b981; }
.export-json-btn:hover i { color: #8b5cf6; }
.new-session-btn:hover i { color: #f59e0b; }

/* Thinking Animation */
.thinking-animation {
    text-align: center;
    padding: 30px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Upgrade Section Styles */
.nde-upgrade-section {
    margin: 30px auto 20px;
    padding: 20px;
    max-width: 600px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    padding-top: 25px;
}

.nde-upgrade-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nde-upgrade-button {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    border: none;
    cursor: pointer;
}

.nde-upgrade-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #ff5252, #ff7b3d);
}

.nde-upgrade-text {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

.nde-pro-button {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.nde-pro-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(78, 205, 196, 0.4);
    background: linear-gradient(135deg, #3dbdb4, #358f7d);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nde-upgrade-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nde-upgrade-text {
        order: 3;
        margin-top: 5px;
    }
    
    .nde-upgrade-button,
    .nde-pro-button {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nde-upgrade-section {
        margin: 20px auto 15px;
        padding: 15px;
    }
    
    .nde-upgrade-button,
    .nde-pro-button {
        padding: 10px 20px;
        font-size: 15px;
    }
}

/* ====== MOBILE RESPONSIVE ====== */
@media (max-width: 768px) {
    .niche-discovery-engine {
        padding: 15px;
    }
    
    .nde-chat-container {
        height: 350px;
        padding: 15px;
    }
    
    .chat-question,
    .chat-answer {
        max-width: 85%;
    }
    
    .question-bubble,
    .answer-bubble {
        padding: 12px 16px;
    }
    
    .char-counter-wrapper {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        text-align: center;
    }
    
    .input-actions {
        flex-direction: column;
    }
    
    .nde-btn {
        width: 100%;
        padding: 14px 20px;
    }
    
    .nde-modal-content {
        padding: 20px;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .nde-header h1 {
        font-size: 1.5rem;
    }
    
    .question-text,
    .answer-text {
        font-size: 1rem;
    }
    
    .nde-chat-container {
        height: 300px;
    }
}
/* ====== PATREON REQUIRED MODAL STYLES ====== */

/* Modal overlay */
.nde-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95); /* #0f172a with 95% opacity */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

/* Modal content box */
.nde-modal-content {
    background: var(--bg-surface); /* #1e293b */
    padding: 32px;
    border-radius: var(--radius); /* 12px */
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 2px solid var(--primary); /* #3b82f6 */
    box-shadow: var(--shadow); /* 0 4px 6px rgba(0,0,0,0.2) */
    color: var(--text-primary); /* #f8fafc */
}

/* Modal heading */
.nde-modal-content h2 {
    color: var(--primary); /* #3b82f6 */
    margin-bottom: 16px;
    font-size: 1.5rem;
}

/* Modal paragraphs */
.nde-modal-content p {
    color: var(--text-secondary); /* #cbd5e1 */
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Patreon connect button */
.nde-modal-content .patreon-connect-button {
    display: inline-block;
    background: linear-gradient(135deg, #FF424D, #FF6B6B);
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 20px 0;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 66, 77, 0.3);
}

.nde-modal-content .patreon-connect-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 66, 77, 0.4);
    background: linear-gradient(135deg, #FF6B6B, #FF424D);
}

/* Small note */
.nde-modal-content .modal-note {
    color: var(--text-muted); /* #94a3b8 */
    font-size: 0.85rem;
    margin-top: 10px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .nde-modal-content {
        padding: 24px;
        width: 95%;
        margin: 10px;
    }
    
    .nde-modal-content h2 {
        font-size: 1.3rem;
    }
    
    .nde-modal-content .patreon-connect-button {
        padding: 12px 24px;
        font-size: 1rem;
    }
}
/* Market validation section */
.nde-market-validation {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.nde-market-validation h4 {
    color: #3b82f6;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.nde-market-validation p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.nde-market-validation ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.nde-market-validation li {
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.nde-market-validation li strong {
    color: var(--primary);
}

.nde-important-note {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.nde-important-note h4 {
    color: #f59e0b;
    margin-bottom: 12px;
}

/* Add to niche-engine.css */
.nde-analysis-error {
    background: linear-gradient(135deg, #fff5f5 0%, #fffbf5 100%);
    border: 2px solid #fed7d7;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    animation: fadeIn 0.3s ease;
}

.nde-error-header {
    text-align: center;
    margin-bottom: 2rem;
}

.nde-error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.nde-error-header h2 {
    color: #c53030;
    margin-bottom: 0.5rem;
}

.nde-error-body {
    color: #4a5568;
}

.nde-error-solutions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.nde-solution-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nde-solution-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nde-solution-card h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.nde-solution-card p {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.nde-error-note {
    background: #ebf8ff;
    border-left: 4px solid #4299e1;
    padding: 1rem;
    margin-top: 1.5rem;
    border-radius: 0 4px 4px 0;
}

.nde-error-state {
    animation: pulse-gentle 2s infinite;
}

@keyframes pulse-gentle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

.nde-retry-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: background 0.2s;
}

.nde-retry-btn:hover {
    background: #3182ce;
}

.nde-save-draft-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: background 0.2s;
}

.nde-save-draft-btn:hover {
    background: #cbd5e0;
}

/* Add to the end of niche-engine.css */
.final-submit-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    font-weight: 700 !important;
    font-size: 1.1em !important;
    padding: 12px 30px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4) !important;
    transition: all 0.3s ease !important;
}

.final-submit-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6) !important;
}

/* maybe there is a time out message that is black? Testing this. will come back later */
.timeout-msg {
    color: #ffffff !important;
}

/* ====== AUTHENTICATION PROMPT STYLES ====== */

/* Patreon Connection Prompt - For gateway page */
.patreon-connection-prompt {
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    margin: 40px auto;
    max-width: 600px;
    text-align: center;
    box-shadow: var(--shadow);
}

.patreon-connection-prompt h3 {
    color: var(--primary);
    margin: 0 0 20px 0;
    font-size: 1.5rem;
}

.patreon-connection-prompt h4 {
    color: var(--text-primary);
    margin: 25px 0 15px 0;
    font-size: 1.2rem;
}

.patreon-connection-prompt p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.patreon-connection-prompt strong {
    color: var(--primary);
}

.patreon-connection-prompt hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 25px 0;
    opacity: 0.5;
}

/* Auth Steps */
.auth-step {
    background: var(--bg-surface-light);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    text-align: left;
}

.auth-step h3 {
    color: var(--text-primary);
    margin-top: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-step h3::before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
}

/* For the second step */
.auth-step:nth-child(2) h3::before {
    content: "🔗";
}

/* Auth Note */
.auth-note {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-left: 4px solid var(--success);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    text-align: left;
}

.auth-note p {
    color: #d1fae5;
    margin: 0;
    font-size: 0.9rem;
}

/* Authentication Error/Required */
.nde-auth-required {
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    margin: 50px auto;
    max-width: 600px;
    text-align: center;
    box-shadow: var(--shadow);
}

.auth-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.nde-auth-required h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.nde-auth-required p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.auth-options {
    margin: 30px 0;
}

/* Successfully Connected Page */
.success-box {
    background: var(--bg-surface);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 500px;
    margin: 80px auto;
    text-align: center;
    box-shadow: var(--shadow);
}

.success-box h2 {
    color: var(--success);
    margin-bottom: 20px;
}

.success-box p {
    color: var(--text-secondary);
    margin: 20px 0;
    font-size: 18px;
}

.success-box strong {
    color: var(--text-primary);
}

/* Patreon Authenticated Welcome Message */
.patreon-authenticated {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
}

.patreon-authenticated p {
    margin: 0;
    font-size: 14px;
    color: #d1fae5;
}

.patreon-authenticated strong {
    color: white;
}

/* ====== LIMIT MODAL STYLES ====== */
#nde-limit-modal .nde-modal-content {
    background: var(--bg-surface);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 2px solid var(--warning);
}

#nde-limit-modal .nde-modal-content h3 {
    color: var(--warning);
    margin-bottom: 20px;
}

#nde-limit-modal .nde-modal-content p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 16px;
}

#nde-limit-modal .nde-modal-content strong {
    color: var(--text-primary);
}

/* ====== AI UNAVAILABLE ERROR ====== */
.nde-ai-unavailable-error {
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    animation: fadeIn 0.3s ease;
}

.nde-error-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.nde-error-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--warning);
}

.nde-error-header h3 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.25rem;
}

.nde-error-body {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.nde-error-actions {
    display: flex;
    gap: 0.75rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.nde-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nde-error-tips {
    background: var(--bg-surface-light);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    border-radius: 0 4px 4px 0;
    margin-top: 1.5rem;
    text-align: left;
}

.nde-error-tips h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.nde-error-tips ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-muted);
}

.nde-error-tips li {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====== BUTTON STYLES FOR AUTH ====== */
.patreon-auth-btn {
    background: linear-gradient(135deg, #FF424D, #FF6B6B) !important;
    border: none !important;
    color: white !important;
    padding: 14px 32px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(255, 66, 77, 0.3) !important;
}

.patreon-auth-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 66, 77, 0.4) !important;
    background: linear-gradient(135deg, #FF6B6B, #FF424D) !important;
}

/* Special button for "Become Free Member" */
.auth-step .nde-btn-primary {
    background: linear-gradient(135deg, #FF424D, #FF6B6B) !important;
    border-color: #FF424D !important;
}

.auth-step .nde-btn-primary:hover {
    background: linear-gradient(135deg, #FF6B6B, #FF424D) !important;
}

.auth-step:nth-child(2) .nde-btn-primary {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
    border-color: #10b981 !important;
}

.auth-step:nth-child(2) .nde-btn-primary:hover {
    background: linear-gradient(135deg, #34d399, #10b981) !important;
}

/* ====== MOBILE RESPONSIVE FOR AUTH ====== */
@media (max-width: 768px) {
    .patreon-connection-prompt,
    .nde-auth-required,
    .success-box {
        padding: 20px;
        margin: 20px 10px;
        width: calc(100% - 20px);
    }
    
    .auth-icon {
        font-size: 3rem;
    }
    
    .nde-auth-required h2 {
        font-size: 1.3rem;
    }
    
    .auth-step {
        padding: 15px;
    }
    
    .auth-note {
        padding: 12px;
    }
    
    .nde-error-actions {
        flex-direction: column;
    }
    
    .nde-error-actions .nde-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .patreon-connection-prompt h3 {
        font-size: 1.3rem;
    }
    
    .auth-step h3 {
        font-size: 1rem;
    }
    
    .nde-auth-required p {
        font-size: 1rem;
    }
    
    .patreon-auth-btn {
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }
}

/* ====== LOADING STATES ====== */
.nde-btn.loading {
    position: relative;
    color: transparent !important;
}

.nde-btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: button-spinner 0.6s linear infinite;
}

@keyframes button-spinner {
    to { transform: rotate(360deg); }
}

/* ====== FIX FOR TIME OUT MESSAGES ====== */
.timeout-msg,
.processing-time,
.processing-tips {
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
}

/* Ensure all text in modals is visible */
.nde-modal-content * {
    color: var(--text-primary) !important;
}

.nde-modal-content p,
.nde-modal-content span,
.nde-modal-content div {
    color: var(--text-secondary) !important;
}
/* Clean upgrade actions - no extra background */
.nde-upgrade-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
    padding: 0;
    background: transparent;
    flex-wrap: wrap; /* Allows wrapping on mobile */
}

.nde-btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
    min-width: 90px;
    text-align: center;
}

.nde-btn-upgrade-sm {
    background: linear-gradient(135deg, #FF424D 0%, #e03e47 100%);
    color: white;
}

.nde-btn-upgrade-sm:hover {
    background: linear-gradient(135deg, #e03e47 0%, #c92a2a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 66, 77, 0.3);
}

.nde-btn-pro-sm {
    background: #052D49;
    color: white;
}

.nde-btn-pro-sm:hover {
    background: #031a2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 45, 73, 0.3);
}

.nde-upgrade-text-sm {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit; /* Same as your existing text */
}

/* Responsive design */
@media (max-width: 768px) {
    .nde-upgrade-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }
    
    .nde-upgrade-text-sm {
        margin: 5px 0;
    }
    
    /* On mobile, show as: Upgrade button, text, Pro button, text */
    .nde-upgrade-actions > * {
        margin: 2px 0;
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .nde-btn-sm {
        padding: 8px 20px;
        font-size: 13px;
        min-width: 80px;
    }
    
    .nde-upgrade-text-sm {
        font-size: 13px;
    }
}
/* Force upgrade text to show */
.nde-upgrade-container .nde-upgrade-text {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure the container displays children inline */
.nde-upgrade-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}