/* =============================================
   Tool Common Styles
   Shared by: blog_title_generator, blog_outline_generator, meta_tags_generator
   ============================================= */

/* --- Result Container --- */
.tool-result {
    display: none;
    margin-top: 40px;
    background: #fff;
    border-radius: 24px;
    padding: 32px 40px;
    animation: toolFadeInUp 0.4s ease-out;
}

.tool-result--visible {
    display: block;
}

.tool-result__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tool-result__title {
    color: var(--say9-primary-blue, #031D3D);
    font-size: 28px;
    font-weight: 700;
    line-height: 140%;
}

.tool-result__copy {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    border: 2px solid var(--Gray-300, #DCDFEA);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tool-result__copy:hover {
    border-color: var(--Main-Blue-600, #077DFD);
    background: #F0F7FF;
}

.tool-result__copy-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--say9-primary-blue, #031D3D);
}

.tool-result__copy svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.tool-result__content {
    color: #30374F;
    font-size: 18px;
    line-height: 180%;
    word-wrap: break-word;
}

.tool-result__content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--say9-primary-blue, #031D3D);
    margin: 24px 0 12px;
}

.tool-result__content h4 {
    font-size: 20px;
    font-weight: 700;
    color: var(--say9-primary-blue, #031D3D);
    margin: 20px 0 8px;
}

.tool-result__content h5 {
    font-size: 18px;
    font-weight: 700;
    color: var(--say9-primary-blue, #031D3D);
    margin: 16px 0 8px;
}

.tool-result__content p {
    margin: 0 0 8px;
}

.tool-result__content ul,
.tool-result__content ol {
    margin: 8px 0 16px;
    padding-left: 24px;
}

.tool-result__content ul {
    list-style: disc;
}

.tool-result__content ol {
    list-style: decimal;
}

.tool-result__content li {
    margin-bottom: 4px;
}

.tool-result__content strong {
    font-weight: 700;
    color: var(--say9-primary-blue, #031D3D);
}

.tool-result__content em {
    font-style: italic;
}

.tool-result__content hr {
    border: none;
    border-top: 1px solid #EAECF5;
    margin: 16px 0;
}

.tool-result__content code {
    background: #F2F4F7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: #D6409F;
}

.tool-result__content pre {
    background: #1D2939;
    color: #E4E7EC;
    padding: 16px 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 12px 0 16px;
}

.tool-result__content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 14px;
    line-height: 170%;
}

.tool-result__content blockquote {
    border-left: 3px solid var(--Main-Blue-600, #077DFD);
    padding: 8px 16px;
    margin: 12px 0;
    color: #475467;
    background: #F9FAFB;
    border-radius: 0 8px 8px 0;
}

.tool-result__content a {
    color: var(--Main-Blue-600, #077DFD);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tool-result__content a:hover {
    color: var(--Main-Blue-500, #338FFF);
}

.tool-result__error {
    display: none;
    color: #D92D20;
    font-size: 16px;
    padding: 12px 16px;
    background: #FEF3F2;
    border-radius: 12px;
    border: 1px solid #FECDCA;
    line-height: 160%;
}

.tool-result__error--visible {
    display: block;
}

/* --- Loading Overlay --- */
.textarea {
    position: relative;
}

.textarea__loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(2px);
    border-radius: 24px;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.textarea__loading--visible {
    display: flex;
}

.textarea__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: toolSpin 0.8s linear infinite;
}

/* --- Disabled Button --- */
.textarea__button--disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* --- Form Fields (meta tags extra inputs) --- */
.textarea__field-group {
    margin-bottom: 16px;
}

.textarea__field-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.textarea__field-group--half {
    flex: 1;
}

.textarea__label {
    display: block;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 160%;
}

.textarea__required {
    color: #FCA5A5;
}

.textarea__input {
    width: 100%;
    height: 52px;
    border: 0;
    outline: none;
    border-radius: 16px;
    padding: 14px 20px;
    box-sizing: border-box;
    font-size: 18px;
    font-weight: 400;
    line-height: 160%;
    color: var(--say9-primary-blue, #031D3D);
    background: #fff;
    font-family: inherit;
}

.textarea__input::placeholder {
    color: var(--Gray-500, #7F88A2);
}

.textarea__input:focus {
    box-shadow: 0 0 0 2px rgba(7, 125, 253, 0.3);
}

/* --- Validation Error on Input --- */
.textarea__field--error,
.textarea__input--error {
    box-shadow: 0 0 0 2px rgba(217, 45, 32, 0.4);
}

/* --- Animations --- */
@keyframes toolSpin {
    to { transform: rotate(360deg); }
}

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

/* --- Responsive --- */
@media (max-width: 767.98px) {
    .tool-result {
        padding: 20px;
        margin-top: 24px;
        border-radius: 20px;
    }

    .tool-result__title {
        font-size: 22px;
    }

    .tool-result__content {
        font-size: 16px;
    }

    .textarea__field-row {
        flex-direction: column;
        gap: 0;
    }

    .textarea__input {
        font-size: 16px;
    }
}

@media (max-width: 510.98px) {
    .tool-result {
        padding: 16px;
        border-radius: 16px;
    }
}
