/* ==========================================================================
   Developer Tools - Main Stylesheet
   ========================================================================== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f3f4f6;
    --white: #fff;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 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);
    border-bottom: 1px solid var(--border);
    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-light); 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, .tool-card h3 { font-size: 1.2rem; margin-bottom: 20px; color: var(--text); }

/* 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: var(--radius);
    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(99, 102, 241, 0.1);
}

.code-input, .code-output { 
    min-height: 200px; 
    resize: vertical; 
    font-family: 'JetBrains Mono', 'Fira Code', monospace; 
    font-size: 0.9rem;
    line-height: 1.5;
}

.monospace { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

/* Checkboxes */
.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 {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-label:hover { background: #e5e7eb; }
.checkbox-label input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

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

.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: flex; width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }

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

/* Result Card */
.result-card { border-left: 4px solid var(--success); }
.result-box {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

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

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 15px;
    border-radius: var(--radius);
    border-left: 4px solid #dc2626;
}

/* Hash Generator */
.hash-results { display: flex; flex-direction: column; gap: 15px; }
.hash-row { display: flex; align-items: center; gap: 15px; padding: 15px; background: var(--bg); border-radius: var(--radius); }
.hash-row label { font-weight: 600; min-width: 80px; }
.hash-value { flex: 1; display: flex; align-items: center; gap: 10px; }
.hash-value code { flex: 1; word-break: break-all; font-size: 0.85rem; }

/* Password Generator */
.password-row { display: flex; align-items: center; gap: 15px; padding: 15px; background: var(--bg); border-radius: var(--radius); margin-bottom: 10px; }
.password-value { flex: 1; font-family: monospace; font-size: 1.1rem; word-break: break-all; }

/* Color Converter */
.color-preview { width: 100%; height: 100px; border-radius: var(--radius); margin-bottom: 20px; }
.color-values { display: flex; flex-direction: column; gap: 10px; }
.color-row { display: flex; align-items: center; gap: 15px; padding: 12px; background: var(--bg); border-radius: var(--radius); }
.color-row label { font-weight: 600; min-width: 60px; }
.color-row code { flex: 1; }
.color-picker { height: 50px; padding: 5px; cursor: pointer; }

/* Cron Builder */
.cron-builder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; margin-bottom: 20px; }
.cron-field label { font-size: 0.85rem; margin-bottom: 5px; }
@media (max-width: 768px) { .cron-builder { grid-template-columns: repeat(3, 1fr); } }

.cron-result { background: var(--bg); padding: 20px; border-radius: var(--radius); margin-bottom: 15px; text-align: center; }
.cron-expression { font-size: 1.5rem; font-weight: 600; }
.cron-description { color: var(--text-light); margin-bottom: 20px; }
.next-runs { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.next-runs li { background: var(--bg); padding: 8px 15px; border-radius: var(--radius); font-family: monospace; }

/* Regex Tester */
.match-count { font-size: 1.2rem; font-weight: 600; color: var(--success); }
.matches-list { margin-top: 20px; }
.match-item { background: var(--bg); padding: 15px; border-radius: var(--radius); margin-bottom: 10px; }
.match-full { margin-bottom: 5px; }
.match-pos, .match-groups { font-size: 0.85rem; color: var(--text-light); }

.patterns-grid, .presets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.pattern-item, .preset-item { background: var(--bg); padding: 15px; border-radius: var(--radius); }
.pattern-item strong, .preset-item strong { display: block; margin-bottom: 5px; text-transform: capitalize; }
.pattern-item code, .preset-item code { font-size: 0.85rem; word-break: break-all; }

/* Timestamp */
.current-time { background: var(--white); border-radius: var(--radius); padding: 20px; margin-bottom: 30px; text-align: center; }
.timestamp-display { margin: 10px 0; }
.timestamp-display code { font-size: 1.2rem; background: var(--bg); padding: 8px 15px; border-radius: var(--radius); }

.conversion-results { display: flex; flex-direction: column; gap: 10px; }
.result-row { display: flex; align-items: center; gap: 15px; padding: 12px; background: var(--bg); border-radius: var(--radius); }
.result-row label { font-weight: 600; min-width: 120px; }

/* 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); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-question { font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; }
.faq-question::after { content: '+'; font-size: 1.5rem; color: var(--primary); }
.faq-item.active .faq-question::after { content: '−'; }
.faq-answer { color: var(--text-light); margin-top: 10px; 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;
}

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

.tool-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.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); }

/* Categories */
.tools-categories { margin-top: 40px; }
.category { margin-bottom: 50px; }
.category h2 { font-size: 1.5rem; margin-bottom: 20px; color: var(--text); border-left: 4px solid var(--primary); padding-left: 15px; }

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

/* Footer */
.site-footer { background: #1f2937; color: #d1d5db; 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: #9ca3af; transition: var(--transition); }
.footer-links a:hover { color: white; }

.copyright { text-align: center; padding-top: 30px; border-top: 1px solid #374151; color: #6b7280; }

/* 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; }
    .action-buttons { flex-direction: column; }
    .action-buttons .btn { width: 100%; }
}
