/* ===== Promillerechner — Modern App-like Design ===== */

.calc {
    max-width: 720px;
    margin: 0 auto;
}

/* Cards — frosted glass effect */
.calc-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.calc-card__header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.calc-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.calc-card__body {
    padding: 20px 24px 24px;
}

/* Gender Selection — pill-style toggles */
.calc-gender {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 4px;
}

.calc-gender__legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.calc-gender__option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-user-select: none;
    user-select: none;
}

.calc-gender__option:hover {
    color: rgba(255, 255, 255, 0.7);
}

.calc-gender__option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.calc-gender__option.active {
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: #fff;
    box-shadow: 0 4px 16px rgba(26, 188, 156, 0.3);
    font-weight: 600;
}

.calc-gender__option input:focus-visible ~ span {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
}

.calc-gender__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}

.calc-gender__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Weight Input — clean, minimal */
.calc-weight {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-weight label {
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.calc-weight input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    padding: 14px 18px;
    font-size: 1.05rem;
    min-height: 52px;
    width: 100%;
    font-family: inherit;
    transition: all 0.2s ease;
}

.calc-weight input:focus {
    outline: none;
    border-color: rgba(26, 188, 156, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(26, 188, 156, 0.1);
}

/* Hint text */
.calc-hint {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
}

/* Category Tabs — segmented control */
.calc-categories {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.calc-categories::-webkit-scrollbar {
    display: none;
}

.calc-category-tab {
    flex-shrink: 0;
    padding: 9px 16px;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    scroll-snap-align: start;
    white-space: nowrap;
    min-height: 36px;
    font-family: inherit;
}

.calc-category-tab:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.04);
}

.calc-category-tab.active {
    background: rgba(26, 188, 156, 0.15);
    color: #1abc9c;
    font-weight: 600;
}

.calc-category-tab:focus-visible {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
}

/* Drink Chips Grid — compact, touch-friendly cards */
.calc-drinks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
    min-height: 60px;
}

.calc-drink-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 52px;
    text-align: center;
    line-height: 1.3;
    font-family: inherit;
}

.calc-drink-chip:hover {
    background: rgba(26, 188, 156, 0.08);
    border-color: rgba(26, 188, 156, 0.2);
    transform: translateY(-1px);
}

.calc-drink-chip:active {
    background: rgba(26, 188, 156, 0.2);
    transform: scale(0.97);
}

.calc-drink-chip:focus-visible {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
}

.calc-drink-chip__detail {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 3px;
    font-weight: 400;
}

/* Consumed Drinks List */
.calc-consumed-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 12px 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.calc-consumed {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 48px;
}

.calc-consumed__empty {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
    padding: 16px 0;
    text-align: center;
}

.calc-consumed__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    margin-bottom: 6px;
    transition: background 0.15s ease;
}

.calc-consumed__item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.calc-consumed__name {
    flex: 1;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calc-consumed__controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.calc-consumed__qty {
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    min-width: 30px;
    text-align: center;
}

.calc-consumed__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    padding: 0;
}

.calc-consumed__btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.calc-consumed__btn:active {
    transform: scale(0.92);
}

.calc-consumed__btn--remove {
    background: transparent;
    color: rgba(231, 76, 60, 0.6);
}

.calc-consumed__btn--remove:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Quick Time Select */
.calc-time-quick__label {
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    margin-bottom: 12px;
}

.calc-time-quick__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.calc-time-chip {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    min-height: 44px;
    white-space: nowrap;
}

.calc-time-chip:hover {
    background: rgba(26, 188, 156, 0.08);
    border-color: rgba(26, 188, 156, 0.2);
    color: #fff;
}

.calc-time-chip:active {
    transform: scale(0.96);
}

.calc-time-chip.active {
    background: rgba(26, 188, 156, 0.15);
    border-color: rgba(26, 188, 156, 0.3);
    color: #1abc9c;
    font-weight: 600;
}

.calc-time-chip:focus-visible {
    outline: 2px solid rgba(26, 188, 156, 0.7);
    outline-offset: 2px;
}

/* Custom Time Toggle */
.calc-time-custom {
    margin-top: 4px;
}

.calc-time-custom__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.15s ease;
}

.calc-time-custom__toggle:hover {
    color: rgba(255, 255, 255, 0.6);
}

.calc-time-custom__toggle svg {
    transition: transform 0.2s ease;
}

.calc-time-custom__toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.calc-time-custom__fields {
    margin-top: 12px;
}

/* Time Inputs */
.calc-time {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.calc-time__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-time__field label {
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.calc-time__field input[type="time"] {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    padding: 14px 18px;
    font-size: 1.05rem;
    min-height: 52px;
    width: 100%;
    font-family: inherit;
    color-scheme: dark;
    transition: all 0.2s ease;
}

.calc-time__field input[type="time"]:focus {
    outline: none;
    border-color: rgba(26, 188, 156, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(26, 188, 156, 0.1);
}

.calc-time__hint {
    grid-column: 1 / -1;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Result Area — hero card */
.calc-result {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 28px;
    min-height: 120px;
    margin-top: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.calc-result__placeholder {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.9rem;
    text-align: center;
    padding: 28px 16px;
}

.calc-result__bac {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -0.03em;
}

.calc-result__bac-unit {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 6px;
    letter-spacing: 0;
}

.calc-result__status {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.calc-result__timeline {
    padding: 0;
    margin: 16px 0 0 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-result__timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.65);
}

.calc-result__timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

.calc-result__timeline-time {
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.calc-result__calories {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.35);
}

.calc-result__calories strong {
    color: rgba(255, 255, 255, 0.75);
}

/* Traffic Light Colors — with glow effects */
.calc-result--green {
    border-left-color: #27ae60;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 0 60px rgba(39, 174, 96, 0.03);
}
.calc-result--green .calc-result__bac {
    color: #2ecc71;
}
.calc-result--green .calc-result__status {
    color: #2ecc71;
}

.calc-result--yellow {
    border-left-color: #f1c40f;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 0 60px rgba(241, 196, 15, 0.03);
}
.calc-result--yellow .calc-result__bac {
    color: #f1c40f;
}
.calc-result--yellow .calc-result__status {
    color: #f1c40f;
}

.calc-result--orange {
    border-left-color: #e67e22;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 0 60px rgba(230, 126, 34, 0.04);
}
.calc-result--orange .calc-result__bac {
    color: #e67e22;
}
.calc-result--orange .calc-result__status {
    color: #e67e22;
}

.calc-result--red {
    border-left-color: #e74c3c;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 0 60px rgba(231, 76, 60, 0.05);
}
.calc-result--red .calc-result__bac {
    color: #e74c3c;
}
.calc-result--red .calc-result__status {
    color: #e74c3c;
}

/* BAC Curve SVG */
.calc-curve {
    margin-top: 24px;
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 14px;
}

.calc-curve svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive */
@media (max-width: 480px) {
    .calc-card__body {
        padding: 16px 18px 20px;
    }

    .calc-drinks {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .calc-time {
        grid-template-columns: 1fr;
    }

    .calc-result {
        padding: 22px 20px;
    }

    .calc-result__bac {
        font-size: 2.8rem;
    }

    .calc-gender {
        flex-direction: column;
        gap: 0;
    }

    .calc-gender__option {
        min-height: 48px;
    }
}

/* Focus visible for accessibility */
.calc button:focus-visible,
.calc input:focus-visible {
    outline: 2px solid rgba(26, 188, 156, 0.7);
    outline-offset: 2px;
}

/* Screen reader only */
.calc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
