/* ============================================================
   stylesheet.css — Unified design system
   tools.ademkanca.co.uk
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Tokens ── */
:root {
    /* Backgrounds */
    --bg:           #0d1117;
    --surface:      #161b22;
    --surface-alt:  #1a1d24;

    /* Borders */
    --border:       #30363d;
    --border-muted: #3a3f4b;
    --border-hi:    #58a6ff;

    /* Text */
    --text:         #e6edf3;
    --text-muted:   #8b949e;
    --text-soft:    #c9d1d9;

    /* Accents */
    --accent:           #58a6ff;
    --accent-green:     #238636;
    --accent-green-hi:  #2ea043;
    --accent-blue:      #4f6df5;
    --accent-blue-hi:   #3e59d9;
    --accent-copy:      #2b2f36;
    --accent-copy-hi:   #3a3f4b;

    /* Status */
    --green-bg:     #132a13;
    --green-border: #2ea043;
    --red:          #f85149;
    --red-bg:       #2a1313;
    --red-border:   #f85149;
    --yellow:       #ffc453;
    --yellow-bg:    #1f1708;
    --yellow-border:#a87a1a;

    /* Type */
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

    /* Radii */
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
}

/* ── Base ── */
html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

ul { list-style: none; padding: 0; }

/* ── Typography ── */
h1 {
    font-size: clamp(26px, 5vw, 40px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 6px;
}

/* CSVConvert card headings */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-soft);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 14px;
}

/* htaccess card headings */
.card-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* ── Layout containers ── */

/* Homepage */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* Validator tool pages (robots, htaccess) */
.container--page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* Password tool wrapper */
main {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.main-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 30px;
}

/* ── Header ── */
header {
    text-align: center;
    padding: 56px 20px 40px;
}

header::after {
    content: '';
    display: block;
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
    margin: 20px auto 0;
}

/* htaccess validator — Apache badge */
.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    background: rgba(88,166,255,0.1);
    border: 1px solid rgba(88,166,255,0.25);
    border-radius: 4px;
    padding: 4px 10px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

/* ── Grids ── */

/* Homepage tool cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

/* CSVConvert options columns */
.grid--2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* robots.txt — 2-col input row */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* htaccess — 3-col input row */
.grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

@media (max-width: 700px) {
    .form-grid,
    .grid-3 { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px;
    margin-bottom: 20px;
    transition: border-color 0.15s, transform 0.15s;
}

/* Homepage cards are <a> tags */
a.card {
    display: block;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 0;
}

a.card:hover {
    border-color: var(--border-hi);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.name {
    font-weight: 600;
    font-size: 17px;
}

.desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.category {
    margin-top: 10px;
    font-size: 12px;
    color: var(--accent);
}

/* ── Homepage search ── */
.search {
    max-width: 500px;
    margin: 28px auto 0;
}

.search input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    margin-bottom: 0;
}

/* ── Form elements ── */
label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 8px;
}

/* Password tool — labels inside li need normal casing */
.contentBlockList li label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-soft);
    padding: 12px 16px;
    cursor: pointer;
    margin-bottom: 0;
}

/* CSVConvert — inline checkbox label */
label.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-soft);
    margin-bottom: 8px;
    cursor: pointer;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    margin-bottom: 10px;
    transition: border-color 0.18s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus { border-color: var(--accent); }

input[type="file"] {
    color: var(--text-soft);
    font-size: 14px;
    margin-bottom: 10px;
}

input[type="radio"],
input[type="checkbox"] { accent-color: var(--accent); }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b949e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea {
    width: 100%;
    min-height: 250px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.7;
    resize: vertical;
    transition: border-color 0.18s;
    outline: none;
}

textarea:focus { border-color: var(--accent); }

/* CSVConvert output textarea */
textarea#output {
    height: 350px;
    background: var(--bg);
    margin-bottom: 0;
}

/* Password tool — narrow prefix/suffix fields */
.presuffix { max-width: 160px; }

/* ── Buttons ── */
button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--accent-green);
    border: none;
    border-radius: var(--r-md);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, transform 0.1s;
}

button:hover {
    background: var(--accent-green-hi);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

button:active { transform: translateY(0); }

/* CSVConvert copy button */
button.copy-btn        { background: var(--accent-copy); margin-top: 10px; }
button.copy-btn:hover  { background: var(--accent-copy-hi); }

/* File input — hide native, style label as the visible control */
input.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px dashed #444c56;
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s;
}

.file-label:hover {
    border-color: var(--accent);
    color: var(--text);
}

input.file-input:focus + .file-label {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88,166,255,0.12);
}

/* ── Dividers ── */
.separator {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* Password tool — vertical rule between columns */
.horizontal {
    width: 1px;
    height: 40px;
    background: var(--border);
    flex-shrink: 0;
}

/* ── Password tool — option list ── */
.contentBlockList {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    padding: 0;
    margin: 0;
}

.contentBlockList li {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
}

/* ── Flex helpers ── */
.center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* ── Result display ── */

/* Password tool — readonly text input showing generated password */
input.result {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    text-align: center;
    font-size: 15px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0;
}

/* robots.txt validator — status block */
div.result {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--r-md);
    font-weight: 600;
}

div.result.allowed {
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    color: var(--green-border);
}

div.result.blocked {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red);
}

/* ── Copy icon on password result ── */
.resultLabel {
    position: relative;
    width: 100%;
}

.resultLabel::before {
    content: "";
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    width: 20px;
    background: url("data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20115.77%20122.88%22%20style%3D%22enable-background%3Anew%200%200%20115.77%20122.88%22%20xml%3Aspace%3D%22preserve%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E.st0%7Bfill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3B%7D%3C%2Fstyle%3E%3Cg%3E%3Cpath%20class%3D%22st0%22%20d%3D%22M89.62%2C13.96v7.73h12.19h0.01v0.02c3.85%2C0.01%2C7.34%2C1.57%2C9.86%2C4.1c2.5%2C2.51%2C4.06%2C5.98%2C4.07%2C9.82h0.02v0.02%20v73.27v0.01h-0.02c-0.01%2C3.84-1.57%2C7.33-4.1%2C9.86c-2.51%2C2.5-5.98%2C4.06-9.82%2C4.07v0.02h-0.02h-61.7H40.1v-0.02%20c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1%20c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85%2C1.58-7.34%2C4.1-9.86c2.51-2.5%2C5.98-4.06%2C9.82-4.07V0h0.02h61.7%20h0.01v0.02c3.85%2C0.01%2C7.34%2C1.57%2C9.86%2C4.1c2.5%2C2.51%2C4.06%2C5.98%2C4.07%2C9.82h0.02V13.96L89.62%2C13.96z%20M79.04%2C21.69v-7.73v-0.02h0.02%20c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91%2C0-1.75%2C0.39-2.37%2C1.01%20c-0.61%2C0.61-1%2C1.46-1%2C2.37h0.02v0.01v64.59v0.02h-0.02c0%2C0.91%2C0.39%2C1.75%2C1.01%2C2.37c0.61%2C0.61%2C1.46%2C1%2C2.37%2C1v-0.02h0.01h12.19V35.65%20v-0.01h0.02c0.01-3.85%2C1.58-7.34%2C4.1-9.86c2.51-2.5%2C5.98-4.06%2C9.82-4.07v-0.02h0.02H79.04L79.04%2C21.69z%20M105.18%2C108.92V35.65v-0.02%20h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91%2C0-1.75%2C0.39-2.37%2C1.01%20c-0.61%2C0.61-1%2C1.46-1%2C2.37h0.02v0.01v73.27v0.02h-0.02c0%2C0.91%2C0.39%2C1.75%2C1.01%2C2.37c0.61%2C0.61%2C1.46%2C1%2C2.37%2C1v-0.02h0.01h61.7h0.02%20v0.02c0.91%2C0%2C1.75-0.39%2C2.37-1.01c0.61-0.61%2C1-1.46%2C1-2.37h-0.02V108.92L105.18%2C108.92z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;
    z-index: 10;
    transition: scale 0.15s;
}

.resultLabel:hover::before { scale: 1.2; cursor: pointer; }

/* ── htaccess — result banner ── */
.result-banner {
    padding: 18px 22px;
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 24px;
    animation: fadeUp 0.3s ease both;
}

.result-banner .icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.result-banner .meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

.banner-ok   { background: var(--green-bg);  border: 1px solid var(--green-border); color: #3ddc84; }
.banner-ok   .icon { background: rgba(61,220,132,.15); }
.banner-warn { background: var(--yellow-bg); border: 1px solid var(--yellow-border); color: var(--yellow); }
.banner-warn .icon { background: rgba(255,196,83,.15); }
.banner-err  { background: var(--red-bg);    border: 1px solid var(--red-border);   color: var(--red); }
.banner-err  .icon { background: rgba(248,81,73,.15); }

/* ── htaccess — evaluation table ── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

thead tr { background: rgba(255,255,255,.03); }

th {
    text-align: left;
    padding: 10px 16px;
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    word-break: break-all;
}

tr:last-child td { border-bottom: none; }
tr.row-match     { background: rgba(88,166,255,.04); }

.pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.pill-yes     { background: rgba(61,220,132,.15);  color: #3ddc84; }
.pill-no      { background: rgba(255,255,255,.06); color: var(--text-muted); }
.pill-block   { background: rgba(248,81,73,.15);   color: var(--red); }
.pill-redir   { background: rgba(255,196,83,.12);  color: var(--yellow); }
.pill-rewrite { background: rgba(88,166,255,.15);  color: var(--accent); }

/* ── CSVConvert — output section ── */
.output-box { margin-top: 20px; }

/* ── Animations ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Footer ── */
footer {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1px;
    transition: color 0.15s;
}

footer a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .horizontal  { display: none; }
    .column      { width: 100% !important; }
    .center      { gap: 12px; }
}