/* Premium Developer Tool CSS */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --danger: #ef4444;
  --warning-bg: #fffbeb;
  --warning-border: #fcd34d;
  --warning-text: #92400e;
  --code-bg: #f1f5f9;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --border: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e3a8a;
  --danger: #f87171;
  --warning-bg: #422006;
  --warning-border: #92400e;
  --warning-text: #fde68a;
  --code-bg: #020617;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
ul { list-style: none; }
img, svg { max-width: 100%; height: auto; }

/* Header & Nav */
header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
}
.nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo a {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-icon { width: 24px; height: 24px; fill: var(--primary); color: var(--primary); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-main); }
.header-actions { display: flex; align-items: center; gap: 1rem; }

.theme-toggle, .mobile-toggle {
  background: none; border: none; cursor: pointer; color: var(--text-main);
  display: flex; align-items: center; justify-content: center;
  padding: 0.5rem; border-radius: var(--radius); transition: background-color 0.2s;
}
.theme-toggle:hover, .mobile-toggle:hover { background-color: var(--surface-hover); }
.mobile-toggle { display: none; }

/* Containers & Grids */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Hero Section */
.hero { text-align: center; padding: 4rem 1rem 3rem; }
.hero-badge {
  display: inline-block; padding: 0.25rem 0.75rem; background-color: var(--primary-light);
  color: var(--primary); border-radius: 99px; font-size: 0.875rem; font-weight: 600;
  margin-bottom: 1.5rem;
}
.hero h1 { font-size: 3rem; font-weight: 800; color: var(--text-main); margin-bottom: 1rem; line-height: 1.2; }
.hero p { font-size: 1.25rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 2rem; }
.hero-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius); font-weight: 600; font-size: 1rem;
  cursor: pointer; transition: all 0.2s; border: 1px solid transparent; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background-color: var(--primary); color: #ffffff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background-color: var(--primary-hover); color: #ffffff; }
.btn-secondary { background-color: var(--surface); color: var(--text-main); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background-color: var(--surface-hover); border-color: var(--border); color: var(--text-main); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* Features Grid */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin: 4rem 0;
}
.feature-card {
  background-color: var(--surface); padding: 2rem; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); text-align: left;
}
.feature-icon {
  width: 40px; height: 40px; border-radius: 8px; background-color: var(--primary-light);
  color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.feature-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; color: var(--text-main); }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Tool UI */
.tool-container {
  background-color: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden; margin-bottom: 3rem; max-width: 900px; margin-left: auto; margin-right: auto;
}
.tool-header { padding: 1.5rem; border-bottom: 1px solid var(--border); background-color: var(--bg); }
.tool-header h2 { font-size: 1.25rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.tool-body { padding: 1.5rem; display: grid; gap: 1.5rem; }

.input-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.95rem; }
.input-options { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.875rem; color: var(--text-muted); }
textarea, input[type="text"], input[type="email"] {
  width: 100%; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background-color: var(--bg); color: var(--text-main); font-family: var(--font-sans); font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { min-height: 150px; resize: vertical; }
textarea:focus, input[type="text"]:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.md5-output-box {
  font-family: var(--font-mono); font-size: 1.25rem; font-weight: 600; letter-spacing: 1px;
  word-break: break-all; background-color: var(--surface-hover); color: var(--primary); border: 1px solid var(--border);
}
.tool-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid var(--border); }
.status-msg { font-size: 0.875rem; font-weight: 500; color: #10b981; opacity: 0; transition: opacity 0.3s; }

/* Examples Row */
.example-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.example-btn {
  background-color: var(--surface-hover); border: 1px solid var(--border); color: var(--text-muted);
  padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
}
.example-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Warning Box */
.warning-box {
  background-color: var(--warning-bg); border-left: 4px solid var(--warning-border);
  padding: 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 2rem 0; color: var(--text-main);
  display: flex; gap: 1rem; align-items: flex-start;
}
.warning-box svg { flex-shrink: 0; color: var(--warning-text); }
.warning-content strong { color: var(--warning-text); display: block; margin-bottom: 0.25rem; }
.warning-content p { margin: 0; font-size: 0.95rem; }

/* Content Formatting */
.content-section { margin-bottom: 4rem; }
.content-section h2 { font-size: 2rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.content-section h3 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.content-section p { margin-bottom: 1.25rem; font-size: 1.05rem; }
.content-section ul, .content-section ol { margin-bottom: 1.5rem; padding-left: 1.5rem; font-size: 1.05rem; }
.content-section li { margin-bottom: 0.5rem; }
code {
  background-color: var(--code-bg); padding: 0.2rem 0.4rem; border-radius: 4px;
  font-family: var(--font-mono); font-size: 0.9em; border: 1px solid var(--border);
}

/* Tables */
.table-responsive { overflow-x: auto; margin: 2rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 1rem; border-bottom: 1px solid var(--border); }
th { background-color: var(--surface-hover); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { color: var(--border); }

/* Article Layout */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 3rem; align-items: start; }
.article-header { margin-bottom: 2rem; }
.article-meta { display: flex; gap: 1rem; color: var(--text-muted); font-size: 0.875rem; margin-top: 1rem; }
.article-sidebar { position: sticky; top: calc(var(--header-height) + 2rem); }
.sidebar-widget { background-color: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.sidebar-widget h4 { font-size: 1.125rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 0.5rem; }
.toc-list a { color: var(--text-muted); font-size: 0.9rem; display: block; }
.toc-list a:hover { color: var(--primary); }
.toc-h3 { padding-left: 1rem; }

/* Blog Cards */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.blog-card {
  background-color: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column;
}
.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.blog-category { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); font-weight: 700; margin-bottom: 0.5rem; display: block; }
.blog-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; line-height: 1.3; }
.blog-card h3 a { color: var(--text-main); }
.blog-card h3 a:hover { color: var(--primary); text-decoration: none; }
.blog-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex: 1; }
.blog-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 1rem; }

/* FAQ */
.faq-list details { background-color: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.faq-list summary { padding: 1.25rem; font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 3rem; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+'; position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--text-muted);
}
.faq-list details[open] summary { border-bottom: 1px solid var(--border); color: var(--primary); }
.faq-list details[open] summary::after { content: '−'; color: var(--primary); }
.faq-list .faq-answer { padding: 1.25rem; color: var(--text-muted); }
.faq-list .faq-answer p:last-child { margin-bottom: 0; }

/* Footer */
footer { background-color: #0f172a; color: #cbd5e1; padding: 4rem 1.5rem 2rem; margin-top: 4rem; border-top: 1px solid var(--border); }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 3rem; margin-bottom: 3rem; }
.footer-col h4 { color: #f8fafc; font-size: 1.125rem; margin-bottom: 1.25rem; font-weight: 600; }
.footer-col p { font-size: 0.95rem; line-height: 1.6; margin-bottom: 1rem; }
.footer-col ul li { margin-bottom: 0.75rem; }
.footer-col a { color: #94a3b8; transition: color 0.2s; font-size: 0.95rem; }
.footer-col a:hover { color: #ffffff; text-decoration: none; }
.footer-bottom { text-align: center; padding-top: 2rem; border-top: 1px solid #1e293b; color: #64748b; font-size: 0.875rem; }


/* Responsive Global Fixes */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

img, svg, video {
    max-width: 100%;
    height: auto;
}

code {
    word-break: break-word;
}

.table-responsive {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.md5-output-box {
    word-break: break-all;
}

/* Touch Targets */
.btn, button, .faq-list summary {
    min-height: 44px;
}

/* Typography Scale */
.hero h1 { font-size: clamp(2rem, 8vw, 3rem); }
.hero p { font-size: clamp(1rem, 4vw, 1.25rem); }
.content-section h2 { font-size: clamp(1.5rem, 6vw, 2rem); }
.content-section h3 { font-size: clamp(1.2rem, 5vw, 1.5rem); }

/* Layout Resets */
.btn-group { display: flex; gap: 1rem; }

@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
    .article-sidebar {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .container, .container-sm, .nav-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        box-shadow: var(--shadow-md);
        z-index: 50;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        padding: 0.75rem 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .mobile-toggle {
        display: flex;
        min-height: 44px;
        min-width: 44px;
        align-items: center;
        justify-content: center;
    }
    
    .hero {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .tool-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .tool-footer .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .tool-footer .btn {
        width: 100%;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .warning-box {
        flex-direction: column;
        border-left: none;
        border-top: 4px solid var(--warning-border);
        border-radius: 0 0 var(--radius) var(--radius);
    }
}

@media (max-width: 480px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .breadcrumbs {
        flex-wrap: wrap;
        line-height: 1.8;
    }
}

.btn-generate { width: 100%; max-width: 300px; }
