:root {
    --bg-color: #0A1F1C;
    --card-bg: rgba(255, 255, 255, 0.05);
    --primary-color: #00B894;
    --secondary-color: #55EFC4;
    --accent-color: #FDCB6E;
    --text-color: #FFFFFF;
    --text-muted: #B2BEC3;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.container {
    width: 100%;
    max-width: 600px;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-primary {
    color: var(--primary-color);
    width: 32px;
    height: 32px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.converter-card, .history-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    min-width: 80px;
    flex: 1;
}

.tab i {
    width: 20px;
    height: 20px;
}

.tab span {
    font-size: 0.8rem;
    font-weight: 500;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

.tab.active {
    background: var(--primary-color);
    color: var(--bg-color);
}

/* Inputs */
.converter-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.input-group input, .input-group select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    font-family: inherit;
    width: 100%;
    transition: var(--transition);
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.2);
}

.input-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23B2BEC3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.swap-container {
    display: flex;
    justify-content: center;
    margin: -0.5rem 0;
}

#swapBtn {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--accent-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1;
}

#swapBtn:hover {
    transform: rotate(180deg);
    background: var(--accent-color);
    color: var(--bg-color);
}

.formula-display {
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* History */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-text:hover {
    opacity: 0.8;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 0.9rem;
}

.history-value {
    font-weight: 500;
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem 0;
    font-style: italic;
}

footer {
    text-align: center;
    margin-top: 2.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (min-width: 601px) {
    .converter-inputs {
        flex-direction: row;
        align-items: flex-end;
    }
    
    .input-group {
        flex: 1;
    }
    
    .swap-container {
        margin: 0;
        padding-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .category-tabs {
        justify-content: flex-start;
    }
    
    .tab {
        flex: 0 0 70px;
    }
}
