/* ========== SToolMe.com - Main Stylesheet ========== */

/* --- CSS Variables --- */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 1200px;
    --transition: .2s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, textarea, select {
    font: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { color: var(--secondary); line-height: 1.3; font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1rem; }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { color: var(--text-light); font-size: 1.1rem; max-width: 640px; margin: .75rem auto 0; }

/* --- Header / Navbar --- */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.logo span { color: var(--primary); }
.nav-links { display: flex; gap: 1.75rem; align-items: center; }
.nav-links a {
    color: var(--text);
    font-weight: 500;
    font-size: .95rem;
    transition: color var(--transition);
    position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
    transition: var(--transition);
}

/* --- Hero --- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: var(--white);
    padding: 5rem 0 4rem;
    text-align: center;
}
.hero h1 { color: var(--white); margin-bottom: 1rem; font-size: clamp(2.25rem, 5vw, 3.25rem); }
.hero p { color: rgba(255,255,255,.85); font-size: 1.15rem; max-width: 640px; margin: 0 auto 2rem; }
.hero-search {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}
.hero-search input {
    width: 100%;
    padding: 1rem 1.25rem;
    padding-right: 3.5rem;
    border-radius: 50px;
    font-size: 1rem;
    background: var(--white);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}
.hero-search button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
}
.hero-search button:hover { background: var(--primary-dark); }
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat-num { font-size: 1.75rem; font-weight: 800; display: block; }
.hero-stats .stat-label { font-size: .85rem; opacity: .8; }

/* --- Tool Cards Grid --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.tool-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}
.tool-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary);
}
.tool-card .icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}
.tool-card h3 { margin-bottom: .5rem; }
.tool-card p { color: var(--text-light); font-size: .9rem; flex: 1; }
.tool-card .card-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: 1rem;
    font-weight: 600;
    font-size: .9rem;
    color: var(--primary);
}
.tool-card .card-link:hover { gap: .6rem; }

/* --- Categories Section --- */
.categories { background: var(--white); }
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.cat-item {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
}
.cat-item:hover { border-color: var(--primary); background: var(--primary-light); }
.cat-item .cat-icon { font-size: 2rem; margin-bottom: .5rem; display: block; }
.cat-item span { font-weight: 600; font-size: .9rem; }

/* --- Tool Page Layout --- */
.tool-page { padding: 2rem 0 4rem; }
.tool-header {
    text-align: center;
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}
.tool-header h1 { margin-bottom: .5rem; }
.tool-header p { color: var(--text-light); max-width: 640px; margin: 0 auto; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }
.tool-workspace {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow);
}
.tool-workspace label {
    display: block;
    font-weight: 600;
    margin-bottom: .5rem;
    font-size: .95rem;
}
.tool-workspace textarea,
.tool-workspace input[type="text"],
.tool-workspace input[type="number"],
.tool-workspace input[type="url"],
.tool-workspace select {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    transition: border-color var(--transition);
    background: var(--bg);
}
.tool-workspace textarea:focus,
.tool-workspace input:focus,
.tool-workspace select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.tool-workspace textarea { resize: vertical; min-height: 150px; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-group { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.result-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 1rem;
    min-height: 80px;
    font-family: 'Fira Code', monospace;
    font-size: .9rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* --- Content Article --- */
.article-content {
    max-width: 800px;
    margin: 0 auto;
}
.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary-light);
}
.article-content h3 { margin-top: 1.5rem; margin-bottom: .75rem; }
.article-content ul, .article-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: .5rem; }
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--primary-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-content code {
    background: var(--bg);
    padding: .15rem .4rem;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: .9em;
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
.article-content th, .article-content td {
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}
.article-content th {
    background: var(--primary-light);
    font-weight: 600;
}

/* --- FAQ Section --- */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: .75rem;
    overflow: hidden;
}
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    background: var(--white);
    text-align: left;
    transition: background var(--transition);
}
.faq-question:hover { background: var(--bg); }
.faq-question .arrow { transition: transform var(--transition); }
.faq-item.open .faq-question .arrow { transform: rotate(180deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.faq-answer-inner {
    padding: 0 1.25rem 1rem;
    color: var(--text-light);
    font-size: .9rem;
    line-height: 1.7;
}

/* --- Related Tools --- */
.related-tools {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* --- Footer --- */
.footer {
    background: var(--secondary);
    color: rgba(255,255,255,.7);
    padding: 3.5rem 0 1.5rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}
.footer h4 { color: var(--white); margin-bottom: 1rem; font-size: 1rem; }
.footer-about p { font-size: .9rem; line-height: 1.7; }
.footer-links a {
    display: block;
    color: rgba(255,255,255,.7);
    padding: .25rem 0;
    font-size: .9rem;
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-bottom a { color: rgba(255,255,255,.6); }
.footer-bottom a:hover { color: var(--white); }

/* --- Back to Top --- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
    z-index: 999;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* --- Cookie Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--secondary);
    color: var(--white);
    padding: 1.25rem 1.5rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 2000;
    flex-wrap: wrap;
    font-size: .9rem;
}
.cookie-banner.show { display: flex; }
.cookie-banner a { color: var(--accent); }
.cookie-btn {
    background: var(--primary);
    color: var(--white);
    padding: .5rem 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: background var(--transition);
    white-space: nowrap;
}
.cookie-btn:hover { background: var(--primary-dark); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        transform: translateY(-120%);
        transition: transform .3s ease;
        z-index: 999;
    }
    .nav-links.open { transform: translateY(0); }
    .hamburger { display: flex; }
    .hero { padding: 3rem 0; }
    .hero-stats { gap: 1.5rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .tool-workspace { padding: 1.25rem; }
    .tools-grid { grid-template-columns: 1fr; }
}

/* --- Page Specific Styles --- */
.page-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 3rem;
    margin: 2rem auto;
    max-width: 900px;
    box-shadow: var(--shadow);
}
.page-content h1 { margin-bottom: 1.5rem; }
.page-content h2 { margin-top: 2rem; margin-bottom: .75rem; }
.page-content p { line-height: 1.8; }
.page-content ul { list-style: disc; padding-left: 1.5rem; margin: 1rem 0; }
.page-content li { margin-bottom: .5rem; }

/* --- Color Preview Boxes --- */
.color-preview {
    width: 100%;
    height: 120px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    transition: background .2s;
}
.color-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* --- Two Column Tool Layout --- */
.tool-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .tool-columns { grid-template-columns: 1fr; }
    .page-content { padding: 1.5rem; margin: 1rem; }
}

/* --- Password Strength Bar --- */
.strength-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    margin-top: .5rem;
    overflow: hidden;
}
.strength-bar .fill {
    height: 100%;
    border-radius: 4px;
    transition: width .3s, background .3s;
    width: 0;
}

/* --- QR Code container --- */
.qr-output { display: flex; justify-content: center; padding: 1rem; }
.qr-output canvas { border-radius: var(--radius-sm); }

/* --- All Tools Page --- */
.all-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

/* --- About Page Feature Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.feature-item {
    text-align: center;
    padding: 2rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.feature-item .f-icon { font-size: 2rem; margin-bottom: 1rem; display: block; }
.feature-item h3 { margin-bottom: .5rem; }
.feature-item p { color: var(--text-light); font-size: .9rem; }

/* print-friendly */
@media print {
    .navbar, .footer, .cookie-banner, .back-to-top, .hero-search { display: none !important; }
    body { background: #fff; }
    .tool-workspace { box-shadow: none; border: 1px solid #ccc; }
}
