:root {
    --bg-color: #09090b;
    --card-bg: #18181b;
    --text-color: #f4f4f5;
    --accent-color: #3b82f6;
    --secondary-color: #a1a1aa;
    --border-color: #27272a;
    --input-bg: #27272a;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 32px;
    border: 1px solid var(--border-color);
}

header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.025em;
}

.category-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.cat-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    padding: 6px 14px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.cat-btn:hover {
    background-color: var(--input-bg);
}

.cat-btn.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.converter-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group input, .input-group select {
    background-color: var(--input-bg);
    border: 1px solid transparent;
    color: var(--text-color);
    padding: 14px;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input {
    font-family: var(--font-mono);
}

.input-group input:focus {
    border-color: var(--accent-color);
}

.input-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a1a1aa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.swap-icon {
    display: flex;
    justify-content: center;
    margin: -10px 0;
    z-index: 10;
}

#swap-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#swap-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

#swap-btn:active {
    transform: scale(0.9);
}

.history-section {
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.history-section h3 {
    font-size: 0.875rem;
    margin-bottom: 16px;
    color: var(--secondary-color);
}

#history-list {
    list-style: none;
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.8125rem;
    margin-bottom: 16px;
}

#history-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    color: var(--secondary-color);
}

#clear-history {
    background: transparent;
    border: none;
    color: #f87171;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
}

#clear-history:hover {
    text-decoration: underline;
}

footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--secondary-color);
    opacity: 0.5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
