/* =========================================================
   FREE ONLINE TEXT EDITOR — WORD COUNTER
========================================================= */

.fte-word-counter {
    --fte-primary: #4f46e5;
    --fte-primary-dark: #3730a3;
    --fte-secondary: #7c3aed;
    --fte-text: #111827;
    --fte-muted: #64748b;
    --fte-border: #e2e8f0;
    --fte-light: #f8fafc;
    --fte-white: #ffffff;
    --fte-success: #059669;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 18px 50px;
    box-sizing: border-box;
    font-family: Inter, Arial, sans-serif;
    color: var(--fte-text);
}

/* =========================================================
   TOOL HEADER
========================================================= */

.fte-tool-header {
    margin-bottom: 26px;
    padding: 42px 28px;
    text-align: center;
    color: var(--fte-white);
    background:
        radial-gradient(
            circle at top right,
            rgba(255, 255, 255, 0.18),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            var(--fte-primary),
            var(--fte-secondary)
        );
    border-radius: 24px;
    box-shadow: 0 20px 45px rgba(79, 70, 229, 0.22);
    overflow: hidden;
    position: relative;
}

.fte-tool-header::before,
.fte-tool-header::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.fte-tool-header::before {
    width: 180px;
    height: 180px;
    top: -90px;
    left: -60px;
}

.fte-tool-header::after {
    width: 140px;
    height: 140px;
    right: -45px;
    bottom: -70px;
}

.fte-tool-header h1 {
    position: relative;
    z-index: 1;
    margin: 0 0 12px;
    color: var(--fte-white);
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.15;
    letter-spacing: -1.2px;
}

.fte-tool-header p {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.92);
    font-size: 17px;
    line-height: 1.7;
}

/* =========================================================
   EDITOR WRAPPER
========================================================= */

.fte-editor-wrapper {
    padding: 22px;
    background: var(--fte-white);
    border: 1px solid var(--fte-border);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}

#fteText {
    display: block;
    width: 100%;
    min-height: 360px;
    padding: 24px;
    box-sizing: border-box;
    resize: vertical;
    color: var(--fte-text);
    background: var(--fte-light);
    border: 1px solid var(--fte-border);
    border-radius: 16px;
    outline: none;
    font-family: Inter, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.75;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

#fteText::placeholder {
    color: #94a3b8;
}

#fteText:focus {
    background: var(--fte-white);
    border-color: var(--fte-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* =========================================================
   ACTION BUTTONS
========================================================= */

.fte-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.fte-actions button {
    min-height: 46px;
    padding: 11px 18px;
    color: var(--fte-text);
    background: var(--fte-white);
    border: 1px solid var(--fte-border);
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.fte-actions button:hover {
    color: var(--fte-primary);
    border-color: var(--fte-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.09);
}

.fte-actions button:active {
    transform: translateY(0);
}

#fteCopyBtn {
    color: var(--fte-white);
    background: linear-gradient(
        135deg,
        var(--fte-primary),
        var(--fte-secondary)
    );
    border-color: transparent;
}

#fteCopyBtn:hover {
    color: var(--fte-white);
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.24);
}

#fteClearBtn:hover {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fef2f2;
}

#fteDownloadBtn:hover {
    color: var(--fte-success);
    border-color: #6ee7b7;
    background: #ecfdf5;
}

/* =========================================================
   STATISTICS GRID
========================================================= */

.fte-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.fte-stat-card {
    min-height: 126px;
    padding: 22px 16px;
    box-sizing: border-box;
    text-align: center;
    background: var(--fte-white);
    border: 1px solid var(--fte-border);
    border-radius: 17px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.fte-stat-card:hover {
    border-color: rgba(79, 70, 229, 0.45);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.1);
}

.fte-number {
    display: block;
    margin-bottom: 8px;
    color: var(--fte-primary);
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.fte-label {
    display: block;
    color: var(--fte-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

/* =========================================================
   FEATURES SECTION
========================================================= */

.fte-features {
    margin-top: 28px;
    padding: 34px;
    background: var(--fte-white);
    border: 1px solid var(--fte-border);
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
}

.fte-features > h2 {
    margin: 0 0 22px;
    color: var(--fte-text);
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.25;
    text-align: center;
}

.fte-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.fte-feature {
    padding: 22px;
    background: var(--fte-light);
    border: 1px solid var(--fte-border);
    border-radius: 15px;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.fte-feature:hover {
    background: var(--fte-white);
    border-color: rgba(79, 70, 229, 0.4);
    transform: translateY(-2px);
}

.fte-feature h3 {
    margin: 0 0 8px;
    color: var(--fte-text);
    font-size: 19px;
    line-height: 1.4;
}

.fte-feature p {
    margin: 0;
    color: var(--fte-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* =========================================================
   BUTTON FEEDBACK STATES
========================================================= */

.fte-actions button.fte-success {
    color: var(--fte-white) !important;
    background: var(--fte-success) !important;
    border-color: var(--fte-success) !important;
}

.fte-actions button.fte-error {
    color: var(--fte-white) !important;
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* =========================================================
   TABLET RESPONSIVE
========================================================= */

@media (max-width: 991px) {
    .fte-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fte-tool-header {
        padding: 36px 24px;
    }
}

/* =========================================================
   MOBILE RESPONSIVE
========================================================= */

@media (max-width: 767px) {
    .fte-word-counter {
        padding: 14px 12px 36px;
    }

    .fte-tool-header {
        margin-bottom: 18px;
        padding: 30px 18px;
        border-radius: 18px;
    }

    .fte-tool-header h1 {
        font-size: 34px;
        letter-spacing: -0.7px;
    }

    .fte-tool-header p {
        font-size: 15px;
        line-height: 1.65;
    }

    .fte-editor-wrapper {
        padding: 14px;
        border-radius: 16px;
    }

    #fteText {
        min-height: 300px;
        padding: 17px;
        border-radius: 12px;
        font-size: 16px;
        line-height: 1.65;
    }

    .fte-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .fte-actions button {
        width: 100%;
    }

    .fte-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
        margin-top: 16px;
    }

    .fte-stat-card {
        min-height: 112px;
        padding: 18px 10px;
        border-radius: 14px;
    }

    .fte-number {
        font-size: 27px;
    }

    .fte-label {
        font-size: 13px;
    }

    .fte-features {
        margin-top: 20px;
        padding: 24px 16px;
        border-radius: 16px;
    }

    .fte-feature-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .fte-feature {
        padding: 18px;
    }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {
    .fte-stats-grid {
        grid-template-columns: 1fr;
    }

    .fte-stat-card {
        min-height: auto;
    }

    .fte-tool-header h1 {
        font-size: 30px;
    }
}