@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --primary: #ffffff;
    --secondary: #8b8b8b;
    --accent: #3b82f6;
    --success: #10b981;
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --bg-hover: #1a1a1a;
    --border: #262626;
    --border-light: #404040;
}

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

body {
    background: var(--bg-primary);
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--primary);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

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

.card-elevated {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.card-elevated:hover {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 20px 60px -10px rgba(0, 0, 0, 0.7);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.input-field {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 10px 14px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.input-field:focus {
    outline: none;
    border-color: var(--border-light);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.input-field::placeholder {
    color: var(--secondary);
}

.CodeMirror {
    height: 320px;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 4px;
}

@media (min-width: 768px) {
    .CodeMirror {
        height: 420px;
    }
}

.CodeMirror-gutters {
    background: var(--bg-secondary) !important;
    border-right: 1px solid var(--border) !important;
}

.CodeMirror-linenumber {
    color: var(--secondary) !important;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--secondary);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background: var(--accent);
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
    background: white;
}

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

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

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

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.animate-up {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-in {
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.stagger-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.stagger-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

.stagger-4 {
    animation-delay: 0.4s;
    opacity: 0;
}

.bookmarklet-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
    padding: 14px 28px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

@media (max-width: 640px) {
    .bookmarklet-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

.bookmarklet-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translate(-50%, -50%) rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
}

.bookmarklet-btn:hover::before {
    transform: translate(-50%, -50%) rotate(45deg) translateX(100%);
}

.bookmarklet-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-width: 90vw;
}

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

.toast::before {
    content: '✓';
    display: inline-block;
    margin-right: 8px;
    color: var(--success);
    font-weight: bold;
}

.code-output {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--secondary);
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    position: relative;
}

.code-output::-webkit-scrollbar {
    width: 8px;
}

.code-output::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.code-output::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.code-output::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.2s;
}

.stat-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.guide-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.guide-section:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

pre {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
    font-size: 11px;
}

@media (min-width: 768px) {
    pre {
        font-size: 12px;
    }
}

code {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #8b8b8b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.icon-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    .mobile-hide {
        display: none;
    }

    .options-grid {
        grid-template-columns: 1fr !important;
    }
}