/* =========================================================
   Utility Platform — Tool Pages
   ========================================================= */

.tool-page {
    padding: 45px 0 80px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 35px;
    color: var(--text-muted);
    font-size: 13px;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.tool-intro {
    /*max-width: 750px;*/
    max-width:100%;
    margin-bottom: 30px;
}

.tool-intro-icon {
    width: 50px;
    height: 50px;

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

    margin-bottom: 18px;

    border-radius: 13px;

    background: var(--primary-soft);
    color: var(--primary);

    font-weight: 800;
}

.tool-intro h1 {
    margin: 0;

    font-size: clamp(32px, 5vw, 46px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.tool-intro p {
    margin: 14px 0 0;

    color: var(--text-muted);
    font-size: 17px;
}

.tool-workspace {
    overflow: hidden;

    background: white;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-md);
}

.tool-content {
    max-width: 780px;

    margin: 50px auto 0;
}

.tool-content h2 {
    margin: 40px 0 12px;

    font-size: 25px;
    letter-spacing: -0.025em;
}

.tool-content h2:first-child {
    margin-top: 0;
}

.tool-content h3 {
    margin: 25px 0 8px;

    font-size: 18px;
}

.tool-content p,
.tool-content li {
    color: var(--text-muted);
    font-size: 15px;
}

.tool-content ol,
.tool-content ul {
    padding-left: 22px;
}

.related-tools {
    margin-top: 65px;
}

.related-tools h2 {
    margin-bottom: 22px;
}


/* ---------------------------------------------------------
   Generic Tool Editor
   --------------------------------------------------------- */

.tool-editor {
    padding: 20px;
}

.tool-editor textarea {
    display: block;

    width: 100%;
    min-height: 360px;

    padding: 20px;

    resize: vertical;

    border: 1px solid var(--border);
    border-radius: 12px;

    outline: none;

    color: var(--text);
    background: #fbfdff;

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

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

.tool-editor textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.1);
}


/* ---------------------------------------------------------
   Statistics
   --------------------------------------------------------- */

.tool-stats {
    display: grid;

    /*grid-template-columns:
        repeat(5, minmax(0, 1fr));*/
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));

    border-top: 1px solid var(--border);

    background: var(--surface-soft);
}

.stat {
    padding: 20px;

    text-align: center;

    border-right: 1px solid var(--border);
}

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

.stat-value {
    display: block;

    font-size: 24px;
    font-weight: 750;
    letter-spacing: -0.03em;
}

.stat-label {
    display: block;

    margin-top: 3px;

    color: var(--text-muted);

    font-size: 12px;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 700px) {

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

    .stat {
        border-right: 1px solid var(--border);
    }

    .stat:nth-child(even) {
        border-right: 0;
    }

    .stat:nth-child(n + 3) {
        border-top: 1px solid var(--border);
    }

}


@media (max-width: 520px) {

    .tool-page {
        padding-top: 30px;
    }

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

    .tool-editor {
        padding: 12px;
    }

    .tool-editor textarea {
        min-height: 300px;
        padding: 15px;
    }

}

/* Tool pages */

.tool-page {
    padding: 56px 0 80px;
}

.tool-page-header {
    max-width: 760px;
    margin-bottom: 32px;
}

.tool-page-header h1 {
    margin: 8px 0 14px;
}

.tool-page-intro {
    margin: 0;
    font-size: 18px;
    line-height: 1.7;
    color: #666;
}

.tool-interface {
    margin: 32px auto;
    max-width: 900px;
}

.tool-content {
    max-width: 800px;
    margin: 56px auto 0;
}

@media (max-width: 768px) {

    .tool-page {
        padding: 40px 0 60px;
    }

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

}
/* Word Counter */

.word-counter {
    width: 100%;
}

.word-counter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
}

.word-counter-hint {
    font-size: 13px;
    color: #777;
}

.word-counter-toolbar-actions {
    display: flex;
    gap: 8px;
}

.word-counter-input {
    display: block;
    width: 100%;
    min-height: 320px;
    padding: 22px;
    box-sizing: border-box;

    border: 1px solid #ddd;
    border-radius: 12px;

    background: #fff;

    font: inherit;
    font-size: 16px;
    line-height: 1.7;

    resize: vertical;
    outline: none;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.word-counter-input:focus {
    border-color: #999;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.word-counter-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.word-counter-stat {
    padding: 18px 12px;

    border: 1px solid #e5e5e5;
    border-radius: 10px;

    background: #fff;

    text-align: center;
}

.word-counter-stat span {
    display: block;

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

.word-counter-stat small {
    display: block;

    margin-top: 7px;

    color: #777;

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

.tool-button {
    padding: 9px 15px;

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

    background: #fff;

    font: inherit;
    font-size: 14px;

    cursor: pointer;

    transition:
        background 0.2s,
        border-color 0.2s;
}

.tool-button:hover {
    background: #f5f5f5;
    border-color: #ccc;
}


/*
|--------------------------------------------------------------------------
| Tool Content
|--------------------------------------------------------------------------
*/

.tool-content h2 {
    margin-top: 42px;
    margin-bottom: 14px;

    font-size: 24px;
}

.tool-content h3 {
    margin-top: 28px;
    margin-bottom: 8px;

    font-size: 18px;
}

.tool-content p,
.tool-content li {
    font-size: 16px;
    line-height: 1.75;
    color: #555;
}

.tool-content ol {
    padding-left: 24px;
}


/*
|--------------------------------------------------------------------------
| Word Counter Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 700px) {

    .word-counter-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .word-counter-toolbar-actions {
        width: 100%;
    }

    .word-counter-toolbar-actions .tool-button {
        flex: 1;
    }

    .word-counter-stats {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 420px) {

    .word-counter-input {
        min-height: 260px;
        padding: 16px;
    }

    .word-counter-stat {
        padding: 15px 8px;
    }

    .word-counter-stat span {
        font-size: 22px;
    }

    .word-counter-stat small {
        font-size: 12px;
    }

}

/* Character Counter */
.tool-page {
        padding: 35px 0 80px;
    }

    .tool-breadcrumb {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 30px;
        font-size: 14px;
        color: #777;
    }

    .tool-breadcrumb a {
        color: inherit;
        text-decoration: none;
    }

    .tool-breadcrumb a:hover {
        text-decoration: underline;
    }

    .tool-heading {
        display: flex;
        align-items: center;
        gap: 18px;
        margin-bottom: 30px;
    }

    .tool-heading-icon {
        width: 64px;
        height: 64px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        background: #f3f4f6;
        font-size: 28px;
        font-weight: 700;
    }

    .tool-heading h1 {
        margin: 0 0 6px;
    }

    .tool-heading p {
        margin: 0;
        color: #6b7280;
    }

    .tool-workspace {
        max-width: 1000px;
        margin: 0 auto;
    }

    .character-counter {
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    }

    .counter-stats {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        border-bottom: 1px solid #e5e7eb;
    }

    .counter-stat {
        padding: 18px 12px;
        text-align: center;
        border-right: 1px solid #e5e7eb;
    }

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

    .counter-stat strong {
        display: block;
        font-size: 24px;
        line-height: 1.2;
    }

    .counter-stat span {
        display: block;
        margin-top: 5px;
        font-size: 12px;
        color: #6b7280;
    }

    .counter-editor textarea {
        display: block;
        width: 100%;
        min-height: 380px;
        padding: 24px;
        border: 0;
        outline: none;
        resize: vertical;
        font: inherit;
        font-size: 16px;
        line-height: 1.7;
        box-sizing: border-box;
    }

    .counter-editor textarea:focus {
        box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.05);
    }

    .editor-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        border-top: 1px solid #e5e7eb;
        color: #6b7280;
        font-size: 13px;
    }

    .tool-button {
        border: 0;
        border-radius: 8px;
        padding: 9px 16px;
        cursor: pointer;
        font: inherit;
    }
    
    .tool-button.primary {
        background: #198754;
        color: #fff;
    }
    
    .tool-button.secondary {
        background: #f3f4f6;
        color: #333;
    }

    .tool-button.secondary:hover {
        background: #e5e7eb;
    }

    .tool-information {
        max-width: 900px;
        margin: 50px auto 0;
    }

    .tool-information h2 {
        margin-top: 35px;
        margin-bottom: 12px;
    }

    .tool-information h2:first-child {
        margin-top: 0;
    }

    .tool-information p,
    .tool-information li {
        color: #555;
        line-height: 1.7;
    }

    .tool-information ul {
        padding-left: 22px;
    }

    @media (max-width: 800px) {

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

        .counter-stat:nth-child(3) {
            border-right: 0;
        }

        .counter-stat:nth-child(n + 4) {
            border-top: 1px solid #e5e7eb;
        }

    }

    @media (max-width: 500px) {

        .tool-page {
            padding-top: 20px;
        }

        .tool-heading {
            align-items: flex-start;
        }

        .tool-heading-icon {
            width: 50px;
            height: 50px;
            font-size: 22px;
        }

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

        .counter-stats {
            grid-template-columns: repeat(2, 1fr);
        }

        .counter-stat {
            border-right: 0;
        }

        .counter-stat:nth-child(n + 3) {
            border-top: 1px solid #e5e7eb;
        }

        .counter-editor textarea {
            min-height: 300px;
            padding: 18px;
        }

    }
    
    .calculator-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.calculator-actions .btn {
   margin-right: 20px;
  margin-bottom: 20px;
}
.calculator-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.calculator-card {
    padding: 28px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #fff;
}

.calculator-card-header h2 {
    margin: 0 0 8px;
    font-size: 21px;
}

.calculator-card-header p {
    margin: 0 0 24px;
    color: var(--text-muted);
}

.calculator-result {
    margin-top: 24px;
    padding: 18px 20px;
    border-radius: 12px;
    background: var(--surface-muted);
}

.result-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.calculator-result strong {
    font-size: 26px;
}

.formula-box {
    margin: 20px 0;
    padding: 16px 20px;
    border-radius: 10px;
    background: var(--surface-muted);
    font-family: monospace;
    font-size: 16px;
}

@media (max-width: 768px) {

    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .calculator-card {
        padding: 22px;
    }

}

/* Input with suffix */
/* Input with suffix */

.input-with-suffix {
    position: relative;
    width: 100%;
}

.input-with-suffix input {
    width: 100%;
    padding-right: 50px;
}

.input-with-suffix span {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);

    font-size: 15px;
    font-weight: 600;
    color: #6b7280;

    pointer-events: none;
}

/* QR Code Generator */

.qr-generator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.qr-input-section,
.qr-output-section,
.base64-tool,
.password-generator {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.qr-input-section textarea,
.base64-tool textarea {
    width: 100%;
    resize: vertical;
}

.qr-controls {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
}

.qr-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qr-control select {
    padding: 10px 12px;
}

.qr-output-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.qr-placeholder {
    text-align: center;
}

.qr-placeholder span {
    display: block;
    font-size: 64px;
    margin-bottom: 12px;
}

.qr-result {
    text-align: center;
}

.qr-result canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 20px;
}


/* Base64 */

.base64-tool {
    max-width: 100%;
}

.base64-input,
.base64-output {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.base64-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.tool-status {
    margin-top: 15px;
    min-height: 20px;
}

.tool-status.error {
    font-weight: 600;
}


/* Password Generator */

.password-generator {
    max-width: 800px;
    margin: 0 auto;
}

.password-output {
    display: flex;
    gap: 10px;
}

.password-output input {
    flex: 1;
    min-width: 0;
    font-family: monospace;
    font-size: 18px;
    padding: 12px;
}

.password-strength {
    margin-top: 20px;
}

.strength-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.strength-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}


.password-options {
    display: grid;
    gap: 14px;
    margin: 25px 0;
}

.password-length {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-generate-button {
    width: 100%;
}


/* Responsive */

@media (max-width: 768px) {

    .qr-generator {
        grid-template-columns: 1fr;
    }

    .qr-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .password-output {
        flex-direction: column;
    }

}

/* =========================================================
   New Developer Tools
   QR Code / Base64 / Password Generator
   ========================================================= */


/* ---------------------------------------------------------
   Shared form controls
   --------------------------------------------------------- */

.qr-generator input,
.qr-generator textarea,
.qr-generator select,
.base64-tool input,
.base64-tool textarea,
.base64-tool select,
.password-generator input,
.password-generator textarea,
.password-generator select {
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
}

.qr-generator label,
.base64-tool label,
.password-generator label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}


/* ---------------------------------------------------------
   QR Code Generator
   --------------------------------------------------------- */

.qr-generator {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 32px;
    align-items: stretch;
}

.qr-input-section,
.qr-output-section {
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.qr-input-section textarea {
    display: block;
    width: 100%;
    min-height: 150px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.qr-input-section textarea:focus {
    border-color: #9ca3af;
}

.qr-controls {
    display: flex;
    align-items: end;
    gap: 16px;
    margin-top: 20px;
}

.qr-control {
    flex: 1;
}

.qr-control select {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
}

.qr-controls .tool-button {
    min-height: 44px;
    white-space: nowrap;
}

.qr-output-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.qr-placeholder {
    width: 100%;
    text-align: center;
    color: #6b7280;
}

.qr-placeholder span {
    display: block;
    font-size: 64px;
    line-height: 1;
    margin-bottom: 16px;
}

.qr-placeholder p {
    margin: 0;
}

.qr-result {
    width: 100%;
    text-align: center;
}

.qr-result canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 20px;
}

.qr-result .tool-button {
    display: inline-block;
}


/* ---------------------------------------------------------
   Base64 Encoder / Decoder
   --------------------------------------------------------- */

.base64-tool {
    box-sizing: border-box;
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.base64-input,
.base64-output {
    width: 100%;
}

.base64-tool textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 220px;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.base64-tool textarea:focus {
    border-color: #9ca3af;
}

.base64-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.base64-actions .tool-button {
    min-height: 42px;
}

.tool-status {
    min-height: 22px;
    margin-top: 15px;
}

.tool-status.error {
    font-weight: 600;
}


/* ---------------------------------------------------------
   Strong Password Generator
   --------------------------------------------------------- */

.password-generator {
    box-sizing: border-box;
    width: 100%;
    max-width: 800px;
    margin: 45px auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.password-output {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.password-output input {
    box-sizing: border-box;
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    font-family: monospace;
    font-size: 16px;
    outline: none;
}

.password-output input:focus {
    border-color: #9ca3af;
}

.password-output .tool-button {
    flex: 0 0 auto;
    min-height: 46px;
}


/* Strength */

.password-strength {
    margin-top: 22px;
}

.strength-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 9px;
}

.strength-label span {
    font-weight: 600;
}

.strength-label strong {
    font-size: 14px;
}

.strength-bar {
    width: 100%;
    height: 8px;
    overflow: hidden;
    background: #e5e7eb;
    border-radius: 999px;
}

.strength-bar div {
    width: 0;
    height: 100%;
    background: #22c55e;
    border-radius: 999px;
    transition: width 0.2s ease;
}


/* Options */

.password-options {
    display: grid;
    gap: 16px;
    margin: 26px 0;
}

.password-length {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.password-length label {
    margin-bottom: 0;
}

.password-length input[type="range"] {
    width: 100%;
}

.password-option {
    display: flex !important;
    align-items: center;
    gap: 9px;
    margin: 0 !important;
    font-weight: 400 !important;
    cursor: pointer;
}

.password-option input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    flex: 0 0 auto;
}

.password-generate-button {
    width: 100%;
    min-height: 46px;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 768px) {

    .qr-generator {
        grid-template-columns: 1fr;
    }

    .qr-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .qr-control {
        width: 100%;
    }

    .qr-output-section {
        min-height: 280px;
    }

    .password-output {
        flex-direction: column;
    }

    .password-output input,
    .password-output .tool-button {
        width: 100%;
    }

}


@media (max-width: 480px) {

    .qr-input-section,
    .qr-output-section,
    .base64-tool,
    .password-generator {
        padding: 18px;
    }

    .base64-actions {
        flex-direction: column;
    }

    .base64-actions .tool-button {
        width: 100%;
    }

}

.tool-category{
    margin-top:30px;
}
.related-tools {
    max-width: 900px;
    margin: 50px auto 0;
}

.related-tools-heading {
    margin-bottom: 24px;
}

.related-tools-heading h2 {
    margin: 0;
}

.related-tools-heading p {
    margin: 8px 0 0;
}