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


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

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

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

.specific-character-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-character-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 CHARACTER / OCCURRENCES
========================================================= */

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

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

    align-items: start;
}

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

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

    margin-bottom: 8px;

    color: #202124;

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


/* =========================================================
   TARGET CHARACTER INPUT
========================================================= */

.target-character-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-character-input::placeholder {
    color: #80868b;
}

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

.target-character-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
========================================================= */

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

    align-items: center;

    gap: 10px 22px;

    margin-top: 12px;
}

.character-option {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    color: #3c4043;

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

    cursor: pointer;

    user-select: none;
}

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

    margin: 0;

    accent-color: #1a73e8;

    cursor: pointer;
}


/* =========================================================
   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
========================================================= */

.character-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-character-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-character-textarea::placeholder {
    color: #80868b;
}

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

.specific-character-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;
}


/* =========================================================
   CHARACTER 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 WORD COUNTER CALLOUT
========================================================= */

.specific-word-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-word-callout strong {
    color: #202124;

    font-weight: 600;
}

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

    font-weight: 600;

    text-decoration: none;
}

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

    text-decoration: underline;
}


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

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

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

    color: #202124;

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

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

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

    color: #202124;

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

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

    color: #3c4043;

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

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

    font-weight: 600;
}

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

    text-decoration: none;
}

.specific-character-counter-content a:hover,
.specific-character-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 consistent with pages where the
   Raptive sidebar already works.

   Raptive can target the literal #sidebar selector.
*/

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

    min-height: 600px;

    align-self: stretch;

    position: relative;
}


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

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

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


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

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

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

        gap: 28px;
    }

}


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

   Matches the working Raptive sidebar setup:
   hide #sidebar at 992px.
========================================================= */

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

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

    .specific-character-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-character-counter-section {
        padding: 82px 16px 55px;
    }

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

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

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


    /* Target Character / Occurrences */

    .character-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-character-textarea {
        height: 300px;
        min-height: 90px;
    }

}


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

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

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

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

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


    /* Target Character / Occurrences */

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

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

        gap: 10px;
    }

    .target-character-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 */

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

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


    /* Panel Titles */

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

        font-size: 19px;
    }


    /* Textarea */

    .specific-character-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 Word Counter Callout */

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

        padding: 12px 13px;

        font-size: 14px;
    }


    /* Informational Content */

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

        font-size: 22px;
    }

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

        font-size: 18px;
    }

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

}


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

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

    /*
       Stack Target Character and Occurrences so neither
       becomes cramped.
    */

    .character-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-character-counter-section {
        padding-left: 12px;
        padding-right: 12px;
    }

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


    /* Character option */

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

        gap: 8px;
    }


    /* 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;
    }

}