/* ========================================
   HAIRCOLORGPT CHAT SHARE STYLES
   Replica esatta dello stile della chat nativa
   ======================================== */

/* Typography uses the shared UI font stack loaded via hcgpt-ui-fonts (Google Fonts). */

/* Reset e base */
.hcgpt-chat-share {
    line-height: var(--hcgpt-line-height-160);
    font-family: var(--hcgpt-font-sans);
    max-width: 800px;
    margin: -16px auto 0 auto;
    padding: 20px;
}

/* Header della chat */
.hcgpt-chat-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.hcgpt-chat-title {
    font-size: var(--hcgpt-font-size-30);
    font-weight: var(--hcgpt-font-weight-bold);
    color: #1bbbb4;
    margin: 0 0 10px 0;
    line-height: var(--hcgpt-line-height-120);
    font-family: var(--hcgpt-font-heading);
}

.hcgpt-chat-subtitle {
    font-size: var(--hcgpt-font-size-18);
    color: #6c757d;
    font-weight: var(--hcgpt-font-weight-medium);
    margin: 0;
    font-family: var(--hcgpt-font-sans);
}

/* Contenuto principale */
.hcgpt-chat-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-left: 35px;
}

/* Themify Parallax replicated styles for bot messages */
.hcgpt-chat-share .hcgpt-message.bot {
    font-family: var(--hcgpt-font-sans);
}

/* Headings - replicated from Themify Parallax */
.hcgpt-chat-share .hcgpt-message.bot h1 {
    font-size: var(--hcgpt-font-size-35);
    font-weight: var(--hcgpt-font-weight-black);
    color: #1bbbb4;
    font-family: var(--hcgpt-font-heading);
    margin: 20px 0 15px 0;
    line-height: var(--hcgpt-line-height-120);
}

.hcgpt-chat-share .hcgpt-message.bot h2 {
    font-size: var(--hcgpt-font-size-32);
    font-weight: var(--hcgpt-font-weight-semibold);
    color: #fc74c5;
    font-family: var(--hcgpt-font-heading);
    margin: 18px 0 12px 0;
    line-height: var(--hcgpt-line-height-130);
    position: relative;
}

.hcgpt-chat-share .hcgpt-message.bot h2::before {
    content: none !important;
    /* Remove asterisk to avoid duplication with bot icon */
}

.hcgpt-chat-share .hcgpt-message.bot h3 {
    font-size: var(--hcgpt-font-size-25);
    font-weight: var(--hcgpt-font-weight-medium);
    color: #8cc53f;
    font-family: var(--hcgpt-font-heading);
    text-transform: var(--hcgpt-text-transform-uppercase);
    margin: 15px 0 10px 0;
    line-height: var(--hcgpt-line-height-130);
}

.hcgpt-chat-share .hcgpt-message.bot h4 {
    font-size: var(--hcgpt-font-size-22);
    font-weight: var(--hcgpt-font-weight-medium);
    color: #444444;
    font-family: var(--hcgpt-font-heading);
    margin: 12px 0 8px 0;
    line-height: var(--hcgpt-line-height-130);
}

.hcgpt-chat-share .hcgpt-message.bot h5 {
    font-size: var(--hcgpt-font-size-18);
    font-weight: var(--hcgpt-font-weight-medium);
    color: #444444;
    font-family: var(--hcgpt-font-heading);
    margin: 10px 0 6px 0;
    line-height: var(--hcgpt-line-height-130);
}

.hcgpt-chat-share .hcgpt-message.bot h6 {
    font-size: var(--hcgpt-font-size-16);
    font-weight: var(--hcgpt-font-weight-medium);
    color: #444444;
    font-family: var(--hcgpt-font-heading);
    margin: 8px 0 5px 0;
    line-height: var(--hcgpt-line-height-130);
}

/* Body text */
.hcgpt-chat-share .hcgpt-message.bot p {
    font-size: var(--hcgpt-font-size-14);
    font-weight: var(--hcgpt-font-weight-regular);
    color: #444444;
    font-family: var(--hcgpt-font-sans);
    line-height: var(--hcgpt-line-height-160);
    margin: 0 0 12px 0;
}

/* Strong and emphasis */
.hcgpt-chat-share .hcgpt-message.bot strong {
    font-weight: var(--hcgpt-font-weight-bold);
    color: #444444;
    font-family: var(--hcgpt-font-sans);
}

.hcgpt-chat-share .hcgpt-message.bot em {
    font-style: italic;
    color: #444444;
    font-family: var(--hcgpt-font-sans);
}

/* Lists - replicated Themify style */
.hcgpt-chat-share .hcgpt-message.bot ul {
    list-style: none;
    padding-left: 0;
    margin: 15px 0;
}

.hcgpt-chat-share .hcgpt-message.bot ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: var(--hcgpt-font-size-14);
    font-weight: var(--hcgpt-font-weight-regular);
    color: #444444;
    font-family: var(--hcgpt-font-sans);
    line-height: var(--hcgpt-line-height-160);
}

.hcgpt-chat-share .hcgpt-message.bot ul li::before {
    content: "•" !important;
    /* Keep bullet but ensure it's consistent */
    color: #fc74c5 !important;
    font-weight: var(--hcgpt-font-weight-bold) !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
}

/* Ordered lists with Themify style numbering */
.hcgpt-chat-share .hcgpt-message.bot ol {
    list-style: none;
    counter-reset: list-item;
    padding-left: 0;
    margin: 15px 0;
}

.hcgpt-chat-share .hcgpt-message.bot ol li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 8px;
    font-size: var(--hcgpt-font-size-14);
    font-weight: var(--hcgpt-font-weight-regular);
    color: #444444;
    font-family: var(--hcgpt-font-sans);
    line-height: var(--hcgpt-line-height-160);
    counter-increment: list-item;
}

.hcgpt-chat-share .hcgpt-message.bot ol li::before {
    content: counter(list-item) ". " !important;
    /* Keep numbering but ensure it's consistent */
    color: #fc74c5 !important;
    font-weight: var(--hcgpt-font-weight-bold) !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
}

/* Code blocks */
.hcgpt-chat-share .hcgpt-message.bot code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--hcgpt-font-mono);
    font-size: var(--hcgpt-font-size-13);
    color: #333;
}

.hcgpt-chat-share .hcgpt-message.bot pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 15px 0;
}

.hcgpt-chat-share .hcgpt-message.bot pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* Links with hover color */
.hcgpt-chat-share .hcgpt-message.bot a {
    color: #fc74c5;
    text-decoration: none;
    font-family: var(--hcgpt-font-sans);
}

.hcgpt-chat-share .hcgpt-message.bot a:hover {
    color: #f06eaa;
    text-decoration: underline;
}

/* Bot message wrapper and icon styles */
.hcgpt-chat-share .hcgpt-message.bot .hcgpt-message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.hcgpt-chat-share .hcgpt-message.bot .hcgpt-message-star-icon {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
    animation: none !important;
    /* Ensure no animations in public chat */
}

/* RIMOSSI STILI SPECIFICI: ora usiamo quelli definiti in frontend.css */

/* Bot-message headings rendered inside .hcgpt-chat-bubble (single-chat.php and
   public-share.php templates). Without these rules, h1..h6 inherit color from the
   surrounding WP theme (e.g. Parallax: #424242), which is invisible on the
   chat-share dark background. Brand-color keeps contrast in both light and dark. */
.hcgpt-chat-share .hcgpt-chat-bubble h1,
.hcgpt-chat-share .hcgpt-chat-bubble h2,
.hcgpt-chat-share .hcgpt-chat-bubble h3,
.hcgpt-chat-share .hcgpt-chat-bubble h4,
.hcgpt-chat-share .hcgpt-chat-bubble h5,
.hcgpt-chat-share .hcgpt-chat-bubble h6 {
    color: #1bbbb4;
}

/* Responsive */
@media (max-width: 767.98px) {
    .hcgpt-chat-share {
        padding: 15px;
    }

    .hcgpt-chat-title {
        font-size: var(--hcgpt-font-size-32);
    }

    .hcgpt-chat-content {
        padding: 20px;
    }

    /* Responsive adjustments for headings */
    .hcgpt-chat-share .hcgpt-message.bot h1 {
        font-size: var(--hcgpt-font-size-28);
    }

    .hcgpt-chat-share .hcgpt-message.bot h2 {
        font-size: var(--hcgpt-font-size-24);
    }

    .hcgpt-chat-share .hcgpt-message.bot h3 {
        font-size: var(--hcgpt-font-size-20);
    }
}

.hcgpt-chat-question {
    background: #e8e8e8 !important;
    /* Bubble background is always light (#e8e8e8) across themes: fix color to dark
       instead of inheriting theme tokens, otherwise dark-theme inherited color on a
       light bubble produces invisible text. Was previously forced via inline style
       `style="color:#000000;"` in single-chat.php (violated CLAUDE.md §3D). */
    color: #1A1A1A !important;
    align-self: flex-end !important;
    border-bottom-right-radius: 4px !important;
    text-align: left !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    padding: 12px 16px !important;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-bottom-left-radius: 18px;
    max-width: 85% !important;
    line-height: var(--hcgpt-line-height-150) !important;
    word-wrap: break-word !important;
    margin-bottom: 10px !important;
    position: relative !important;
    /* remove forced bold */
}

/* Footer della chat */
.hcgpt-chat-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: var(--hcgpt-font-size-14);
}












/* ========================================
   Chat Share Modal (migrated from frontend.css)
   ======================================== */

/* ---------- 25. POPUP CONDIVISIONE STILE GEMINI -------------------- */
.hcgpt-share-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: var(--hcgpt-overlay-backdrop-bg, rgba(0, 0, 0, 0.6)) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 2147483646 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    animation: fadeIn 0.15s ease-out !important;
}

.hcgpt-share-modal {
    max-width: 552px !important;
    width: 90% !important;
    background: var(--hcgpt-overlay-bg, var(--hcgpt-color-surface, #fff)) !important;
    color: var(--hcgpt-color-text, #202124) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
    animation: slideUp 0.15s ease-out !important;
    overflow: hidden !important;
    font-family: var(--hcgpt-font-sans) !important;
    z-index: 2147483647 !important;
}

.hcgpt-share-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 24px 24px 16px 24px !important;
    border-bottom: none !important;
}

.hcgpt-share-title {
    font-size: var(--hcgpt-font-size-22) !important;
    font-weight: var(--hcgpt-font-weight-semibold) !important;
    color: var(--hcgpt-type-structural-strong) !important;
    margin: 0 !important;
    line-height: var(--hcgpt-line-height-130) !important;
    font-family: var(--hcgpt-font-sans) !important;
    text-transform: var(--hcgpt-text-transform-uppercase) !important;
    letter-spacing: var(--hcgpt-letter-spacing-003em) !important;
}

.hcgpt-share-close {
    background: none !important;
    border: none !important;
    color: #5f6368 !important;
    cursor: pointer !important;
    padding: 8px !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.2s ease !important;
}

.hcgpt-share-close:hover {
    background-color: #f1f3f4 !important;
}

.hcgpt-share-body {
    padding: 0 24px 24px 24px !important;
}

/* Container del link */
.hcgpt-link-container {
    background: #f8f9fa !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.hcgpt-share-link-display {
    flex: 1 !important;
    font-size: var(--hcgpt-font-size-14) !important;
    color: #1a73e8 !important;
    text-decoration: none !important;
    font-family: var(--hcgpt-font-mono) !important;
    word-break: break-all !important;
    line-height: var(--hcgpt-line-height-140) !important;
}

.hcgpt-share-link-display:hover {
    text-decoration: underline !important;
}

.hcgpt-share-copy {
    background: #1a73e8 !important;
    color: white !important;
    border: none !important;
    padding: 10px 16px !important;
    border-radius: 24px !important;
    font-size: var(--hcgpt-font-size-14) !important;
    font-weight: var(--hcgpt-font-weight-medium) !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: auto !important;
    white-space: nowrap !important;
}

.hcgpt-share-copy:hover {
    background: #1557b0 !important;
}

/* Disclaimer */
.hcgpt-disclaimer {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 16px !important;
    background: #fefefe !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
}

.hcgpt-info-icon {
    color: #5f6368 !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
}

.hcgpt-disclaimer-text {
    font-size: var(--hcgpt-font-size-14) !important;
    color: #5f6368 !important;
    line-height: var(--hcgpt-line-height-150) !important;
}

.hcgpt-disclaimer-text a {
    color: #1a73e8 !important;
    text-decoration: none !important;
}

.hcgpt-disclaimer-text a:hover {
    text-decoration: underline !important;
}

/* Divider */
.hcgpt-divider {
    height: 1px !important;
    background: #e8eaed !important;
    margin: 20px 0 !important;
}

/* Social Media Container */
.hcgpt-social-container {
    display: flex !important;
    justify-content: space-between !important;
    gap: 16px !important;
}

.hcgpt-social-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
}

.hcgpt-social-btn {
    background: #f8f9fa !important;
    border: none !important;
    border-radius: 50% !important;
    width: 64px !important;
    height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
}

.hcgpt-social-btn:hover {
    background: #f1f3f4 !important;
    transform: translateY(-1px) !important;
}

.hcgpt-social-btn svg {
    width: 48px !important;
    height: 48px !important;
}

.hcgpt-social-label {
    font-size: var(--hcgpt-font-size-14) !important;
    color: #5f6368 !important;
    font-weight: var(--hcgpt-font-weight-regular) !important;
    text-align: center !important;
}

/* Animazioni per il popup */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive per il popup stile Gemini */
@media (max-width: 600px) {
    .hcgpt-share-modal {
        width: 95% !important;
        max-width: 95% !important;
        margin: 20px auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }

    .hcgpt-share-header {
        padding: 20px 20px 12px 20px !important;
    }

    .hcgpt-share-title {
        font-size: var(--hcgpt-font-size-20) !important;
    }

    .hcgpt-share-body {
        padding: 0 20px 20px 20px !important;
    }

    .hcgpt-link-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .hcgpt-share-copy {
        width: 100% !important;
        justify-content: center !important;
    }

    .hcgpt-social-container {
        flex-wrap: wrap !important;
        gap: 12px !important;
        justify-content: center !important;
    }

    .hcgpt-social-item {
        flex: 0 0 calc(50% - 6px) !important;
        max-width: calc(50% - 6px) !important;
    }

    .hcgpt-social-btn {
        width: 56px !important;
        height: 56px !important;
    }

    .hcgpt-social-btn svg {
        width: 42px !important;
        height: 42px !important;
    }

    .hcgpt-disclaimer {
        padding: 12px !important;
    }
}

/* Dark theme overrides */
:where(.hcgpt-scope[data-hcgpt-theme="dark"]) .hcgpt-share-title {
    color: var(--hcgpt-color-text) !important;
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) .hcgpt-share-close {
    color: var(--hcgpt-color-text-muted) !important;
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) .hcgpt-share-close:hover {
    background-color: var(--hcgpt-color-surface-2) !important;
    color: var(--hcgpt-color-text) !important;
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) .hcgpt-link-container {
    background: var(--hcgpt-color-surface-2) !important;
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) .hcgpt-share-link-display {
    color: var(--hcgpt-accent) !important;
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) .hcgpt-share-copy {
    background: var(--hcgpt-accent) !important;
    color: var(--hcgpt-color-on-primary) !important;
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) .hcgpt-disclaimer {
    background: var(--hcgpt-color-surface-2) !important;
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) .hcgpt-info-icon {
    color: var(--hcgpt-color-text-muted) !important;
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) .hcgpt-disclaimer-text {
    color: var(--hcgpt-color-text-muted) !important;
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) .hcgpt-disclaimer-text a {
    color: var(--hcgpt-accent) !important;
}

@media (prefers-color-scheme: dark) {
    :where(.hcgpt-scope[data-hcgpt-theme="system"]) .hcgpt-share-title {
        color: var(--hcgpt-color-text) !important;
    }

    :where(.hcgpt-scope[data-hcgpt-theme="system"]) .hcgpt-share-close {
        color: var(--hcgpt-color-text-muted) !important;
    }

    :where(.hcgpt-scope[data-hcgpt-theme="system"]) .hcgpt-share-close:hover {
        background-color: var(--hcgpt-color-surface-2) !important;
        color: var(--hcgpt-color-text) !important;
    }

    :where(.hcgpt-scope[data-hcgpt-theme="system"]) .hcgpt-link-container {
        background: var(--hcgpt-color-surface-2) !important;
    }

    :where(.hcgpt-scope[data-hcgpt-theme="system"]) .hcgpt-share-link-display {
        color: var(--hcgpt-accent) !important;
    }

    :where(.hcgpt-scope[data-hcgpt-theme="system"]) .hcgpt-share-copy {
        background: var(--hcgpt-accent) !important;
        color: var(--hcgpt-color-on-primary) !important;
    }

    :where(.hcgpt-scope[data-hcgpt-theme="system"]) .hcgpt-disclaimer {
        background: var(--hcgpt-color-surface-2) !important;
    }

    :where(.hcgpt-scope[data-hcgpt-theme="system"]) .hcgpt-info-icon {
        color: var(--hcgpt-color-text-muted) !important;
    }

    :where(.hcgpt-scope[data-hcgpt-theme="system"]) .hcgpt-disclaimer-text {
        color: var(--hcgpt-color-text-muted) !important;
    }

    :where(.hcgpt-scope[data-hcgpt-theme="system"]) .hcgpt-disclaimer-text a {
        color: var(--hcgpt-accent) !important;
    }
}
