/* Shared layout, controls and result styles for the free tools. */

.tools-page {
    --tool-blue: #0c57dc;
    --tool-deep-blue: #073d9e;
    --tool-success: #176047;
    --tool-warning: #855415;
    --tool-danger: #a83730;
    --text-primary: #142432;
    --text-secondary: #4b5d6f;
    --text-muted: #4b5d6f;
    --bg-secondary: #edf5ff;
    --bg-tertiary: #f5f9ff;
    --border-primary: #dce6ef;
    color: var(--text-primary);
    font-family: Inter, system-ui, sans-serif;
    background: #fff;
}

.tools-page :focus-visible { outline: 3px solid var(--tool-blue); outline-offset: 4px; }

.tools-page .hero {
    min-height: auto;
    display: block;
    padding: clamp(2.8rem, 6.5vw, 5.25rem) 0;
    border-bottom: 1px solid #e1eafa;
    background: radial-gradient(ellipse at 90% 35%, #dcecff, transparent 60%), #f5f9ff;
    text-align: left;
}

.tools-page .hero .container, .tools-index .products-grid-section .container {
    width: min(100% - 2.5rem, 1100px);
    max-width: none;
    padding-inline: 0;
}

.tools-page .hero-title {
    margin-bottom: .75rem;
    color: var(--text-primary);
    font-size: clamp(2.625rem, 6vw, 4.5rem);
    letter-spacing: -.062em;
    line-height: 1.08;
}

.tools-page .hero-lead {
    max-width: 640px;
    margin: 0;
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.tools-index .products-grid-section, .tools-page .tool-content {
    padding-block: clamp(2rem, 5vw, 4.25rem);
}

.tools-index .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

.tools-index .product-card {
    min-width: 0;
    padding: clamp(1.1rem, 2.7vw, 1.8rem);
    background: white;
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}

.tools-index .product-card:hover {
    transform: none;
    border-color: #a8c9f3;
    box-shadow: 0 12px 35px #153d7210;
}

.tools-index .product-card h2 {
    margin-bottom: .575rem;
    color: var(--text-primary);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    line-height: 1.22;
    letter-spacing: -.032em;
    text-align: left;
}

.tools-index .product-card p { font-size: .9375rem; }
.tools-index .product-card-cta { color: var(--tool-deep-blue); font-size: .875rem; }

.tools-page .tool-shell {
    width: min(100% - 2.5rem, 870px);
    max-width: none;
    padding-inline: 0;
}

.tool-card {
    min-width: 0;
    padding: clamp(1.15rem, 4vw, 2rem);
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 14px 42px #1437670b;
}

.tool-card label { display: block; margin-bottom: .5rem; color: var(--text-primary); font-weight: 600; }
.tool-card > .btn { margin-top: 1rem; }

.tool-input {
    width: 100%;
    min-height: 51px;
    padding: .7rem .875rem;
    background: #fbfdff;
    border: 1px solid #c5d3e4;
    border-radius: 9px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.15s;
}
.tool-input:focus { border-color: var(--tool-blue); }

.tool-result {
    min-width: 0;
    margin-top: 1.35rem;
    padding: clamp(1.15rem, 4vw, 2rem);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    overflow-wrap: anywhere;
}

.tool-result td { overflow-wrap: anywhere; }
.tool-result td:first-child { max-width: 40%; }

.result-error {
    color: var(--tool-danger);
    font-weight: 600;
    font-size: 1rem;
}
.result-note { color: var(--text-muted); }
.result-nickname { margin-bottom: .5rem; font-size: .875rem; }

/* Cron-parser specifics: preset chips + parsed-result layout */
.tool-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin-top: .65rem;
}

.tool-presets:first-of-type { margin-top: 1rem; }
.tool-presets > span { color: var(--text-muted); font-size: .875rem; margin-right: .2rem; }

.preset-btn {
    min-height: 38px;
    padding: .35rem .65rem;
    background: var(--bg-secondary);
    color: var(--tool-deep-blue);
    border: 1px solid #cce0f9;
    border-radius: 7px;
    font-size: .8125rem;
    cursor: pointer;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}
.preset-btn:hover { background: #dcecff; border-color: #9fc2f2; }

.result-description {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.result-next-runs { margin-top: 1rem; }
.result-next-runs h2 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.result-next-runs ol {
    list-style: none;
    padding: 0;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.result-next-runs li {
    padding: 0.25rem 0;
    border-bottom: 1px dashed var(--border-primary);
}
.result-next-runs li:last-child { border-bottom: 0; }

.tool-cta {
    margin-top: 1.4rem;
    padding: clamp(1.15rem, 4vw, 2rem);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    text-align: left;
}

.tool-cta h3 { color: var(--text-primary); margin-bottom: .5rem; }
.tool-cta p { color: var(--text-secondary); margin-bottom: 1.1rem; }

.tool-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tools-page .faq-item {
    background: #fff;
    border-color: var(--border-primary);
}

.tools-page .faq-item[open], .tools-page .faq-item:hover {
    background: #f4f8ff;
    border-color: #a8c9f3;
}

.tools-page .section-dark { background: #f4f8ff; }
.tools-page .section-dark code { overflow-wrap: anywhere; }
.tools-page .faq-question { padding-right: 3.2rem; }

@media (max-width: 750px) {
    .tools-index .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
    .tools-index .products-grid { grid-template-columns: minmax(0, 1fr); }
    .preset-btn { min-height: 44px; }
    .tool-result td:first-child { width: 39% !important; }
}
