/* ==========================================================================
   Text Tools - Main Stylesheet
   ========================================================================== */

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --success: #27ae60;
    --warning: #f39c12;
    --error: #e74c3c;
    --text: #333;
    --text-light: #666;
    --bg: #f8f9fa;
    --white: #fff;
    --border: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Header */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); }

.nav-links { display: flex; gap: 25px; }
.nav-links a { color: var(--text); font-weight: 500; transition: var(--transition); }
.nav-links a:hover { color: var(--primary); }

/* Tool Page */
.tool-page { padding: 40px 0; }

.tool-header { text-align: center; margin-bottom: 40px; }
.tool-header h1 { font-size: 2.5rem; margin-bottom: 15px; color: var(--text); }
.tool-header .subtitle { font-size: 1.1rem; color: var(--text-light); max-width: 700px; margin: 0 auto; }

/* Tool Card */
.tool-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.tool-card h2 { font-size: 1.3rem; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--bg); }
.tool-card h3 { font-size: 1.1rem; margin: 20px 0 10px; }

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 8px; }
.form-group small { display: block; color: var(--text-light); font-size: 0.85rem; margin-top: 5px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-control, .form-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.text-input { min-height: 150px; resize: vertical; font-family: inherit; }
.text-output { background: #f5f5f5; }
.monospace { font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; font-size: 0.9rem; }

/* Checkbox & Radio */
.options-row, .options-grid { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; }
.options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: var(--bg);
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-label:hover, .radio-label:hover { background: #eee; }
.checkbox-label input, .radio-label input { width: 18px; height: 18px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #219a52; color: white; }

.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

.btn-lg { padding: 15px 30px; font-size: 1.1rem; }
.btn-block { display: block; width: 100%; }

.action-buttons { display: flex; gap: 15px; flex-wrap: wrap; }
.action-buttons .btn { flex: 1; min-width: 150px; }

.case-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.case-buttons .btn { flex: 1; min-width: 120px; }

/* Result Box */
.result-box {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.result-card { border-left: 4px solid var(--success); }

.result-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 30px; }
.stat-item { text-align: center; }
.stat-value { font-size: 2rem; font-weight: 700; color: #155724; }
.stat-label { font-size: 0.9rem; color: var(--text-light); }
.stat-item.highlight .stat-value { color: var(--primary); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.stat-card {
    text-align: center;
    padding: 15px;
    background: var(--bg);
    border-radius: var(--radius);
}

.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-light); margin-top: 5px; }

/* Keywords */
.keyword-list { display: flex; flex-wrap: wrap; gap: 10px; }
.keyword-tag {
    background: var(--bg);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}
.keyword-tag small { color: var(--text-light); margin-left: 5px; }

/* Badges */
.success-badge, .error-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}
.success-badge { background: #d4edda; color: #155724; }
.error-badge { background: #f8d7da; color: #721c24; }

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

/* Slug Output */
.slug-result {
    background: var(--bg);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.slug-output {
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--primary);
    word-break: break-all;
}

/* Compare Inputs */
.compare-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 768px) { .compare-inputs { grid-template-columns: 1fr; } }

/* Diff Output */
.diff-output { overflow-x: auto; }
.diff-output table { width: 100%; border-collapse: collapse; font-family: monospace; font-size: 0.85rem; }
.diff-output td, .diff-output th { padding: 5px 10px; border: 1px solid var(--border); }

/* HTML Preview */
.html-preview {
    background: var(--bg);
    padding: 20px;
    border-radius: 5px;
    border: 1px solid var(--border);
}

/* How-To Steps */
.how-to-steps { counter-reset: step; list-style: none; }
.how-to-steps li {
    position: relative;
    padding-left: 50px;
    margin-bottom: 15px;
    counter-increment: step;
}
.how-to-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Content Sections */
.content-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.content-section h2 { font-size: 1.5rem; margin-bottom: 20px; }
.content-section p { margin-bottom: 15px; color: var(--text-light); }

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    list-style: none;
}

.features-list li {
    padding: 12px 15px;
    background: var(--bg);
    border-radius: 5px;
    border-left: 3px solid var(--primary);
}

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-question {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question::after { content: '+'; font-size: 1.5rem; color: var(--primary); }
.faq-item.active .faq-question::after { content: '−'; }
.faq-answer { color: var(--text-light); line-height: 1.7; display: none; }
.faq-item.active .faq-answer { display: block; }

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tool-grid-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
}

.tool-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.tool-grid-item h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.tool-grid-item p { font-size: 0.9rem; color: var(--text-light); line-height: 1.5; }

/* Related Tools */
.related-tools { background: var(--bg); padding: 50px 0; }
.related-tools h2 { text-align: center; margin-bottom: 30px; }

/* Footer */
.site-footer { background: #2c3e50; color: white; padding: 50px 0 30px; }

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 { font-size: 1.1rem; margin-bottom: 20px; color: white; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #bdc3c7; transition: var(--transition); }
.footer-links a:hover { color: white; }

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container { flex-direction: column; gap: 15px; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .tool-header h1 { font-size: 1.8rem; }
    .result-stats { flex-direction: column; gap: 20px; }
    .action-buttons { flex-direction: column; }
    .action-buttons .btn { width: 100%; }
}
