:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --bg: #f8fafc;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --card-bg: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --header-bg: #ffffff;
    --footer-bg: #1e293b;
    --footer-text: #94a3b8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: bold;
    font-size: 1.3rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

nav { display: flex; gap: 1.5rem; align-items: center; }

nav a {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover { color: var(--primary); }

/* Breadcrumb */
.breadcrumb {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 20px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.breadcrumb a { color: var(--primary); text-decoration: none; }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 3rem 20px;
    text-align: center;
}

.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero p { font-size: 1.1rem; opacity: 0.95; }

/* Tools Grid */
.tools-section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
    flex: 1;
}

.section-title { font-size: 1.5rem; margin-bottom: 1.5rem; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.tool-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tool-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.tool-card p { font-size: 0.85rem; color: var(--text-light); }

/* Features */
.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 20px;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-light); font-size: 0.9rem; }

/* Tool Page */
.tool-page {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

.tool-page h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }

.tool-intro {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.tool-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tool-box textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
}

.tool-box textarea:focus,
.tool-box input:focus,
.tool-box select:focus {
    outline: none;
    border-color: var(--primary);
}

.tool-box input,
.tool-box select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.btn {
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-copy { background: var(--success); color: white; }

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin: 1rem 0;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
}

.stat-number { font-size: 1.8rem; font-weight: bold; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-light); text-transform: uppercase; }

/* Output */
.output-box {
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    min-height: 60px;
    margin: 0.5rem 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Content */
.content-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.content-section h2 { font-size: 1.3rem; margin-bottom: 0.8rem; }
.content-section h3 { font-size: 1.1rem; margin: 0.8rem 0 0.4rem; }
.content-section p { color: var(--text-light); margin-bottom: 0.8rem; }
.content-section ol, .content-section ul { padding-left: 1.5rem; color: var(--text-light); }
.content-section li { margin-bottom: 0.3rem; }

/* Related */
.related-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.related-tool {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: all 0.3s;
}

.related-tool:hover { border-color: var(--primary); }

/* Ad */
.ad-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 20px;
    text-align: center;
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: white;
    padding: 2rem 20px;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.footer-section h4 { margin-bottom: 0.8rem; font-size: 1rem; }
.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 0.4rem; }
.footer-section a { color: var(--footer-text); text-decoration: none; }
.footer-section a:hover { color: white; }

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid #334155;
    color: var(--footer-text);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.5rem; }
    nav { gap: 1rem; }
    nav a { font-size: 0.8rem; }
    .tools-grid { grid-template-columns: 1fr; }
    .tool-page h1 { font-size: 1.5rem; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .logo { font-size: 1.1rem; }
    .logo-icon { width: 35px; height: 35px; font-size: 1rem; }
}