/* Clean, minimal design - no gradients, no glassmorphism */

:root {
    --bg: #fafafa;
    --bg-alt: #f0f0f5;
    --bg-header: rgba(250, 250, 250, 0.85);
    --text: #1a1a2e;
    --text-muted: #555566;
    --text-desc: #444455;
    --border: #d8d8e0;
    --border-strong: #b8b8c8;
    --accent: #512BD4; /* .NET purple */
    --accent-hover: #4318a5;
    --accent-light: rgba(81, 43, 212, 0.1);
    --accent-glow: rgba(81, 43, 212, 0.2);
    --success: #059669;
    --error: #dc2626;
    --code-bg: #eeeef5;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --header-shadow: 0 1px 8px rgba(81, 43, 212, 0.08);
}

[data-theme="dark"] {
    --bg: #0f1219;
    --bg-alt: #1a1f2e;
    --bg-header: rgba(15, 18, 25, 0.9);
    --text: #e8eaf0;
    --text-muted: #8a8fa8;
    --text-desc: #9a9fb8;
    --border: #2a2f40;
    --border-strong: #3a4055;
    --accent-light: rgba(81, 43, 212, 0.2);
    --accent-glow: rgba(81, 43, 212, 0.35);
    --code-bg: #1a1f2e;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
    --header-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--header-shadow);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.logo {
    font-weight: 800;
    font-size: 20px;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 2px;
    transform: rotate(45deg);
}

.logo:hover {
    transform: scale(1.02);
    text-shadow: 0 0 20px var(--accent-glow);
}

.nav-links {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-links a.external {
    color: var(--text-muted);
    opacity: 0.8;
}

.nav-links a.external:hover {
    opacity: 1;
}

.theme-toggle {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
    transform: rotate(15deg);
}

.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* Main */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

section {
    margin-bottom: 48px;
    animation: fadeIn 0.4s ease-out;
}

section h2 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 24px;
    padding: 10px 16px;
    background: var(--accent-light);
    border-radius: 6px;
    display: inline-block;
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.tool {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.25s ease;
    position: relative;
}

.tool::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
    border-radius: 12px 12px 0 0;
    opacity: 0;
    transition: opacity 0.25s;
}

.tool:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-light);
    transform: translateY(-3px);
}

.tool:hover::before {
    opacity: 1;
}

.tool.full {
    grid-column: 1 / -1;
}

.tool h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.tool-desc {
    font-size: 13px;
    color: var(--text-desc);
    margin-bottom: 14px;
    line-height: 1.5;
}

.tool p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Inputs */
textarea,
input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    resize: vertical;
    min-height: 80px;
    font-family: "Consolas", "Monaco", "Menlo", monospace;
    font-size: 13px;
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.input-xs {
    width: 60px;
    padding: 6px 8px;
    text-align: center;
}

.input-sm {
    width: 100px;
    padding: 6px 10px;
}

.search-input {
    margin-bottom: 16px;
}

/* Buttons */
button {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 4px rgba(81, 43, 212, 0.2);
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(81, 43, 212, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(81, 43, 212, 0.2);
}

button.secondary {
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

button.secondary:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: none;
}

button.small {
    padding: 6px 12px;
    font-size: 12px;
}

.button-row {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

/* Password Generator Layout */
.pwd-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
}

.pwd-length {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.pwd-chars {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.pwd-chars label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.pwd-chars input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Options */
.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0;
    font-size: 13px;
    align-items: center;
}

.options-row label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
}

.options-row input[type="checkbox"],
.options-row input[type="radio"] {
    width: auto;
    cursor: pointer;
}

.input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.input-row input {
    flex: 1;
}

.input-row button {
    flex-shrink: 0;
}

/* Output */
.output {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-family: "Consolas", "Monaco", "Menlo", monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 44px;
    margin-top: 10px;
    transition: all 0.2s;
}

.output:hover {
    border-color: var(--border-strong);
}

.output:empty::before {
    content: "Output will appear here...";
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.7;
}

.mono {
    font-family: "Consolas", "Monaco", "Menlo", monospace;
}

/* Error */
.error {
    color: var(--error);
    font-size: 13px;
    margin: 8px 0;
}

.error:empty {
    display: none;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.form-grid select,
.form-grid input {
    width: 100%;
}

/* Cron */
.cron-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.cron-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.cron-row input {
    width: 50px;
    text-align: center;
}

.cron-output-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.cron-expr {
    flex: 1;
    margin-top: 0;
    display: flex;
    align-items: center;
}

/* Hash List */
.hash-list {
    margin-top: 12px;
}

.hash-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: background 0.15s;
}

.hash-item:hover {
    background: var(--accent-light);
}

.hash-item .type {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.hash-item .value {
    font-family: "Consolas", "Monaco", "Menlo", monospace;
    font-size: 12px;
    word-break: break-all;
    cursor: pointer;
    transition: color 0.15s;
}

.hash-item .value:hover {
    color: var(--accent);
}

.hash-item.warning .type {
    color: var(--error);
}

/* Timestamp */
.ts-list {
    margin-top: 12px;
}

.ts-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.ts-item:last-child {
    border-bottom: none;
}

.ts-item .label {
    color: var(--text-muted);
}

.ts-item .value {
    font-family: "Consolas", "Monaco", "Menlo", monospace;
}

/* JWT */
.jwt-parts {
    margin-top: 12px;
}

.jwt-part {
    margin-bottom: 12px;
}

.jwt-part .title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.jwt-part pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    font-size: 12px;
    overflow-x: auto;
}

/* Stack Trace */
.stack-list {
    margin-top: 12px;
}

.stack-item {
    padding: 10px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 13px;
    transition: background 0.15s;
}

.stack-item:hover {
    background: var(--accent-light);
}

.stack-item.error-line {
    border-left: 3px solid var(--error);
}

.stack-method {
    font-weight: 600;
    color: var(--accent);
}

.stack-file {
    color: var(--text-muted);
    font-size: 12px;
}

.stack-line {
    color: var(--success);
    font-size: 12px;
}

/* Regex */
.regex-matches {
    margin-top: 12px;
}

.match {
    display: inline-block;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 3px;
    padding: 2px 6px;
    margin: 2px;
    font-family: "Consolas", "Monaco", "Menlo", monospace;
    font-size: 13px;
    animation: fadeIn 0.2s ease-out;
}

.no-match {
    color: var(--text-muted);
    font-style: italic;
}

/* HTTP Codes */
.http-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.http-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    font-size: 13px;
    transition: background 0.15s, transform 0.15s;
}

.http-item:hover {
    background: var(--accent-light);
    transform: translateX(4px);
}

.http-code {
    font-weight: 700;
    font-family: "Consolas", "Monaco", "Menlo", monospace;
    min-width: 36px;
}

.http-code.c1xx { color: #6366f1; }
.http-code.c2xx { color: #22c55e; }
.http-code.c3xx { color: #eab308; }
.http-code.c4xx { color: #f97316; }
.http-code.c5xx { color: #ef4444; }

.http-desc {
    color: var(--text-muted);
}

/* Strength Meter */
.meter {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    transition: width 0.3s ease-out, background 0.3s;
}

.meter-fill.weak { width: 25%; background: var(--error); }
.meter-fill.fair { width: 50%; background: #f59e0b; }
.meter-fill.good { width: 75%; background: #22c55e; }
.meter-fill.strong { width: 100%; background: var(--success); }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text);
    color: var(--bg);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease-out;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-alt);
    margin-top: 48px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

footer a:hover {
    color: var(--text);
}

.kofi-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}

.kofi-link:hover {
    background: #FF5E5B;
    border-color: #FF5E5B;
    color: white !important;
}

.kofi-link svg {
    transition: transform 0.15s;
}

.kofi-link:hover svg {
    transform: scale(1.1);
}

/* Text utilities */
.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* Base Converter */
.base-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.base-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.base-grid input {
    font-family: "Consolas", "Monaco", "Menlo", monospace;
}

/* File Size Converter - Full Width */
.size-grid-full {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.size-grid-full label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: center;
}

.size-grid-full input {
    font-family: "Consolas", "Monaco", "Menlo", monospace;
    font-size: 13px;
    text-align: center;
}

/* TimeSpan Calculator */
.timespan-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.timespan-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.timespan-grid input {
    font-family: "Consolas", "Monaco", "Menlo", monospace;
    text-align: center;
}

/* Enum Flags */
.flags-presets {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 10px 0;
    flex-wrap: wrap;
}

.flags-list {
    margin-top: 10px;
}

.flag-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--code-bg);
    border-radius: var(--radius);
    margin-bottom: 6px;
    font-size: 13px;
    transition: all 0.15s;
}

.flag-item:hover {
    background: var(--accent-light);
}

.flag-item.active {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
}

.flag-bit {
    font-family: "Consolas", "Monaco", "Menlo", monospace;
    color: var(--text-muted);
    min-width: 50px;
}

.flag-name {
    font-weight: 500;
}

.flag-value {
    font-family: "Consolas", "Monaco", "Menlo", monospace;
    color: var(--accent);
    margin-left: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .size-grid-full {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .size-grid-full {
        grid-template-columns: repeat(3, 1fr);
    }

    .timespan-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    nav {
        padding: 0 16px;
    }

    .nav-links {
        display: none;
    }

    main {
        padding: 16px;
    }

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

    .form-grid {
        grid-template-columns: 1fr;
    }

    .cron-row {
        flex-wrap: wrap;
    }

    .http-grid {
        grid-template-columns: 1fr;
    }

    .base-grid {
        grid-template-columns: 1fr;
    }

    .size-grid-full {
        grid-template-columns: repeat(2, 1fr);
    }

    .timespan-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .flags-presets {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cron-output-row {
        flex-direction: column;
    }

    .cron-output-row button {
        align-self: flex-start;
    }
}
