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

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

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

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

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.logo-icon {
    font-size: 28px;
}

.nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.mobile-menu.show {
    display: block;
}

.mobile-nav-link {
    display: block;
    padding: 12px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

/* Main */
.main {
    flex: 1;
    padding: 40px 0;
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 0;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 16px;
    color: var(--text);
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Search */
.search-box {
    max-width: 500px;
    margin: 30px auto 0;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

/* Tool Categories */
.category-section {
    margin-bottom: 50px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.category-icon {
    font-size: 28px;
}

.category-title {
    font-size: 24px;
    font-weight: 700;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    cursor: pointer;
}

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

.tool-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--primary);
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tool Page Layout */
.tool-page {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    min-height: calc(100vh - 200px);
}

.sidebar {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.sidebar h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-link {
    display: block;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.sidebar-link:hover, .sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.tool-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--border);
}

.tool-content h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.tool-content .description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

textarea, input[type="text"], select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: 'Fira Code', 'Consolas', monospace;
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
}

textarea:focus, input[type="text"]:focus, select:focus {
    border-color: var(--primary);
}

textarea {
    min-height: 200px;
}

textarea.code-input {
    min-height: 300px;
    font-size: 13px;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Options */
.options-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-item label {
    font-size: 14px;
    color: var(--text-secondary);
}

.option-item select, .option-item input {
    padding: 8px 12px;
}

/* Output */
.output-area {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    min-height: 150px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 500px;
    overflow-y: auto;
}

.output-area.success {
    border-color: var(--success);
    background: #f0fdf4;
}

.output-area.error {
    border-color: var(--error);
    background: #fef2f2;
}

/* Status */
.status {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-weight: 500;
}

.status.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

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

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Diff */
.diff-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.diff-added {
    background: #f0fdf4;
    border-left: 4px solid var(--success);
    padding: 8px;
}

.diff-removed {
    background: #fef2f2;
    border-left: 4px solid var(--error);
    padding: 8px;
}

/* Hash */
.hash-results {
    display: grid;
    gap: 12px;
}

.hash-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
}

.hash-label {
    font-weight: 600;
    color: var(--primary);
    min-width: 70px;
}

.hash-value {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    word-break: break-all;
    flex: 1;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 1;
}

/* Footer */
.footer {
    background: var(--text);
    color: white;
    padding: 50px 0 20px;
    margin-top: auto;
}

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

.footer h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.footer h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--primary-light);
}

.footer p {
    color: #94a3b8;
    font-size: 14px;
}

.footer a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    padding: 4px 0;
    font-size: 14px;
    transition: color 0.2s;
}

.footer a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #334155;
    color: #64748b;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .tool-page {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .hero h1 {
        font-size: 32px;
    }

    .diff-container {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
        justify-content: center;
    }
}
