:root {
    --primary: #f97316;
    --primary-light: #fdba74;
    --bg: #fff7ed;
    --card-bg: #ffffff;
    --text: #431407;
    --text-muted: #9a3412;
    --border: #fed7aa;
    --font-main: 'DM Sans', sans-serif;
    --font-display: 'Playfair Display', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kitchen-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(#fdba74 1px, transparent 1px),
        radial-gradient(#fdba74 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0.3;
    z-index: -1;
}

.container {
    width: 90%;
    max-width: 500px;
    text-align: center;
}

header {
    margin-bottom: 2rem;
}

.icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-muted);
}

.converter-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.1);
    border: 1px solid var(--border);
}

.tabs {
    display: flex;
    background: #fff7ed;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.panel {
    display: none;
    animation: fadeUp 0.3s ease;
}

.panel.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

select,
input,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s;
}

select:focus,
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.conversion-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.arrow {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: bold;
}

.scale-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.scale-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
}

.scale-btn.active,
.scale-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

textarea {
    min-height: 100px;
    resize: vertical;
    margin-bottom: 1rem;
}

.action-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}

.action-btn:hover {
    background: #ea580c;
    transform: translateY(-2px);
}

.recipe-output {
    margin-top: 1.5rem;
    text-align: left;
    white-space: pre-wrap;
    background: #fff7ed;
    padding: 1rem;
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.9rem;
    display: none;
}

.recipe-output.visible {
    display: block;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    margin-top: 2rem;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 400px) {
    .conversion-row {
        flex-direction: column;
    }

    .arrow {
        transform: rotate(90deg);
    }
}