/* Help Metric Article Helpful Feedback - Frontend Styles */

.help-metric-article-helpful-feedback-widget {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px;
    margin: 40px 0;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.help-metric-article-helpful-feedback-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.help-metric-article-helpful-feedback-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
    line-height: 1.4;
}

.help-metric-article-helpful-feedback-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.article-helpful-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: .875rem;
    line-height: 1.25rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    background: transparent;
}

.article-helpful-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.article-helpful-btn-yes {
    background: #16a249;
    color: white;
    border: 1px solid #16a249;
}

.article-helpful-btn-yes:hover {
    background: #15803d;
    border-color: #15803d;
    transform: translateY(-1px);
}

.article-helpful-btn-no {
    background: white;
    color: #f59f0a;
    border: 1px solid #f59f0a4d;
}

.article-helpful-btn-no:hover {
    background: #f59f0a1a;
    color: #0f172a;
    border-color: #f59f0a4d;
    transform: translateY(-1px);
}

.article-helpful-btn-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
}

/*
 * Neutralise any theme CSS counters / ::before content that could inject
 * stray characters (e.g. "1") in front of the widget's text nodes.
 * Scoped tightly so we don't affect the loading-spinner ::after on buttons.
 */
.help-metric-article-helpful-feedback-widget .help-metric-article-helpful-feedback-title::before,
.help-metric-article-helpful-feedback-widget .help-metric-article-helpful-feedback-title::after,
.help-metric-article-helpful-feedback-widget .help-metric-article-helpful-feedback-subtitle::before,
.help-metric-article-helpful-feedback-widget .help-metric-article-helpful-feedback-subtitle::after,
.help-metric-article-helpful-feedback-widget .help-metric-article-helpful-feedback-buttons::before,
.help-metric-article-helpful-feedback-widget .help-metric-article-helpful-feedback-buttons::after,
.help-metric-article-helpful-feedback-widget .article-helpful-btn-icon::before,
.help-metric-article-helpful-feedback-widget .article-helpful-btn-icon::after {
    content: none !important;
    display: none !important;
}

/* SVG icons inside buttons inherit button colour */
.article-helpful-btn-icon svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.15s ease;
}

.article-helpful-btn:hover .article-helpful-btn-icon svg {
    transform: scale(1.15);
}

/* Per-style colour overrides for the form icon (shown in the feedback form) */
.help-metric-article-helpful-feedback-form-icon svg {
    display: block;
    width: 36px;
    height: 36px;
    fill: currentColor;
}

/*
 * The yes-button always has a green background (#16a249) with color:white.
 * Icons inside it inherit white via currentColor — no override needed.
 * Only override icons on the no-button, which has a white/transparent background.
 */

/* Stars — no button grey */
.hmahf-icon-style-stars .article-helpful-btn-no  .article-helpful-btn-icon svg { color: #9ca3af; }

/* Hearts — no button grey */
.hmahf-icon-style-hearts .article-helpful-btn-no  .article-helpful-btn-icon svg { color: #9ca3af; }

/* Faces — no button amber */
.hmahf-icon-style-faces .article-helpful-btn-no  .article-helpful-btn-icon svg { color: #f59e0b; }

/* Arrows — down button red */
.hmahf-icon-style-arrows .article-helpful-btn-no  .article-helpful-btn-icon svg { color: #dc2626; }

/* Feedback Form for Negative Response */
.help-metric-article-helpful-feedback-form {
    display: none;
    text-align: center;
    padding-top: 20px;
}

.help-metric-article-helpful-feedback-form.show {
    display: block;
}

.help-metric-article-helpful-feedback-form-icon {
    font-size: 32px;
    margin-bottom: 16px;
    color: #f59e0b;
    display: flex;
    justify-content: center;
    align-items: center;
}

.help-metric-article-helpful-feedback-form-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.help-metric-article-helpful-feedback-form-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.help-metric-article-helpful-feedback-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
}

.help-metric-article-helpful-feedback-textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.help-metric-article-helpful-feedback-textarea::placeholder {
    color: #9ca3af;
}

.help-metric-article-helpful-feedback-form-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.help-metric-article-helpful-feedback-form-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #6b7280;
    font-size: .875rem;
    line-height: 1.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.help-metric-article-helpful-feedback-form-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.help-metric-article-helpful-feedback-form-btn.send {
    background: #9ca3af;
    color: white;
    border-color: #9ca3af;
}

.help-metric-article-helpful-feedback-form-btn.send.active {
    background: #1f2937;
    color: white;
    border-color: #1f2937;
}

.help-metric-article-helpful-feedback-form-btn.send.active:hover {
    background: #111827;
    border-color: #111827;
}

/* Error Message */
.help-metric-article-helpful-feedback-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 12px;
    margin: 12px 0;
    text-align: center;
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
}
.help-metric-article-helpful-feedback-success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 20px 32px;
    margin: 40px 0;
    text-align: center;
    color: #15803d;
    font-size: 15px;
    font-weight: 500;
}

.help-metric-article-helpful-feedback-success.show {
    display: block;
}

/* Loading State */
.article-helpful-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.article-helpful-btn.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: help-metric-article-helpful-feedback-spin 0.8s linear infinite;
}

@keyframes help-metric-article-helpful-feedback-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Vote change link */
.hmahf-change-vote {
    margin-top: 10px;
    font-size: 13px;
}

.hmahf-change-vote-link {
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
}

.hmahf-change-vote-link:hover {
    color: #374151;
}

/* Highlight widget when in vote-change mode */
.help-metric-article-helpful-feedback-widget.hmahf-changing-vote {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ==========================================================================
   Layout 2 – Gradient Card
   ========================================================================== */
.help-metric-article-helpful-feedback-widget.hmahf-layout2 {
    background: linear-gradient(135deg, #16a249 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(22, 162, 73, 0.35);
    color: #fff;
}

.hmahf-layout2 .help-metric-article-helpful-feedback-title {
    color: #ffffff;
    font-size: 20px;
}

.hmahf-layout2 .help-metric-article-helpful-feedback-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

.hmahf-layout2 .article-helpful-btn-yes {
    background: #ffffff;
    color: #059669;
    border-color: #ffffff;
    font-weight: 600;
}

.hmahf-layout2 .article-helpful-btn-yes:hover {
    background: #f0fdf4;
    border-color: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hmahf-layout2 .article-helpful-btn-no {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
}

.hmahf-layout2 .article-helpful-btn-no:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.hmahf-layout2 .help-metric-article-helpful-feedback-success {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* ==========================================================================
   Layout 3 – Minimal Bar
   ========================================================================== */
.help-metric-article-helpful-feedback-widget.hmahf-layout3 {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 24px;
    margin: 32px 0;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 2px 16px;
    text-align: left;
    box-shadow: none;
}

.hmahf-layout3 .help-metric-article-helpful-feedback-title {
    grid-column: 1;
    grid-row: 1;
    font-size: 15px;
    margin: 0;
}

.hmahf-layout3 .help-metric-article-helpful-feedback-subtitle {
    grid-column: 1;
    grid-row: 2;
    font-size: 13px;
    margin: 0;
    color: #9ca3af;
}

.hmahf-layout3 .help-metric-article-helpful-feedback-buttons {
    grid-column: 2;
    grid-row: 1 / 3;
    justify-content: flex-end;
    flex-shrink: 0;
    align-self: center;
}

.hmahf-layout3 .article-helpful-btn {
    min-width: 90px;
    padding: 6px 14px;
    font-size: 0.8125rem;
}

/* ==========================================================================
   Layout 4 – Dark Mode
   ========================================================================== */
.help-metric-article-helpful-feedback-widget.hmahf-layout4 {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    color: #f9fafb;
}

.hmahf-layout4 .help-metric-article-helpful-feedback-title {
    color: #f3f4f6;
    font-size: 19px;
}

.hmahf-layout4 .help-metric-article-helpful-feedback-subtitle {
    color: #9ca3af;
}

.hmahf-layout4 .article-helpful-btn-yes {
    background: #16a249;
    border-color: #16a249;
    color: #ffffff;
}

.hmahf-layout4 .article-helpful-btn-yes:hover {
    background: #15803d;
    border-color: #15803d;
    box-shadow: 0 0 0 3px rgba(22, 162, 73, 0.3);
}

.hmahf-layout4 .article-helpful-btn-no {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

.hmahf-layout4 .article-helpful-btn-no:hover {
    background: #4b5563;
    color: #f9fafb;
    border-color: #6b7280;
}

.hmahf-layout4 .help-metric-article-helpful-feedback-textarea {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.hmahf-layout4 .help-metric-article-helpful-feedback-textarea:focus {
    border-color: #16a249;
}

.hmahf-layout4 .help-metric-article-helpful-feedback-textarea::placeholder {
    color: #6b7280;
}

.hmahf-layout4 .help-metric-article-helpful-feedback-form-title {
    color: #f3f4f6;
}

.hmahf-layout4 .help-metric-article-helpful-feedback-form-subtitle,
.hmahf-layout4 .help-metric-article-helpful-feedback-form-btn {
    color: #9ca3af;
}

.hmahf-layout4 .help-metric-article-helpful-feedback-form-btn {
    background: #374151;
    border-color: #4b5563;
}

.hmahf-layout4 .help-metric-article-helpful-feedback-form-btn:hover {
    background: #4b5563;
    color: #f3f4f6;
}

.hmahf-layout4 .help-metric-article-helpful-feedback-success {
    background: #14532d;
    border-color: #166534;
    color: #86efac;
}

/* ==========================================================================
   Layout 5 – Bordered Accent
   ========================================================================== */
.help-metric-article-helpful-feedback-widget.hmahf-layout5 {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 5px solid #16a249;
    border-radius: 0 8px 8px 0;
    padding: 28px 32px;
    margin: 40px 0;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.hmahf-layout5 .help-metric-article-helpful-feedback-title {
    font-size: 17px;
    color: #111827;
}

.hmahf-layout5 .help-metric-article-helpful-feedback-subtitle {
    font-size: 14px;
    color: #6b7280;
}

.hmahf-layout5 .help-metric-article-helpful-feedback-buttons {
    justify-content: flex-start;
}

.hmahf-layout5 .article-helpful-btn-yes {
    background: #16a249;
    border-color: #16a249;
}

.hmahf-layout5 .article-helpful-btn-yes:hover {
    background: #15803d;
    border-color: #15803d;
}

.hmahf-layout5 .article-helpful-btn-no {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.hmahf-layout5 .article-helpful-btn-no:hover {
    background: #f9fafb;
    color: #111827;
}

/* Responsive Design */
@media (max-width: 600px) {
    .help-metric-article-helpful-feedback-widget {
        padding: 24px 16px;
        margin: 30px 0;
    }

    /* Minimal Bar collapses to single-column grid on mobile */
    .help-metric-article-helpful-feedback-widget.hmahf-layout3 {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .hmahf-layout3 .help-metric-article-helpful-feedback-buttons {
        grid-column: 1;
        grid-row: 3;
        width: 100%;
        justify-content: flex-start;
    }

    /* Bordered Accent padding on mobile */
    .help-metric-article-helpful-feedback-widget.hmahf-layout5 {
        padding: 20px 16px;
    }
    
    .help-metric-article-helpful-feedback-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .article-helpful-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 400px) {
    .help-metric-article-helpful-feedback-widget {
        padding: 20px 12px;
    }
    
    .help-metric-article-helpful-feedback-title {
        font-size: 16px;
    }
    
    .help-metric-article-helpful-feedback-subtitle {
        font-size: 13px;
    }
}