/* ─── Variables (ACTotal Theme — Orange Accent) ─── */
:root {
    --bg: #050506;
    --surface: #111827;
    --surface-light: #1f2937;
    --surface-hover: #374151;
    --accent: #F97316;
    --accent-light: #fb923c;
    --accent-glow: rgba(249, 115, 22, 0.3);
    --text: #ffffff;
    --text-dim: #9ca3af;
    --radius: 20px;
    --radius-sm: 12px;
    --success: #10b981;
}

/* ─── Base Reset ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* ─── Layout ─── */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ─── Header ─── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.2rem;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #ea580c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, .08);
    background: var(--surface);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all .2s;
    font-size: 1.2rem;
}

.btn-icon:hover {
    background: var(--surface-light);
    color: var(--text);
}

.btn-icon-subtle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    opacity: 0.7;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
}

.btn-icon-subtle:hover {
    opacity: 1;
    color: var(--text);
    background: var(--surface-light);
}

/* ─── Main ─── */
.asado-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Card ─── */
.card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-emoji {
    font-size: 1.3rem;
}

.card-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ─── People Grid ─── */
.people-grid {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.people-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.people-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.people-emoji {
    font-size: 1.4rem;
}

.people-label {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
}

.people-detail {
    display: block;
    font-size: 0.72rem;
    color: var(--text-dim);
    font-weight: 500;
}

/* ─── Counter Control ─── */
.counter-control {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--surface-light);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-counter {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--accent-light);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    font-family: inherit;
}

.btn-counter:hover {
    background: rgba(249, 115, 22, 0.12);
}

.btn-counter:active {
    background: rgba(249, 115, 22, 0.25);
}

.counter-control input {
    width: 36px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    outline: none;
    -moz-appearance: textfield;
}

.counter-control input::-webkit-inner-spin-button,
.counter-control input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ─── Preferences ─── */
.prefs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.pref-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.7rem;
    background: var(--bg);
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    font-weight: 600;
}

.pref-chip:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.pref-chip input {
    display: none;
}

.pref-chip:has(input:checked) {
    border-color: var(--accent);
    background: rgba(249, 115, 22, 0.08);
    color: var(--accent-light);
}

/* ─── Results Card ─── */
.card-results {
    background: linear-gradient(to bottom, var(--surface), #0a0e17);
    border-color: rgba(249, 115, 22, 0.15);
    animation: fadeIn 0.35s ease-out;
}

.hidden {
    display: none !important;
}

/* Summary Bar */
.summary-bar {
    display: flex;
    gap: 0.7rem;
}

.summary-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.summary-item.accent {
    border-color: rgba(249, 115, 22, 0.2);
    background: rgba(249, 115, 22, 0.06);
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
}

.summary-item.accent .summary-value {
    color: var(--accent-light);
}

.summary-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Results List */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-group {
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.result-group-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.8rem;
    font-size: 0.88rem;
    transition: opacity 0.2s;
}

.result-item+.result-item {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.result-item.dismissed {
    opacity: 0.35;
}

.result-item.dismissed .result-item-name {
    text-decoration: line-through;
}

.result-item-name {
    color: var(--text-dim);
    font-weight: 500;
    flex-shrink: 1;
    min-width: 0;
}

.result-item-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.result-item-value {
    font-weight: 700;
    color: var(--text);
    font-size: 0.82rem;
    white-space: nowrap;
}

.btn-dismiss {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.result-item.dismissed .btn-dismiss {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.result-item.dismissed .btn-dismiss:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* Actions */
.result-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.btn-action.copied {
    color: var(--success);
    border-color: var(--success);
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 2rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
}

/* ─── Footer ─── */
.app-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: auto;
    padding-top: 2rem;
    line-height: 1.5;
}

.app-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* ─── Manual Mode Toggle ─── */
.manual-toggle-bar {
    display: flex;
    justify-content: center;
    padding: 0.3rem 0;
}

.manual-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}

.manual-toggle input {
    display: none;
}

.toggle-switch {
    width: 40px;
    height: 22px;
    background: var(--surface-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    position: relative;
    transition: all 0.3s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--text-dim);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
}

.manual-toggle input:checked+.toggle-switch {
    background: var(--accent);
    border-color: var(--accent);
}

.manual-toggle input:checked+.toggle-switch::after {
    transform: translateX(18px);
    background: #fff;
}

.manual-toggle input:disabled+.toggle-switch {
    opacity: 0.5;
    cursor: not-allowed;
}

.manual-toggle input:disabled~.toggle-label {
    opacity: 0.5;
}

.toggle-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dim);
    transition: color 0.2s;
}

.manual-toggle input:checked~.toggle-label {
    color: var(--accent-light);
}

/* ─── Manual Mode Controls ─── */
.manual-controls {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--surface-light);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.btn-manual {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--accent-light);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    font-family: inherit;
    padding: 0;
}

.btn-manual:hover {
    background: rgba(249, 115, 22, 0.15);
}

.btn-manual:active {
    background: rgba(249, 115, 22, 0.3);
}

/* ─── Editable Value Input ─── */
.result-item-input {
    width: 52px;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.2rem 0.1rem;
    outline: none;
    -moz-appearance: textfield;
    transition: border-color 0.2s;
}

.result-item-input:focus {
    border-color: var(--accent);
    background: rgba(249, 115, 22, 0.06);
}

.result-item-input::-webkit-inner-spin-button,
.result-item-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.result-item-unit {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-weight: 500;
    white-space: nowrap;
}

/* ─── Disabled Section (people counters) ─── */
.disabled-section {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.3);
    transition: opacity 0.3s, filter 0.3s;
}

/* ─── Notes Section ─── */
.notes-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.notes-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notes-input {
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    padding: 0.7rem 0.8rem;
    resize: vertical;
    outline: none;
    min-height: 60px;
    transition: border-color 0.2s;
}

.notes-input::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
}

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

/* ─── Confirm Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 6, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-content {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: popUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popUp {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.confirm-message {
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.confirm-actions {
    display: flex;
    gap: 0.6rem;
}

.btn-confirm-cancel,
.btn-confirm-ok {
    flex: 1;
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm-cancel {
    background: var(--surface-light);
    color: var(--text-dim);
}

.btn-confirm-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.btn-confirm-ok {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-confirm-ok:hover {
    opacity: 0.9;
}