
/* ==========================================================================
   Article Assistant Widget
   Dark Theme | Responsive | Scoped Styles
   All classes prefixed with article-assistant-
   ========================================================================== */

.article-assistant-wrapper {
    --aa-bg: #1e1e24;
    --aa-surface: #2a2a32;
    --aa-surface-hover: #3a3a45;
    --aa-border: #444;
    --aa-text: #fff;
    --aa-muted: #aaa;
    --aa-accent: #91d904;
    --aa-accent-hover: #7bbd00;
    --aa-danger: #ff4d4d;

    box-sizing: border-box;
    width: 100%;
    background: var(--aa-bg);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    margin: 32px 0;
    font-family: 'Outfit', sans-serif;
    color: var(--aa-text);
    line-height: 1.5;
}

.article-assistant-wrapper *,
.article-assistant-wrapper *::before,
.article-assistant-wrapper *::after {
    box-sizing: border-box;
}

/* --- Header --- */

.article-assistant-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--aa-text);
}

.article-assistant-header p {
    font-size: 0.9rem;
    color: var(--aa-muted);
    margin: 0 0 20px;
    line-height: 1.6;
}

/* --- Section Labels --- */

.article-assistant-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 10px;
}

/* --- AI Buttons --- */

.article-assistant-ai-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.article-assistant-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--aa-border);
    border-radius: 8px;
    background: var(--aa-surface);
    color: var(--aa-text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.article-assistant-ai-btn:hover {
    background: var(--aa-surface-hover);
    border-color: #666;
}

.article-assistant-ai-btn:active {
    transform: translateY(1px);
}

.article-assistant-ai-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.article-assistant-ai-chatgpt:hover {
    border-color: #10a37f;
    color: #10a37f;
}

.article-assistant-ai-claude:hover {
    border-color: #d97706;
    color: #d97706;
}

.article-assistant-ai-gemini:hover {
    border-color: #4285f4;
    color: #4285f4;
}

.article-assistant-ai-grok:hover {
    border-color: #fff;
    color: #fff;
}

.article-assistant-ai-perplexity:hover {
    border-color: #20b2aa;
    color: #20b2aa;
}

.article-assistant-ai-deepseek:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

/* --- Audio Player --- */

.article-assistant-player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.article-assistant-main-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- Common Player Buttons --- */

.article-assistant-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    min-height: 38px;
    border: 1px solid var(--aa-border);
    border-radius: 8px;
    background: var(--aa-surface);
    color: var(--aa-text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.article-assistant-btn:hover:not(:disabled) {
    background: var(--aa-surface-hover);
}

.article-assistant-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Play Button */

.article-assistant-btn-play {
    background: var(--aa-accent);
    color: #000;
    border-color: var(--aa-accent);
    font-weight: 600;
}

.article-assistant-btn-play:hover:not(:disabled) {
    background: var(--aa-accent-hover);
    border-color: var(--aa-accent-hover);
}

/* Stop Button */

.article-assistant-btn-stop {
    color: var(--aa-danger);
    border-color: var(--aa-danger);
}

.article-assistant-btn-stop:hover:not(:disabled) {
    background: var(--aa-danger);
    color: #fff;
}

/* Settings Button */

.article-assistant-btn-settings {
    white-space: nowrap;
}

/* --- Player Status --- */

.article-assistant-status {
    min-height: 20px;
    font-size: 0.85rem;
    color: var(--aa-muted);
    margin: 4px 0 0;
    line-height: 1.5;
}

/* --- Settings Panel --- */

.article-assistant-settings-panel {
    margin-top: 16px;
    border: 1px solid var(--aa-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--aa-surface);
}

.article-assistant-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #0f172a;
    color: var(--aa-text);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95rem;
}

.article-assistant-settings-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.article-assistant-settings-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.article-assistant-settings-body {
    padding: 16px;
}

/* --- Settings Rows --- */

.article-assistant-setting-row {
    margin-bottom: 14px;
}

.article-assistant-setting-row:last-child {
    margin-bottom: 0;
}

.article-assistant-setting-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: #ccc;
}

.article-assistant-setting-row label span {
    color: var(--aa-accent);
    font-weight: 600;
    margin-left: 4px;
}

/* --- Language and Voice Selects --- */

.article-assistant-setting-group {
    flex: 1 1 0;
    min-width: 0;
}

.article-assistant-setting-row select {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--aa-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--aa-bg);
    color: var(--aa-text);
    cursor: pointer;
}

.article-assistant-setting-row select option {
    background: var(--aa-bg);
    color: var(--aa-text);
}

/* --- Range Controls --- */

.article-assistant-setting-row input[type="range"] {
    display: block;
    width: 100%;
    margin: 8px 0;
    accent-color: var(--aa-accent);
    cursor: pointer;
}

/* --- Voice Information --- */

.article-assistant-voice-info {
    font-size: 0.8rem;
    color: #888;
    margin: 8px 0 12px;
    line-height: 1.5;
}

/* --- Settings Actions --- */

.article-assistant-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-assistant-btn-preview {
    background: var(--aa-accent);
    color: #000;
    border-color: var(--aa-accent);
    font-weight: 600;
}

.article-assistant-btn-preview:hover:not(:disabled) {
    background: var(--aa-accent-hover);
    border-color: var(--aa-accent-hover);
}

/* --- Keyboard Accessibility --- */

.article-assistant-wrapper button:focus-visible,
.article-assistant-wrapper select:focus-visible,
.article-assistant-wrapper input:focus-visible {
    outline: 2px solid var(--aa-accent);
    outline-offset: 3px;
}

/* --- Tablet Responsive --- */

@media (max-width: 768px) {
    .article-assistant-wrapper {
        padding: 20px;
    }

    .article-assistant-player-controls {
        align-items: stretch;
    }

    .article-assistant-btn-settings {
        align-self: flex-start;
    }
}

/* --- Mobile Responsive --- */

@media (max-width: 640px) {
    .article-assistant-wrapper {
        padding: 16px;
        margin: 24px 0;
    }

    .article-assistant-header h3 {
        font-size: 1.1rem;
    }

    .article-assistant-header p {
        font-size: 0.85rem;
    }

    .article-assistant-ai-buttons {
        gap: 8px;
    }

    .article-assistant-ai-btn {
        padding: 7px 11px;
        font-size: 0.85rem;
    }

    .article-assistant-player-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .article-assistant-main-controls {
        justify-content: flex-start;
    }

    .article-assistant-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .article-assistant-btn-settings {
        width: fit-content;
    }

    .article-assistant-setting-row:has(.article-assistant-setting-group) {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .article-assistant-settings-actions {
        flex-direction: column;
    }

    .article-assistant-settings-actions .article-assistant-btn {
        width: 100%;
    }
}

/* --- Small Mobile Screens --- */

@media (max-width: 380px) {
    .article-assistant-main-controls {
        gap: 6px;
    }

    .article-assistant-main-controls .article-assistant-btn {
        flex: 1 1 auto;
        padding: 8px 9px;
        font-size: 0.8rem;
    }

    .article-assistant-ai-btn {
        flex: 1 1 calc(50% - 8px);
    }
}







/* Container for all buttons */
.article-assistant-ai-buttons {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 12px;       /* Space between buttons */
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Base button styles */
.article-assistant-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between icon and text */
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px; /* Pill shape */
    border: 1.5px solid transparent;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

/* Icon sizing */
.article-assistant-ai-icon {
    font-size: 16px;
}

/* --- Individual Brand Styles --- */

/* ChatGPT (Green) */
.article-assistant-ai-chatgpt {
    border-color: #10a37f;
    color: #000;
}
.article-assistant-ai-chatgpt .article-assistant-ai-icon {
    color: #10a37f;
}
.article-assistant-ai-chatgpt:hover {
    background-color: #f0fdf9;
}

/* Claude (Orange/Peach) */
.article-assistant-ai-claude {
    border-color: #d97757;
    background-color: #fdf5f2; /* Slight peach background */
    color: #000;
}
.article-assistant-ai-claude .article-assistant-ai-icon {
    color: #d97757;
}
.article-assistant-ai-claude:hover {
    background-color: #fbece7;
}

/* Gemini (Purple/Blue) */
.article-assistant-ai-gemini {
    border-color: #a47cf1;
    color: #000;
}
.article-assistant-ai-gemini .article-assistant-ai-icon {
    color: #a47cf1;
}
.article-assistant-ai-gemini:hover {
    background-color: #f7f4ff;
}

/* Grok (Black - Special Case) */
.article-assistant-ai-grok {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
}
.article-assistant-ai-grok .article-assistant-ai-icon {
    color: #ffffff;
}
.article-assistant-ai-grok:hover {
    background-color: #333333;
    border-color: #333333;
}

/* Perplexity (Teal) */
.article-assistant-ai-perplexity {
    border-color: #20b8cd;
    background-color: #f2fcfd; /* Slight teal background */
    color: #000;
}
.article-assistant-ai-perplexity .article-assistant-ai-icon {
    color: #20b8cd;
}
.article-assistant-ai-perplexity:hover {
    background-color: #e6f9fc;
}

/* DeepSeek (Blue) */
.article-assistant-ai-deepseek {
    border-color: #4d6bfe;
    background-color: #f4f6ff; /* Slight blue background */
    color: #000;
}
.article-assistant-ai-deepseek .article-assistant-ai-icon {
    color: #4d6bfe;
}
.article-assistant-ai-deepseek:hover {
    background-color: #e8ecff;
}



/* Container for all buttons */
.article-assistant-ai-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Base button styles */
.article-assistant-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between icon and text */
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px; /* Pill shape */
    border: 1.5px solid transparent;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

/* Image sizing */
.article-assistant-ai-svg {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* --- Individual Brand Styles --- */

/* ChatGPT */
.article-assistant-ai-chatgpt { border-color: #10a37f; color: #000; }
.article-assistant-ai-chatgpt:hover { background-color: #f0fdf9; }

/* Claude */
.article-assistant-ai-claude { border-color: #d97757; background-color: #fdf5f2; color: #000; }
.article-assistant-ai-claude:hover { background-color: #fbece7; }

/* Gemini */
.article-assistant-ai-gemini { border-color: #a47cf1; color: #000; }
.article-assistant-ai-gemini:hover { background-color: #f7f4ff; }

/* Grok (Black Button) */
.article-assistant-ai-grok { background-color: #000000; border-color: white; color: #ffffff; }
.article-assistant-ai-grok:hover { background-color: #333333; border-color: #333333; }
/* This forces a black Grok SVG to turn white */
.article-assistant-ai-grok .article-assistant-ai-svg { filter: invert(1); }

/* Perplexity */
.article-assistant-ai-perplexity { border-color: #20b8cd; background-color: #f2fcfd; color: #000; }
.article-assistant-ai-perplexity:hover { background-color: #e6f9fc; }

/* DeepSeek */
.article-assistant-ai-deepseek { border-color: #4d6bfe; background-color: #f4f6ff; color: #000; }
.article-assistant-ai-deepseek:hover { background-color: #e8ecff; }