/* Base Resets & Variables */
:root {
    --color-bg: #15110f;
    --color-surface: #201a17;
    --color-text: #f4ebd0;
    --color-crema: #c8a97e;
    --color-accent: #d4af37;
    --color-under: #d9822b;
    --color-ideal: #4caf50;
    --color-over: #e53935;
    
    --radius: 8px;
    --transition: 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

/* Typography & Header */
.app-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-crema);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.app-header p {
    font-size: 0.9rem;
    color: #a09088;
}

/* Main Container */
.app-main {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Ad Placeholders */
.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #443;
    background-color: rgba(0, 0, 0, 0.2);
    color: #665;
    font-weight: 600;
    margin: 0 auto;
    width: 100%;
}

.ad-mobile {
    height: 50px;
    max-width: 320px;
}

.ad-desktop {
    display: none;
    height: 90px;
    max-width: 728px;
}

/* Calculator Card */
.calculator-container {
    background-color: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Presets Toggle */
.presets-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #110e0c;
    padding: 0.25rem;
    border-radius: var(--radius);
}

.preset-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #a09088;
    padding: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: calc(var(--radius) - 2px);
    transition: var(--transition);
}

.preset-btn:hover {
    color: var(--color-text);
}

.preset-btn.active {
    background: var(--color-crema);
    color: var(--color-bg);
}

/* Form Inputs */
.brew-form {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.input-group label {
    font-size: 0.85rem;
    color: #bfaea5;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    background-color: #1a1412;
    border: 1px solid #332822;
    color: var(--color-text);
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-family: monospace;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-crema);
    box-shadow: 0 0 0 2px rgba(200, 169, 126, 0.2);
}

/* Gauge Section */
.gauge-section {
    position: relative;
    text-align: center;
    padding: 1rem 0;
}

.gauge-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.extraction-gauge {
    width: 100%;
    height: auto;
    overflow: visible;
}

.gauge-zone {
    stroke-width: 12;
    transition: stroke-dasharray 0.5s ease;
}

.gauge-zone.under { stroke: var(--color-under); }
.gauge-zone.ideal { stroke: var(--color-ideal); }
.gauge-zone.over { stroke: var(--color-over); }

.needle {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gauge-label {
    fill: #807068;
    font-size: 10px;
    font-weight: 600;
    text-anchor: middle;
}

.gauge-center-text {
    position: absolute;
    bottom: -15px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
}

.yield-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
    line-height: 1.1;
}

.yield-status {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}

/* Footer */
.app-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #665;
}

/* Media Queries */
@media (min-width: 768px) {
    .ad-mobile {
        display: none;
    }
    .ad-desktop {
        display: flex;
    }
    
    .brew-form {
        grid-template-columns: repeat(3, 1fr);
    }
}
