/* CryptoPlayground - Core Styles */

:root {
    /* Refined color system */
    --color-bg-primary: #0a0a0f;
    --color-bg-secondary: #12121a;
    --color-bg-tertiary: #1a1a24;
    --color-bg-elevated: #22222e;

    --color-text-primary: #f0f0f5;
    --color-text-secondary: #9090a0;
    --color-text-muted: #606070;

    --color-accent: #6366f1;
    --color-accent-dim: #4f46e5;
    --color-accent-glow: rgba(99, 102, 241, 0.15);

    --color-success: #22c55e;
    --color-warning: #eab308;
    --color-error: #ef4444;

    --color-border: #2a2a38;
    --color-border-subtle: #1e1e28;

    --color-input-bg: #0e0e14;
    --color-input-border: #2a2a38;
    --color-input-focus: #3a3a4a;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 14px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--color-accent-glow);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 120ms;
    --duration-base: 200ms;
    --duration-slow: 320ms;

    /* Z-index */
    --z-sticky: 100;
    --z-modal: 200;
    --z-toast: 300;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p { margin-bottom: var(--space-4); }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

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

/* Form Elements */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    transition: all var(--duration-fast) var(--ease-out);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-accent-dim);
    background: var(--color-bg-tertiary);
}

textarea {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    resize: vertical;
    min-height: 120px;
    line-height: 1.7;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%239090a0' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
    letter-spacing: 0.01em;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-5);
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-primary {
    background: var(--color-accent);
    color: white;
}

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

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

.btn-secondary {
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

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

.btn-small {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    background: var(--color-bg-elevated);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-small:hover {
    color: var(--color-text-primary);
    border-color: var(--color-input-focus);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    color: var(--color-text-muted);
    border-radius: var(--radius-md);
    font-size: var(--text-lg);
}

.icon-btn:hover {
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
}

/* Utility */
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* Selection */
::selection {
    background: var(--color-accent);
    color: white;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
