/* ============================================
   Tool Matrix — Shared Design System
   ============================================ */

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #EEF2FF;
    --success: #10B981;
    --success-dark: #059669;
    --danger: #EF4444;
    --warning: #F59E0B;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-2: #F1F5F9;
    --text: #0F172A;
    --text-secondary: #1E293B;
    --muted: #64748B;
    --muted-light: #94A3B8;
    --border: #E2E8F0;
    --border-dark: #CBD5E1;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --transition: 180ms ease;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Poppins', var(--font-sans);
    --font-mono: 'Fira Code', 'Cascadia Code', 'Monaco', 'Menlo', 'Courier New', monospace;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── Base ── */
body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* ── Shared Navbar (tool pages) ── */
.tm-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.tm-navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 0;
}
/* Logo — same as homepage */
.tm-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}
.tm-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-heading);
    flex-shrink: 0;
}
.tm-logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}
/* Breadcrumb */
.tm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 16px;
    font-size: 0.85rem;
    color: var(--muted);
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.tm-breadcrumb a {
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition);
}
.tm-breadcrumb a:hover { color: var(--primary); }
.tm-breadcrumb svg { flex-shrink: 0; opacity: 0.4; }
.tm-breadcrumb-current {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Nav links — same as homepage */
.tm-navbar-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 16px;
}
.tm-navbar-links a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.tm-navbar-links a:hover { background: var(--bg); color: var(--text); }
@media (max-width: 640px) {
    .tm-navbar-links { display: none; }
    .tm-breadcrumb { margin-left: 12px; }
    .tm-logo-text { display: none; }
}

/* ── Shared Footer (tool pages) ── */
.page-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 0;
}
.page-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.page-footer-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.footer-logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.footer-logo-icon {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 11px;
    font-family: var(--font-heading);
    flex-shrink: 0;
}
.footer-logo-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
}
.footer-copy-text {
    font-size: 0.82rem;
    color: var(--muted);
}
.page-footer-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.page-footer-links a {
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}
.page-footer-links a:hover { background: var(--bg); color: var(--primary); }
@media (max-width: 768px) {
    .page-footer-inner { flex-direction: column; align-items: flex-start; padding: 20px 16px; }
    .page-footer-links { gap: 0; }
}

/* ── Container ── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 32px 56px;
}
@media (max-width: 768px) { .container { padding: 20px 16px 40px; } }

/* ── Page Header ── */
.page-header {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1.5px solid var(--border);
}
.page-header h1 {
    font-family: var(--font-heading);
    color: var(--text);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 8px;
}
.page-header .subtitle { color: var(--muted); font-size: 0.95rem; }

/* ── Panels ── */
.panel {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
}

/* ── Form Elements ── */
label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.88rem;
}
input[type="text"],
input[type="number"],
input[type="datetime-local"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface-2);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: var(--surface);
}
textarea { resize: vertical; font-family: var(--font-mono); line-height: 1.6; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    font-family: var(--font-sans);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition), border-color var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-dark); box-shadow: 0 3px 10px rgba(99,102,241,0.35); }
.btn.success { background: var(--success); color: white; }
.btn.success:hover { background: var(--success-dark); box-shadow: 0 3px 10px rgba(16,185,129,0.35); }
.btn.secondary { background: var(--surface-2); color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn.secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn.danger { background: var(--surface-2); color: var(--muted); border: 1.5px solid var(--border); }
.btn.danger:hover { background: #FEE2E2; color: var(--danger); border-color: #FCA5A5; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ── Result / Code box ── */
.result-box, pre.code-box {
    background: #1E293B;
    color: #E2E8F0;
    padding: 18px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    min-height: 100px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

/* ── Status badge ── */
.status-valid { color: var(--success); font-weight: 600; font-size: 0.85rem; }
.status-invalid { color: var(--danger); font-weight: 600; font-size: 0.85rem; }
.status-info { color: var(--muted); font-size: 0.82rem; }

/* ── Features list ── */
.tm-features {
    background: var(--surface);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    margin-bottom: 24px;
}
.tm-features h3 { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.tm-features ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.tm-features li { font-size: 0.85rem; color: var(--muted); padding: 4px 0 4px 20px; position: relative; }
.tm-features li::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* ── Related tools ── */
.related-tools { margin-bottom: 28px; }
.related-tools h3 { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.related-links { display: flex; gap: 8px; flex-wrap: wrap; }
.related-links a {
    padding: 7px 14px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.related-links a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ── Toast notification ── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
    box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* (page-footer styles moved to Shared Footer section above) */

/* ── Ad Slots ── */
.ad-slot {
    background: #FAFBFC;
    border: 1.5px dashed #CBD5E1;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
    overflow: hidden;
    color: #94A3B8;
}
.ad-slot::before {
    content: 'Advertisement';
    position: absolute;
    top: 6px; left: 12px;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #CBD5E1;
}
.ad-slot-size { font-size: 0.8rem; font-weight: 500; color: #CBD5E1; }
.ad-slot-note { font-size: 0.72rem; color: #E2E8F0; }

/* Leaderboard 728×90 */
.ad-leaderboard { width: 100%; height: 100px; margin-bottom: 24px; }
/* Horizontal banner */
.ad-banner { width: 100%; height: 96px; margin-top: 24px; }
/* Sidebar rectangle 300×250 */
.ad-rectangle { width: 100%; height: 260px; }

/* ── Tool page sidebar layout ── */
.tool-page-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}
.tool-page-main { flex: 1; min-width: 0; }
.tool-page-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 72px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 1100px) {
    .tool-page-sidebar { display: none; }
}
@media (max-width: 768px) {
    .ad-leaderboard, .ad-banner { height: 76px; }
    .container { padding: 20px 16px 40px; }
}

/* ── Content pages (about / contact / privacy) ── */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 32px 72px;
}
@media (max-width: 768px) { .content-page { padding: 28px 16px 48px; } }

.content-page h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.content-page .page-intro {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 40px;
    padding-bottom: 28px;
    border-bottom: 1.5px solid var(--border);
}
.content-page h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 36px 0 12px;
}
.content-page h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 20px 0 8px;
}
.content-page p {
    color: var(--muted);
    line-height: 1.75;
    margin-bottom: 12px;
}
.content-page ul, .content-page ol {
    color: var(--muted);
    padding-left: 22px;
    margin-bottom: 16px;
    line-height: 1.75;
}
.content-page li { margin-bottom: 6px; }
.content-page strong { color: var(--text-secondary); font-weight: 600; }

.content-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin: 20px 0;
}
.content-card h2 { margin-top: 0; }

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
.content-grid-item {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}
.content-grid-item h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 0.95rem;
}
.content-grid-item p { margin-bottom: 0; font-size: 0.9rem; }

.content-highlight {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 16px 20px;
    margin: 20px 0;
    color: var(--text-secondary);
}

.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 20px 0;
}
.contact-info-item {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.contact-info-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}
.contact-info-item strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.contact-info-item a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.contact-info-item a:hover { text-decoration: underline; }

.faq-list { margin: 20px 0; }
.faq-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.faq-answer {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.7;
}
