/* ============================================
   SEOVALLY — Professional Tool Pages Styles
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: rgba(99, 102, 241, 0.08);
    --secondary: #0ea5e9;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --error: #ef4444;
    --dark: #0f172a;
    --dark-card: #1e293b;
    --dark-border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --surface: #1e293b;
    --surface-hover: #273548;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.3);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ---- Navigation ---- */
.tool-nav {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
    padding: 0 clamp(16px, 4vw, 40px);
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tool-nav-left { display: flex; align-items: center; gap: 28px; }

.tool-nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.tool-nav-logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
    color: white;
}

.tool-nav-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}
.tool-nav-logo-text span { color: var(--primary-light); }

.tool-nav-links { display: flex; align-items: center; gap: 2px; }

.tool-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all var(--transition);
    white-space: nowrap;
}
.tool-nav-link:hover { color: var(--text); background: var(--primary-bg); }
.tool-nav-link.active { color: var(--primary-light); background: var(--primary-bg); }

.tool-nav-right { display: flex; align-items: center; gap: 10px; }

.tool-nav-btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    font-family: inherit;
    white-space: nowrap;
}

.tool-nav-btn-outline {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--dark-border);
}
.tool-nav-btn-outline:hover { border-color: var(--primary); background: var(--primary-bg); }

.tool-nav-btn-primary {
    color: white;
    background: var(--primary);
}
.tool-nav-btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.35); }

/* Hamburger menu button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--transition);
}
.hamburger:hover { background: var(--primary-bg); }
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile drawer */
.mobile-drawer {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    z-index: 99;
    padding: 24px;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    animation: slideDown 0.25s ease;
}
.mobile-drawer.open { display: flex; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-drawer a {
    color: var(--text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 14px 16px;
    border-radius: 10px;
    transition: background var(--transition);
    display: block;
}
.mobile-drawer a:hover { background: var(--primary-bg); }
.mobile-drawer a.active { color: var(--primary-light); background: var(--primary-bg); }
.mobile-drawer .mobile-divider { height: 1px; background: var(--dark-border); margin: 8px 0; }
.mobile-drawer .mobile-btn {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    margin-top: 8px;
}
.mobile-drawer .mobile-btn-outline { color: var(--text); border: 1px solid var(--dark-border); }
.mobile-drawer .mobile-btn-primary { color: white; background: var(--primary); }

/* ---- Tool Page Layout ---- */
.tool-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px clamp(16px, 4vw, 40px) 0;
    flex: 1;
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-header h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.tool-header p {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---- Tool Input ---- */
.tool-input-box {
    background: var(--surface);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 36px;
}

.tool-input-row {
    display: flex;
    gap: 12px;
}

.tool-input-field {
    flex: 1;
    padding: 16px 20px;
    border-radius: 10px;
    border: 1px solid var(--dark-border);
    background: var(--dark);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-width: 0;
}

.tool-input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.tool-input-field::placeholder { color: var(--text-dim); }

.tool-input-btn {
    padding: 16px 28px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: inherit;
}
.tool-input-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,0.35); }
.tool-input-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
/* Busy/loading state: inline spinner inside the button so clicks give instant feedback */
.tool-input-btn.loading {
    pointer-events: none;
    cursor: progress;
    opacity: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.tool-input-btn.loading::before {
    content: "";
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
    box-sizing: border-box;
    margin: 0;
}

.tool-input-extra { margin-top: 12px; font-size: 13px; color: var(--text-dim); }

/* ---- Loading State ---- */
.tool-loading { text-align: center; padding: 60px 20px; }

.tool-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--dark-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* ---- Results ---- */
.tool-results { display: none; }
.tool-results.active { display: block; }

/* Score circle */
.score-overview { display: flex; gap: 32px; align-items: center; margin-bottom: 36px; }

.score-circle {
    width: 160px;
    height: 160px;
    position: relative;
    flex-shrink: 0;
}
.score-circle svg { width: 160px; height: 160px; transform: rotate(-90deg); }
.score-circle-bg { fill: none; stroke: var(--dark-border); stroke-width: 8; }
.score-circle-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }

.score-circle-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-circle-value { font-size: 42px; font-weight: 800; }
.score-circle-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.score-info h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.score-info p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }

/* Category scores */
.category-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 36px; }

.category-score {
    background: var(--surface);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 18px;
    transition: border-color var(--transition);
}
.category-score:hover { border-color: rgba(99, 102, 241, 0.2); }

.category-score-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.category-score-label { font-size: 13.5px; font-weight: 500; color: var(--text-muted); }
.category-score-value { font-size: 18px; font-weight: 700; }

.category-score-bar { height: 5px; background: var(--dark); border-radius: 3px; overflow: hidden; }
.category-score-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }

/* Issues list */
.issues-section { margin-bottom: 36px; }
.issues-section h3 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

.issue-card {
    background: var(--surface);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 10px;
    transition: border-color var(--transition);
}
.issue-card:hover { border-color: rgba(99, 102, 241, 0.15); }

.issue-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

.issue-severity {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.issue-severity.error { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.issue-severity.warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.issue-severity.info { background: rgba(59, 130, 246, 0.12); color: var(--secondary); }
.issue-severity.success { background: rgba(16, 185, 129, 0.12); color: var(--success); }

.issue-title { font-size: 14px; font-weight: 600; }
.issue-description { color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }

/* Detail table */
.detail-table { width: 100%; border-collapse: collapse; margin-bottom: 36px; }

.detail-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--dark-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-table td {
    padding: 12px 16px;
    border: 1px solid var(--dark-border);
    font-size: 14px;
    vertical-align: top;
}

.detail-table tr:hover td { background: rgba(99, 102, 241, 0.03); }

/* Empty state */
.tool-empty { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.tool-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.tool-empty h3 { font-size: 20px; margin-bottom: 8px; color: var(--text); }

/* ============================================
   Footer
   ============================================ */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--dark-border);
    background: rgba(15, 23, 42, 0.6);
}

.footer-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px clamp(16px, 4vw, 40px) 40px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 14px;
    line-height: 1.7;
    max-width: 300px;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text);
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    padding: 5px 0;
    transition: color var(--transition);
}
.footer-col a:hover { color: var(--primary-light); }

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px clamp(16px, 4vw, 40px);
    border-top: 1px solid var(--dark-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-dim);
}
.footer-bottom a { color: var(--text-dim); text-decoration: none; }
.footer-bottom a:hover { color: var(--primary-light); }

/* ---- SEO Content Section (for tool pages) ---- */
.seo-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px clamp(16px, 4vw, 40px);
    border-top: 1px solid var(--dark-border);
}

.seo-content h2 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.seo-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 10px;
    color: var(--text);
}

.seo-content p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.seo-content ul {
    list-style: none;
    padding: 0;
    margin-bottom: 16px;
}

.seo-content ul li {
    color: var(--text-muted);
    font-size: 14.5px;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.seo-content ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

.seo-content .faq-item {
    background: var(--surface);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
}

.seo-content .faq-item h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.seo-content .faq-item p {
    font-size: 14px;
    margin-bottom: 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .tool-nav-links { display: none; }
    .tool-nav-right .tool-nav-btn-outline { display: none; }
    .hamburger { display: flex; }

    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 600px) {
    .tool-page { padding: 32px 16px 0; }
    .tool-input-row { flex-direction: column; }
    .tool-input-btn { width: 100%; }
    .score-overview { flex-direction: column; text-align: center; }
    .category-scores { grid-template-columns: 1fr 1fr; }

    .footer-main { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 400px) {
    .category-scores { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--dark-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
