:root {
    /* Midnight Aurora Palette */
    --primary: #6C5CE7;
    --primary-hover: #5849C4;
    --secondary: #A29BFE;
    --accent: #FD79A8;
    --bg-base: #0D0B1E;
    --bg-panel: rgba(22, 19, 44, 0.7);
    --bg-input: rgba(6, 5, 14, 0.5);

    --border-light: rgba(108, 92, 231, 0.2);
    --border-focus: rgba(108, 92, 231, 0.6);
    --border-accent: rgba(253, 121, 168, 0.4);

    --text-main: #F4F4F9;
    --text-muted: #8E8AAB;

    --error-color: #ff4757;
    --success-color: #2ed573;
    --warning-color: #eccc68;

    --radius: 12px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --glow-primary: 0 0 20px rgba(108, 92, 231, 0.3);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Base Graphic Background */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 15% 30%, rgba(108, 92, 231, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 70%, rgba(253, 121, 168, 0.06) 0%, transparent 45%);
    z-index: -1;
}

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

.text-gradient {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.text-sm {
    font-size: 0.85rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-row {
    display: flex;
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-s {
    gap: 0.75rem;
}

.gap-m {
    gap: 1rem;
}

.gap-l {
    gap: 1.5rem;
}

.mt-s {
    margin-top: 0.75rem;
}

.mt-m {
    margin-top: 1rem;
}

.mb-m {
    margin-bottom: 1rem;
}

.ml-s {
    margin-left: 0.5rem;
}

.pt-m {
    padding-top: 1rem;
}

.p-0 {
    padding: 0;
}

.mt-auto {
    margin-top: auto;
}

.full-width {
    width: 100%;
}

.flex-1 {
    flex: 1;
    min-height: 0;
}

.border-t {
    border-top: 1px solid var(--border-light);
}

/* Layout Elements */
.app-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100vh;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.shadow-glow {
    box-shadow: var(--glow-primary);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.app-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem;
    border-radius: 8px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover {
    color: var(--text-main);
}

.nav-btn.active {
    background: rgba(108, 92, 231, 0.2);
    color: var(--text-main);
}

/* Workspaces */
.workspace {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    min-height: 0;
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.input-section {
    max-width: 450px;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.15);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.panel-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Form Controls */
.form-input {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    resize: none;
    white-space: pre;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: var(--transition);
}

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

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.outline-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.outline-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sm-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

.error-btn {
    border-color: rgba(255, 71, 87, 0.4);
    color: var(--error-color);
}

.error-btn:hover {
    background: rgba(255, 71, 87, 0.1);
}

/* Presets */
.presets-bar {
    flex-wrap: wrap;
}

.preset-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--border-light);
    color: var(--secondary);
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.preset-btn:hover {
    border-color: var(--secondary);
    background: rgba(162, 155, 254, 0.1);
}

/* Custom Checkbox */
.checkbox-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    color: var(--text-muted);
    transition: var(--transition);
}

.custom-checkbox:hover {
    color: var(--text-main);
}

.custom-checkbox input {
    display: none;
}

.custom-checkbox .checkmark {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    background: var(--bg-input);
    position: relative;
    transition: var(--transition);
}

.custom-checkbox input:checked~.checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox input:checked~.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Results Elements */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.result-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.result-url {
    font-size: 0.9rem;
    color: var(--accent);
    word-break: break-all;
    font-weight: 500;
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-ok {
    background: rgba(46, 213, 115, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.status-error {
    background: rgba(255, 71, 87, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.tag-row {
    margin-bottom: 0.75rem;
}

.tag-lbl {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.tag-input-group {
    display: flex;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-input);
}

.tag-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
}

.tag-input-group .copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-left: 1px solid var(--border-light);
    color: var(--secondary);
    padding: 0 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.85rem;
}

.tag-input-group .copy-btn:hover {
    background: rgba(108, 92, 231, 0.2);
    color: #fff;
}

.error-details {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    border-left: 2px solid var(--error-color);
}

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.history-table th,
.history-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table th {
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(0, 0, 0, 0.2);
}

.history-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.hash-preview {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncate-url {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* Modal / Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #FFF;
    color: #0D0B1E;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(108, 92, 231, 0.3);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(108, 92, 231, 0.6);
}

@media (max-width: 900px) {
    .workspace {
        flex-direction: column;
    }

    .input-section {
        max-width: 100%;
        height: 50vh;
    }
}