:root {
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 30, 0.6);
    --bg-card-hover: rgba(30, 30, 45, 0.8);
    --border-color: rgba(99, 102, 241, 0.2);
    --border-glow: rgba(99, 102, 241, 0.4);
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    --glow-primary: rgba(99, 102, 241, 0.3);
    --glow-success: rgba(16, 185, 129, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a0a2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem 1rem;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease-out;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 20px var(--glow-primary));
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Tabs */
.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
    animation: fadeInDown 0.6s ease-out 0.1s backwards;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--border-glow);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 15px var(--glow-primary);
}

.tab-pane {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

.tab-pane.active {
    display: block;
}

/* Subtabs */
.tabs-sub {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab-sub-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.tab-sub-btn::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-sub-btn.active {
    color: var(--accent-primary);
}

.tab-sub-btn.active::after {
    transform: scaleX(1);
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Warning Card */
.warning-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
    border: 1px solid var(--accent-warning);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

.warning-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.warning-content h3 {
    color: var(--accent-warning);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.warning-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Forms */
.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.text-input,
.text-area {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.text-area {
    min-height: 100px;
    resize: vertical;
}

.text-input:focus,
.text-area:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

.radio-label input {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input:checked+.radio-custom {
    border-color: var(--accent-primary);
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.radio-label input:checked+.radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 1.5rem;
}

/* Canvas */
.canvas-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: #000;
}

#entropyCanvas,
#analysisCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    cursor: crosshair;
    touch-action: none;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.8);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.canvas-overlay.hidden {
    opacity: 0;
}

.canvas-instructions {
    text-align: center;
    color: var(--text-secondary);
}

.canvas-instructions svg {
    margin-bottom: 1rem;
    opacity: 0.6;
}

/* Entropy Stats */
.entropy-stats {
    margin-bottom: 1.5rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 120px;
}

.entropy-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.entropy-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-danger) 0%, var(--accent-warning) 50%, var(--accent-success) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
    box-shadow: 0 0 10px var(--glow-success);
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 50px;
    text-align: right;
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px var(--glow-primary);
    width: 100%;
}

.btn-primary:hover {
    box-shadow: 0 6px 25px var(--glow-primary);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-glow);
}

/* Results */
.result-card {
    animation: fadeInUp 0.6s ease-out;
}

.result-group {
    margin-bottom: 1.5rem;
}

.result-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.label-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-badge:not(.danger) {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.label-badge.danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.result-field {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.result-field:hover {
    border-color: var(--border-glow);
}

.result-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-all;
    transition: filter 0.3s ease;
}

.result-value.blurred {
    filter: blur(8px);
    user-select: none;
}

.copy-btn,
.reveal-btn {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--accent-primary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.copy-btn:hover,
.reveal-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.3);
    border-color: var(--accent-success);
    color: var(--accent-success);
}

/* QR Code */
.qr-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* Vanity Progress */
.progress-container {
    margin-top: 1.5rem;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

/* Add spacing above vanity results */
#vanityResult {
    margin-top: 2rem;
}

.progress-fill.indeterminate {
    height: 100%;
    width: 30%;
    background: var(--accent-primary);
    border-radius: 3px;
    animation: indeterminate 1.5s infinite linear;
}

@keyframes indeterminate {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(400%);
    }
}

/* Entropy Analysis */
.entropy-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.metric {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--accent-secondary);
}

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .card {
        padding: 1.5rem;
    }

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

    .stat-label,
    .stat-value {
        min-width: auto;
    }

    .entropy-bar {
        width: 100%;
    }

    .tab-nav {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
    }
}

/* QR Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.4s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

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

.qr-display {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.qr-text {
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
}

/* QR Code Button */
.qr-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.qr-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.qr-btn:active {
    transform: translateY(0);
}

/* Status Messages */
.status-message {
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 1rem;
    display: none;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.status-message.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid #10b981;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.status-message.success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.status-message.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 2px solid #ef4444;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.status-message.error::before {
    content: '✗';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

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