/* =====================================================
   SORT TEXT ALPHABETICALLY
   CSS PART 1
   GLOBAL + HERO + TOOL LAYOUT
===================================================== */

.fote-sort-page {
    --fote-sort-primary: #6d5dfc;
    --fote-sort-primary-dark: #5547d9;
    --fote-sort-secondary: #8b7fff;
    --fote-sort-text: #1f2937;
    --fote-sort-muted: #6b7280;
    --fote-sort-bg: #f7f8fc;
    --fote-sort-white: #ffffff;
    --fote-sort-border: #e5e7eb;
    --fote-sort-success: #16a34a;
    --fote-sort-danger: #dc2626;
    --fote-sort-shadow: 0 18px 45px rgba(31, 41, 55, 0.08);

    width: 100%;
    color: var(--fote-sort-text);
    background: var(--fote-sort-bg);
    font-family: Inter, Arial, sans-serif;
    line-height: 1.7;
}

.fote-sort-page *,
.fote-sort-page *::before,
.fote-sort-page *::after {
    box-sizing: border-box;
}

.fote-sort-page h1,
.fote-sort-page h2,
.fote-sort-page h3,
.fote-sort-page p {
    margin-top: 0;
}

.fote-sort-page button,
.fote-sort-page textarea,
.fote-sort-page input {
    font: inherit;
}

.fote-sort-page button,
.fote-sort-page a {
    -webkit-tap-highlight-color: transparent;
}

.fote-sort-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}


/* =====================================================
   HERO
===================================================== */

.fote-sort-hero {
    position: relative;
    overflow: hidden;
    padding: 88px 0 110px;
    text-align: center;
    color: var(--fote-sort-white);
    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(255, 255, 255, 0.18),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 20%,
            rgba(255, 255, 255, 0.12),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            var(--fote-sort-primary),
            var(--fote-sort-secondary)
        );
}

.fote-sort-hero::before,
.fote-sort-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.fote-sort-hero::before {
    width: 260px;
    height: 260px;
    left: -100px;
    bottom: -120px;
}

.fote-sort-hero::after {
    width: 190px;
    height: 190px;
    right: -60px;
    top: -75px;
}

.fote-sort-hero .fote-sort-container {
    position: relative;
    z-index: 1;
}

.fote-sort-hero h1 {
    max-width: 860px;
    margin: 0 auto 18px;
    font-size: clamp(38px, 6vw, 66px);
    line-height: 1.08;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.fote-sort-subtitle {
    max-width: 780px;
    margin: 0 auto;
    font-size: clamp(17px, 2.2vw, 21px);
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.9);
}

.fote-sort-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.fote-sort-badges span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 14px;
    font-weight: 700;
}


/* =====================================================
   TOOL WRAPPER
===================================================== */

.fote-sort-tool {
    position: relative;
    z-index: 2;
    margin-top: -62px;
    padding-bottom: 34px;
}

.fote-sort-tool-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.85);
    border-radius: 24px;
    background: var(--fote-sort-white);
    box-shadow: var(--fote-sort-shadow);
}

.fote-sort-left,
.fote-sort-right {
    min-width: 0;
    padding: 28px;
}

.fote-sort-left {
    border-right: 1px solid var(--fote-sort-border);
}

.fote-sort-right {
    background: #fbfbfe;
}


/* =====================================================
   TOOL HEADINGS
===================================================== */

.fote-sort-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.fote-sort-heading h2 {
    margin-bottom: 0;
    font-size: 21px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.fote-sort-heading button,
.fote-sort-sample-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid var(--fote-sort-border);
    border-radius: 10px;
    color: var(--fote-sort-primary);
    background: var(--fote-sort-white);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.fote-sort-heading button:hover,
.fote-sort-sample-btn:hover {
    color: var(--fote-sort-white);
    border-color: var(--fote-sort-primary);
    background: var(--fote-sort-primary);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(109, 93, 252, 0.2);
}

.fote-sort-heading button:focus-visible,
.fote-sort-sample-btn:focus-visible {
    outline: 3px solid rgba(109, 93, 252, 0.2);
    outline-offset: 2px;
}


/* =====================================================
   TEXTAREAS
===================================================== */

.fote-sort-left textarea,
.fote-sort-right textarea {
    display: block;
    width: 100%;
    min-height: 350px;
    padding: 18px;
    resize: vertical;
    border: 1px solid var(--fote-sort-border);
    border-radius: 14px;
    color: var(--fote-sort-text);
    background: var(--fote-sort-white);
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;
    font-size: 15px;
    line-height: 1.7;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.fote-sort-right textarea {
    background: #ffffff;
}

.fote-sort-left textarea::placeholder,
.fote-sort-right textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.fote-sort-left textarea:focus,
.fote-sort-right textarea:focus {
    border-color: var(--fote-sort-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.12);
}

.fote-sort-right textarea[readonly] {
    cursor: text;
}


/* =====================================================
   STATS
===================================================== */

.fote-sort-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 15px;
    color: var(--fote-sort-muted);
    font-size: 14px;
}

.fote-sort-stats span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.fote-sort-stats strong {
    color: var(--fote-sort-primary);
    font-weight: 800;
}


/* =====================================================
   RESPONSIVE PART 1
===================================================== */

@media (max-width: 900px) {
    .fote-sort-hero {
        padding: 72px 0 95px;
    }

    .fote-sort-tool {
        margin-top: -48px;
    }

    .fote-sort-tool-box {
        grid-template-columns: 1fr;
    }

    .fote-sort-left {
        border-right: 0;
        border-bottom: 1px solid var(--fote-sort-border);
    }
}

@media (max-width: 600px) {
    .fote-sort-container {
        width: min(100% - 22px, 1180px);
    }

    .fote-sort-hero {
        padding: 60px 0 80px;
    }

    .fote-sort-hero h1 {
        font-size: 38px;
    }

    .fote-sort-subtitle {
        font-size: 16px;
    }

    .fote-sort-badges {
        gap: 8px;
    }

    .fote-sort-badges span {
        padding: 7px 12px;
        font-size: 13px;
    }

    .fote-sort-tool {
        margin-top: -34px;
    }

    .fote-sort-tool-box {
        border-radius: 18px;
    }

    .fote-sort-left,
    .fote-sort-right {
        padding: 20px;
    }

    .fote-sort-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .fote-sort-heading button,
    .fote-sort-sample-btn {
        width: 100%;
    }

    .fote-sort-left textarea,
    .fote-sort-right textarea {
        min-height: 280px;
        padding: 15px;
        font-size: 14px;
    }
}
/* =====================================================
   SORT TEXT ALPHABETICALLY
   CSS PART 2
   OPTIONS + BUTTONS + FEATURES + CONTENT
===================================================== */


/* =====================================
   OPTIONS
===================================== */

.fote-sort-options{
    padding:60px 0;
}

.fote-sort-options h2{
    margin-bottom:25px;
    font-size:32px;
    text-align:center;
}

.fote-sort-options-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:18px;
}

.fote-sort-options-grid button{
    padding:15px;
    border:none;
    border-radius:12px;
    background:#6d5dfc;
    color:#fff;
    cursor:pointer;
    font-weight:700;
    transition:.3s;
}

.fote-sort-options-grid button:hover{
    background:#5547d9;
    transform:translateY(-2px);
}

.fote-sort-options-grid label{
    display:flex;
    align-items:center;
    gap:10px;
    padding:15px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#fff;
    cursor:pointer;
}

.fote-sort-options-grid input[type="checkbox"]{
    width:18px;
    height:18px;
    accent-color:#6d5dfc;
}



/* =====================================
   ACTION BUTTONS
===================================== */

.fote-sort-action-buttons{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:15px;
    margin-top:35px;
}

.fote-sort-action-buttons button{
    padding:14px 28px;
    border:none;
    border-radius:10px;
    cursor:pointer;
    font-size:15px;
    font-weight:700;
    transition:.3s;
}

.fote-sort-action-buttons .primary{
    background:#6d5dfc;
    color:#fff;
}

.fote-sort-action-buttons .primary:hover{
    background:#5547d9;
}

.fote-sort-action-buttons button:not(.primary){
    background:#fff;
    border:1px solid #ddd;
}

.fote-sort-action-buttons button:not(.primary):hover{
    background:#f5f5ff;
}



/* =====================================
   MESSAGE
===================================== */

.fote-sort-message{
    margin-top:25px;
    text-align:center;
    font-weight:600;
    color:#16a34a;
}

.fote-sort-message.error{
    color:#dc2626;
}



/* =====================================
   CONTENT SECTIONS
===================================== */

.fote-sort-info,
.fote-sort-features,
.fote-sort-how,
.fote-sort-related,
.fote-sort-faq,
.fote-sort-cta{
    padding:80px 0;
}

.fote-sort-info h2,
.fote-sort-features h2,
.fote-sort-how h2,
.fote-sort-related h2,
.fote-sort-faq h2,
.fote-sort-cta h2{
    text-align:center;
    font-size:34px;
    margin-bottom:25px;
}

.fote-sort-info p{
    max-width:900px;
    margin:auto;
    text-align:center;
    color:#555;
}



/* =====================================
   FEATURES
===================================== */

.fote-sort-feature-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:25px;
}

.fote-sort-feature{
    padding:28px;
    border-radius:18px;
    background:#fff;
    box-shadow:0 10px 35px rgba(0,0,0,.05);
    transition:.3s;
}

.fote-sort-feature:hover{
    transform:translateY(-6px);
}

.fote-sort-feature h3{
    margin-bottom:12px;
    color:#6d5dfc;
}

.fote-sort-feature p{
    color:#666;
}



/* =====================================
   HOW TO
===================================== */

.fote-sort-how ol{
    max-width:700px;
    margin:auto;
    padding-left:22px;
}

.fote-sort-how li{
    margin-bottom:15px;
    font-size:17px;
}



/* =====================================
   RELATED TOOLS
===================================== */

.fote-sort-related ul{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:20px;
    padding:0;
    list-style:none;
}

.fote-sort-related li{
    background:#fff;
    border-radius:14px;
    padding:18px;
    text-align:center;
    box-shadow:0 8px 25px rgba(0,0,0,.05);
}

.fote-sort-related a{
    text-decoration:none;
    color:#6d5dfc;
    font-weight:700;
}

.fote-sort-related a:hover{
    color:#5547d9;
}



/* =====================================
   CTA
===================================== */

.fote-sort-cta{
    background:linear-gradient(135deg,#6d5dfc,#8b7fff);
    color:#fff;
    text-align:center;
    border-radius:24px;
    margin-bottom:70px;
}

.fote-sort-cta p{
    max-width:750px;
    margin:20px auto 35px;
    color:rgba(255,255,255,.9);
}

.fote-sort-btn{
    display:inline-block;
    padding:16px 34px;
    background:#fff;
    color:#6d5dfc;
    border-radius:50px;
    text-decoration:none;
    font-weight:700;
    transition:.3s;
}

.fote-sort-btn:hover{
    transform:translateY(-3px);
    background:#f3f3ff;
}



/* =====================================
   RESPONSIVE
===================================== */

@media(max-width:768px){

.fote-sort-options,
.fote-sort-info,
.fote-sort-features,
.fote-sort-how,
.fote-sort-related,
.fote-sort-faq,
.fote-sort-cta{
    padding:60px 0;
}

.fote-sort-info h2,
.fote-sort-features h2,
.fote-sort-how h2,
.fote-sort-related h2,
.fote-sort-faq h2,
.fote-sort-cta h2{
    font-size:28px;
}

.fote-sort-action-buttons{
    flex-direction:column;
}

.fote-sort-action-buttons button{
    width:100%;
}

}
/* =====================================================
   SORT TEXT ALPHABETICALLY
   CSS PART 3
   FAQ + STATES + ACCESSIBILITY + FINAL RESPONSIVE
===================================================== */


/* =====================================
   FAQ
===================================== */

.fote-sort-faq {
    background: #ffffff;
}

.fote-sort-faq .fote-sort-container {
    max-width: 900px;
}

.fote-sort-faq-item {
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--fote-sort-border);
    border-radius: 14px;
    background: var(--fote-sort-white);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.fote-sort-faq-item:hover {
    border-color: rgba(109, 93, 252, 0.4);
    box-shadow: 0 8px 24px rgba(31, 41, 55, 0.06);
}

.fote-sort-faq-item > button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    padding: 20px 58px 20px 22px;
    border: 0;
    color: var(--fote-sort-text);
    background: transparent;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
}

.fote-sort-faq-item > button::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 22px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--fote-sort-primary);
    background: rgba(109, 93, 252, 0.1);
    font-size: 22px;
    font-weight: 500;
    line-height: 30px;
    text-align: center;
    transform: translateY(-50%);
    transition:
        transform 0.25s ease,
        color 0.25s ease,
        background 0.25s ease;
}

.fote-sort-faq-item.active > button {
    color: var(--fote-sort-primary);
}

.fote-sort-faq-item.active > button::after {
    content: "−";
    color: #ffffff;
    background: var(--fote-sort-primary);
    transform: translateY(-50%) rotate(180deg);
}

.fote-sort-faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.fote-sort-faq-answer > p {
    overflow: hidden;
    margin: 0;
    padding: 0 22px;
    color: var(--fote-sort-muted);
    line-height: 1.75;
    transition:
        padding-top 0.3s ease,
        padding-bottom 0.3s ease;
}

.fote-sort-faq-item.active .fote-sort-faq-answer {
    grid-template-rows: 1fr;
}

.fote-sort-faq-item.active .fote-sort-faq-answer > p {
    padding-top: 0;
    padding-bottom: 22px;
}


/* =====================================
   BUTTON INTERACTION STATES
===================================== */

.fote-sort-page button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

.fote-sort-page button.copied {
    color: #ffffff !important;
    border-color: var(--fote-sort-success) !important;
    background: var(--fote-sort-success) !important;
}

.fote-sort-options-grid button:focus-visible,
.fote-sort-action-buttons button:focus-visible,
.fote-sort-faq-item > button:focus-visible,
.fote-sort-btn:focus-visible {
    outline: 3px solid rgba(109, 93, 252, 0.22);
    outline-offset: 3px;
}


/* =====================================
   MESSAGE STATES
===================================== */

.fote-sort-message {
    min-height: 26px;
    opacity: 0;
    transform: translateY(4px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.fote-sort-message.success,
.fote-sort-message.error {
    opacity: 1;
    transform: translateY(0);
}

.fote-sort-message.success {
    color: var(--fote-sort-success);
}

.fote-sort-message.error {
    color: var(--fote-sort-danger);
}


/* =====================================
   TOOL ACTIVE STATES
===================================== */

.fote-sort-options-grid button.is-active {
    color: #ffffff;
    background: var(--fote-sort-primary-dark);
    box-shadow: 0 10px 24px rgba(109, 93, 252, 0.24);
}

.fote-sort-options-grid label:has(input:checked) {
    border-color: rgba(109, 93, 252, 0.45);
    background: rgba(109, 93, 252, 0.06);
}

.fote-sort-options-grid label:hover {
    border-color: rgba(109, 93, 252, 0.4);
    transform: translateY(-1px);
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}


/* =====================================
   SELECTION + SCROLLBAR
===================================== */

.fote-sort-page ::selection {
    color: #ffffff;
    background: var(--fote-sort-primary);
}

.fote-sort-left textarea::-webkit-scrollbar,
.fote-sort-right textarea::-webkit-scrollbar {
    width: 10px;
}

.fote-sort-left textarea::-webkit-scrollbar-track,
.fote-sort-right textarea::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.fote-sort-left textarea::-webkit-scrollbar-thumb,
.fote-sort-right textarea::-webkit-scrollbar-thumb {
    background: #c7c3f8;
    border-radius: 10px;
}

.fote-sort-left textarea::-webkit-scrollbar-thumb:hover,
.fote-sort-right textarea::-webkit-scrollbar-thumb:hover {
    background: var(--fote-sort-primary);
}


/* =====================================
   SECTION BACKGROUNDS
===================================== */

.fote-sort-info,
.fote-sort-how,
.fote-sort-related {
    background: #ffffff;
}

.fote-sort-features {
    background: var(--fote-sort-bg);
}

.fote-sort-options {
    background: var(--fote-sort-bg);
}


/* =====================================
   SUBTLE ENTRANCE ANIMATION
===================================== */

@keyframes foteSortFadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fote-sort-tool-box,
.fote-sort-feature,
.fote-sort-faq-item,
.fote-sort-related li {
    animation: foteSortFadeUp 0.45s ease both;
}


/* =====================================
   REDUCED MOTION
===================================== */

@media (prefers-reduced-motion: reduce) {
    .fote-sort-page *,
    .fote-sort-page *::before,
    .fote-sort-page *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* =====================================
   FINAL RESPONSIVE
===================================== */

@media (max-width: 768px) {
    .fote-sort-faq-item > button {
        padding: 18px 54px 18px 18px;
        font-size: 16px;
    }

    .fote-sort-faq-item > button::after {
        right: 17px;
    }

    .fote-sort-faq-answer > p {
        padding-left: 18px;
        padding-right: 18px;
    }

    .fote-sort-faq-item.active .fote-sort-faq-answer > p {
        padding-bottom: 18px;
    }

    .fote-sort-cta {
        margin-right: 11px;
        margin-left: 11px;
        border-radius: 18px;
    }
}

@media (max-width: 480px) {
    .fote-sort-options-grid {
        grid-template-columns: 1fr;
    }

    .fote-sort-feature-grid,
    .fote-sort-related ul {
        grid-template-columns: 1fr;
    }

    .fote-sort-options h2,
    .fote-sort-info h2,
    .fote-sort-features h2,
    .fote-sort-how h2,
    .fote-sort-related h2,
    .fote-sort-faq h2,
    .fote-sort-cta h2 {
        font-size: 26px;
        line-height: 1.25;
    }

    .fote-sort-feature {
        padding: 22px;
    }

    .fote-sort-cta {
        padding-right: 18px;
        padding-left: 18px;
    }

    .fote-sort-btn {
        width: 100%;
        padding: 14px 20px;
    }
}