/* =========================================================
   SPECIFIC WORD COUNTER
   CharacterCounter.com
========================================================= */


/* =========================================================
   PAGE / MAIN LAYOUT
========================================================= */

.specific-word-counter-main {
    width: 100%;
    background: #ffffff;
}

.specific-word-counter-section {
    width: 100%;
    padding: 68px 20px 70px;
}

.specific-word-counter-layout {
    display: grid;
    grid-template-columns: minmax(0, 760px) 300px;
    gap: 40px;

    width: 100%;
    max-width: 1100px;

    margin: 0 auto;

    align-items: stretch;
}

.specific-word-main-column {
    min-width: 0;
}


/* =========================================================
   VISUALLY HIDDEN
========================================================= */

.visually-hidden {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;

    white-space: nowrap !important;

    border: 0 !important;
}


/* =========================================================
   TOOL HEADER
========================================================= */

.tool-header {
    margin-bottom: 26px;
}

.tool-header h1 {
    margin: 0 0 12px;

    color: #202124;

    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
}

.tool-intro {
    max-width: 760px;
    margin: 0;

    color: #5f6368;

    font-size: 17px;
    line-height: 1.6;
}


/* =========================================================
   TARGET WORD / OCCURRENCES
========================================================= */

.word-search-section {
    margin-bottom: 24px;
}

.word-search-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;

    align-items: start;
}

.word-search-left {
    min-width: 0;
}

.target-word-label,
.occurrence-box-label {
    display: block;

    margin-bottom: 8px;

    color: #202124;

    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}


/* =========================================================
   TARGET WORD INPUT
========================================================= */

.target-word-input {
    display: block;

    width: 100%;
    height: 50px;

    padding: 10px 14px;

    border: 1px solid #dadce0;
    border-radius: 8px;

    background: #ffffff;
    color: #202124;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
    line-height: 1.4;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.target-word-input::placeholder {
    color: #80868b;
}

.target-word-input:hover {
    border-color: #bdc1c6;
}

.target-word-input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}


/* =========================================================
   OCCURRENCES OUTPUT
========================================================= */

.occurrence-box {
    width: 150px;
    min-width: 0;
}

.occurrence-box-value {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 150px;
    height: 50px;

    padding: 8px 12px;

    border: 1px solid #dadce0;
    border-radius: 8px;

    background: #fafafa;

    color: #1a73e8;

    font-size: 22px;
    font-weight: 700;
    line-height: 1;

    overflow-wrap: anywhere;
}


/* =========================================================
   MATCHING OPTIONS
========================================================= */

.word-options-row {
    display: flex;
    flex-wrap: wrap;

    align-items: center;

    gap: 10px 22px;

    margin-top: 12px;
}

.word-option {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    color: #3c4043;

    font-size: 14px;
    line-height: 1.4;

    cursor: pointer;

    user-select: none;
}

.word-option input[type="checkbox"] {
    width: 17px;
    height: 17px;

    margin: 0;

    accent-color: #1a73e8;

    cursor: pointer;
}


/* =========================================================
   WHOLE WORD INFO TOOLTIP
========================================================= */

.word-option-with-info {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    min-width: 0;
}

.info-tooltip-button {
    position: relative;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 17px;
    height: 17px;

    padding: 0;

    border: 1px solid #9aa0a6;
    border-radius: 50%;

    background: #ffffff;
    color: #5f6368;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;

    cursor: help;

    appearance: none;
    -webkit-appearance: none;
}

.info-tooltip-button:hover,
.info-tooltip-button:focus-visible {
    border-color: #5f6368;
    color: #3c4043;
}

.info-tooltip-button:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.info-tooltip {
    position: absolute;

    left: 50%;
    bottom: calc(100% + 9px);

    width: 240px;

    padding: 9px 11px;

    border: 1px solid #dadce0;
    border-radius: 6px;

    background: #ffffff;
    color: #3c4043;

    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;

    text-align: left;

    box-shadow:
        0 2px 8px rgba(60, 64, 67, 0.18);

    opacity: 0;
    visibility: hidden;

    transform:
        translateX(-50%)
        translateY(3px);

    transition:
        opacity 0.15s ease,
        visibility 0.15s ease,
        transform 0.15s ease;

    z-index: 30;

    pointer-events: none;
}

.info-tooltip-button:hover .info-tooltip,
.info-tooltip-button:focus .info-tooltip,
.info-tooltip-button:focus-visible .info-tooltip {
    opacity: 1;
    visibility: visible;

    transform:
        translateX(-50%)
        translateY(0);
}


/* =========================================================
   YOUR TEXT / HIGHLIGHTED MATCHES GRID
========================================================= */

.text-highlight-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;

    width: 100%;

    align-items: start;
}

.text-input-section,
.highlight-section {
    min-width: 0;
}


/* =========================================================
   PANEL TITLES
========================================================= */

.word-output-title {
    margin: 0 0 10px;

    color: #202124;

    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
}


/* =========================================================
   TEXTAREA
========================================================= */

.textarea-wrapper {
    position: relative;

    width: 100%;
}

.specific-word-textarea {
    display: block;

    width: 100%;

    height: 330px;
    min-height: 90px;

    padding: 16px 16px 58px;

    border: 1px solid #dadce0;
    border-radius: 8px;

    background: #ffffff;
    color: #202124;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.65;

    resize: vertical;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.specific-word-textarea::placeholder {
    color: #80868b;
}

.specific-word-textarea:hover {
    border-color: #bdc1c6;
}

.specific-word-textarea:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}


/* =========================================================
   TEXTAREA BUTTONS
========================================================= */

.textarea-actions {
    position: absolute;

    right: 10px;
    bottom: 10px;

    display: flex;

    gap: 7px;
}

.textarea-action-button {
    min-width: 65px;

    padding: 7px 12px;

    border: 1px solid rgba(218, 220, 224, 0.9);
    border-radius: 5px;

    background: rgba(248, 249, 250, 0.88);

    color: #3c4043;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.textarea-action-button:hover {
    border-color: rgba(189, 193, 198, 0.95);

    background: rgba(241, 243, 244, 0.95);
}

.textarea-action-button:active {
    background: rgba(232, 234, 237, 0.96);
}

.textarea-action-button:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}


/* =========================================================
   CHARACTER LIMIT MESSAGE
========================================================= */

.character-limit-message {
    margin: 7px 0 0;

    color: #d93025;

    font-size: 13px;
    line-height: 1.45;
}

.character-limit-message[hidden] {
    display: none;
}


/* =========================================================
   HIGHLIGHTED MATCHES
========================================================= */

.highlight-section {
    margin: 0;
}

.highlighted-text {
    width: 100%;

    height: 330px;
    min-height: 90px;

    overflow-y: auto;

    padding: 16px;

    border: 1px solid #dadce0;
    border-radius: 8px;

    background: #fafafa;

    color: #202124;

    font-size: 16px;
    line-height: 1.65;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.highlighted-text mark {
    padding: 1px 2px;

    border-radius: 3px;

    background: #fdd663;
    color: #202124;

    font-weight: 600;
}

.highlight-empty-message {
    color: #80868b;
}


/* =========================================================
   WORD STATISTICS
========================================================= */

.core-stats-section {
    margin: 12px 0 24px;
}

.core-stats-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    border: 1px solid #dadce0;
    border-radius: 7px;

    overflow: hidden;

    background: #ffffff;
}

.core-stat-card {
    min-width: 0;

    padding: 10px 12px;

    background: #ffffff;

    text-align: center;

    border-right: 1px solid #dadce0;
}

.core-stat-card:last-child {
    border-right: 0;
}

.core-stat-label {
    min-height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 4px;

    color: #5f6368;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;

    text-align: center;

    overflow-wrap: anywhere;
}

.core-stat-value {
    color: #1a73e8;

    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;

    overflow-wrap: anywhere;
}


/* =========================================================
   SPECIFIC CHARACTER COUNTER CALLOUT
========================================================= */

.specific-character-callout {
    margin: 0 0 42px;

    padding: 13px 15px;

    border: 1px solid #dadce0;
    border-radius: 7px;

    background: #f8f9fa;

    color: #3c4043;

    font-size: 15px;
    line-height: 1.55;
}

.specific-character-callout strong {
    color: #202124;

    font-weight: 600;
}

.specific-character-callout a {
    color: #1a73e8;

    font-weight: 600;

    text-decoration: none;
}

.specific-character-callout a:hover,
.specific-character-callout a:focus {
    color: #1558b0;

    text-decoration: underline;
}


/* =========================================================
   INFORMATIONAL CONTENT
========================================================= */

.specific-word-counter-content {
    color: #3c4043;
}

.specific-word-counter-content h2 {
    margin: 38px 0 13px;

    color: #202124;

    font-size: 25px;
    font-weight: 700;
    line-height: 1.3;
}

.specific-word-counter-content h2:first-child {
    margin-top: 0;
}

.specific-word-counter-content h3 {
    margin: 27px 0 8px;

    color: #202124;

    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
}

.specific-word-counter-content p {
    margin: 0 0 17px;

    color: #3c4043;

    font-size: 16px;
    line-height: 1.72;
}

.specific-word-counter-content strong {
    color: #202124;

    font-weight: 600;
}

.specific-word-counter-content a {
    color: #1a73e8;

    text-decoration: none;
}

.specific-word-counter-content a:hover,
.specific-word-counter-content a:focus {
    color: #1558b0;

    text-decoration: underline;
}


/* =========================================================
   RELATED TOOLS
========================================================= */

.related-tools-list {
    margin: 0 0 24px;

    padding-left: 25px;
}

.related-tools-list li {
    margin-bottom: 7px;

    color: #3c4043;

    font-size: 16px;
    line-height: 1.6;
}

.related-tools-list li::marker {
    color: #5f6368;
}


/* =========================================================
   RAPTIVE SIDEBAR
========================================================= */

/*
   Keep this structure simple.

   The working Paragraph Counter uses a literal #sidebar
   element as the dedicated 300px advertisement column.

   Raptive can target page elements using selectors, so this
   intentionally preserves that selector and a fixed 300px
   sidebar width.
*/

#sidebar {
    width: 300px;
    min-width: 300px;

    min-height: 600px;

    align-self: stretch;

    position: relative;
}


/* =========================================================
   FOCUS STATES
========================================================= */

.target-word-input:focus-visible,
.specific-word-textarea:focus-visible {
    outline: none;
}

.word-option input[type="checkbox"]:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}


/* =========================================================
   SMALLER DESKTOP
========================================================= */

@media only screen and (max-width: 1100px) {

    .specific-word-counter-layout {
        grid-template-columns:
            minmax(0, 1fr) 300px;

        gap: 28px;
    }

}


/* =========================================================
   RAPTIVE / TABLET BREAKPOINT

   This deliberately matches the working Paragraph Counter,
   which removes #sidebar at 992px.
========================================================= */

@media only screen and (max-width: 992px) {

    .specific-word-counter-section {
        padding-top: 82px;
    }

    .specific-word-counter-layout {
        display: block;

        max-width: 760px;
    }

    #sidebar {
        display: none;
    }

    .tool-header h1 {
        font-size: 32px;
    }

}


/* =========================================================
   STACK TEXT / HIGHLIGHTED MATCHES
========================================================= */

@media only screen and (max-width: 800px) {

    .text-highlight-layout {
        grid-template-columns: 1fr;

        gap: 24px;
    }

    .highlighted-text {
        height: auto !important;

        min-height: 120px;
        max-height: 350px;
    }

}


/* =========================================================
   SMALL TABLET
========================================================= */

@media only screen and (max-width: 700px) {

    .specific-word-counter-section {
        padding: 82px 16px 55px;
    }

    .tool-header {
        margin-bottom: 24px;
    }

    .tool-header h1 {
        font-size: 30px;
    }

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


    /* Target Word / Occurrences */

    .word-search-row {
        grid-template-columns:
            minmax(0, 1fr) 120px;

        gap: 14px;
    }

    .occurrence-box {
        width: 120px;
    }

    .occurrence-box-value {
        width: 120px;

        font-size: 21px;
    }


    /* Textarea */

    .specific-word-textarea {
        height: 300px;
        min-height: 90px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media only screen and (max-width: 520px) {

    .specific-word-counter-section {
        padding: 82px 14px 48px;
    }

    .tool-header h1 {
        font-size: 28px;
    }

    .tool-intro {
        font-size: 15px;
        line-height: 1.6;
    }


    /* Target Word / Occurrences */

    .target-word-label,
    .occurrence-box-label {
        font-size: 14px;
    }

    .word-search-row {
        grid-template-columns:
            minmax(0, 1fr) 105px;

        gap: 10px;
    }

    .target-word-input {
        height: 48px;

        font-size: 16px;
    }

    .occurrence-box {
        width: 105px;
    }

    .occurrence-box-value {
        width: 105px;
        height: 48px;

        padding-left: 6px;
        padding-right: 6px;

        font-size: 20px;
    }


    /* Matching Options */

    .word-options-row {
        gap: 8px 14px;
    }

    .word-option {
        font-size: 13px;
    }


    /* Tooltip */

    .info-tooltip {
        left: auto;
        right: -10px;

        width: 220px;

        transform: translateY(3px);
    }

    .info-tooltip-button:hover .info-tooltip,
    .info-tooltip-button:focus .info-tooltip,
    .info-tooltip-button:focus-visible .info-tooltip {
        transform: translateY(0);
    }


    /* Panel Titles */

    .word-output-title {
        margin-bottom: 8px;

        font-size: 19px;
    }


    /* Textarea */

    .specific-word-textarea {
        height: 270px;
        min-height: 90px;

        padding: 14px 14px 58px;

        font-size: 16px;
    }

    .textarea-actions {
        right: 8px;
        bottom: 8px;
    }

    .textarea-action-button {
        padding: 7px 11px;

        font-size: 13px;
    }


    /* Highlighted Matches */

    .highlighted-text {
        min-height: 110px;
        max-height: 320px;

        padding: 14px;

        font-size: 15px;
    }


    /* Statistics */

    .core-stats-section {
        margin-top: 10px;
    }

    .core-stats-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .core-stat-card {
        padding: 9px 5px;
    }

    .core-stat-label {
        min-height: 32px;

        font-size: 12px;
        line-height: 1.2;
    }

    .core-stat-value {
        margin-top: 3px;

        font-size: 19px;
    }


    /* Specific Character Counter Callout */

    .specific-character-callout {
        margin-bottom: 36px;

        padding: 12px 13px;

        font-size: 14px;
    }


    /* Informational Content */

    .specific-word-counter-content h2 {
        margin-top: 32px;

        font-size: 22px;
    }

    .specific-word-counter-content h3 {
        margin-top: 24px;

        font-size: 18px;
    }

    .specific-word-counter-content p,
    .related-tools-list li {
        font-size: 15.5px;
    }

}


/* =========================================================
   NARROW MOBILE
========================================================= */

@media only screen and (max-width: 420px) {

    .word-search-row {
        grid-template-columns: 1fr;
    }

    .occurrence-box {
        width: 120px;
    }

    .occurrence-box-value {
        width: 120px;
    }

}


/* =========================================================
   VERY SMALL SCREENS
========================================================= */

@media only screen and (max-width: 360px) {

    .specific-word-counter-section {
        padding-left: 12px;
        padding-right: 12px;
    }

    .tool-header h1 {
        font-size: 26px;
    }


    /* Matching options */

    .word-options-row {
        display: grid;
        grid-template-columns: 1fr;

        gap: 8px;
    }

    .word-option-with-info {
        width: fit-content;
    }


    /* Keep all three metrics in one row */

    .core-stat-card {
        padding-left: 3px;
        padding-right: 3px;
    }

    .core-stat-label {
        min-height: 30px;

        font-size: 11px;
    }

    .core-stat-value {
        font-size: 18px;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }

}