@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette - Blue Theme */
    --bg-color: #0f172a;
    /* Slate 900 */
    --card-bg: #1e293b;
    /* Slate 800 */
    --card-border: #334155;
    /* Slate 700 */

    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #cbd5e1;
    /* Slate 300 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    --accent-color: #3b82f6;
    /* Blue 500 */
    --accent-hover: #2563eb;
    /* Blue 600 */
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    /* Blue to Indigo */

    --success-color: #22c55e;
    /* Green 500 */
    --error-color: #ef4444;
    /* Red 500 */

    --input-bg: #0f172a;
    --input-border: #475569;
    /* Slate 600 */
    --input-focus: #3b82f6;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Typography */
h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Status Table */
.status-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1rem;
}

.status-table th,
.status-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.status-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-table tr:last-child td {
    border-bottom: none;
}

/* General Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

th {
    background-color: rgba(15, 23, 42, 0.5);
    /* Semi-transparent Slate 900 */
    color: var(--text-secondary);
    font-weight: 600;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

input[type="text"],
input[type="username"],
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition);
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="username"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    /* Blue ring */
}

/* Custom Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    accent-color: var(--accent-color);
    width: 1.1em;
    height: 1.1em;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    color: var(--text-primary);
    cursor: pointer;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

button {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.4);
}

button:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* Result & Logs */
details {
    margin-top: 1.5rem;
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    background-color: rgba(15, 23, 42, 0.5);
}

summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
    outline: none;
    transition: color var(--transition);
}

summary:hover {
    color: var(--accent-color);
}

#dumpOptions,
#resultMsg {
    padding: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    /* Modern monospace */
    font-size: 0.85rem;
    color: var(--text-secondary);
    background-color: #0b1120;
    /* Darker than bg */
    border-top: 1px solid var(--card-border);
    white-space: pre-wrap;
    overflow-x: auto;
    border-radius: 0 0 0.5rem 0.5rem;
}

#resultMsg {
    margin-top: 1.5rem;
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
}

/* Status Indicators (Utility Classes) */
.text-success {
    color: var(--success-color);
    font-weight: 700;
    background-color: rgba(34, 197, 94, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}

.text-error {
    color: var(--error-color);
    font-weight: 700;
    background-color: rgba(239, 68, 68, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}

.text-muted {
    color: var(--text-muted);
}

.status-indicator {
    font-weight: 600;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .card {
        padding: 1rem;
    }

    /* Better option grid for small screens */
    .options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Make buttons full width and stacked */
    .btn-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    button {
        width: 100%;
        padding: 0.875rem;
        /* Larger touch target */
    }

    /* Handle Tables on Mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
        /* Reduce padding */
    }

    /* Adjust status table specifically if needed */
    .status-table th,
    .status-table td {
        white-space: normal;
        /* Allow text wrap for status table if key names are long */
    }
}