/* ═══════════════════════════════════════════
   Tax Calculator – Refined Styles
   ═══════════════════════════════════════════ */

.tax-container {
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
}

/* ── Form Common (overrides from main.css) ── */
.form-input {
    background: rgba(0, 0, 0, 0.2);
    font-family: 'Rajdhani', 'Sarabun', sans-serif;
    font-size: 1.1rem;
    padding: .65rem .85rem;
}

.form-input:focus {
    background: rgba(0, 0, 0, 0.4);
}

/* ── Cards ── */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rate-m-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.rate-m-box .form-label {
    margin: 0;
}

.rate-m-box .form-input {
    width: 80px;
    padding: 0.4rem;
    font-size: 1.1rem;
    text-align: center;
}

/* ── Tax Grid ── */
.tax-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .75rem;
}

.tax-btn {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem .5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    cursor: pointer;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tax-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    opacity: 0;
    transition: opacity .3s;
    z-index: 0;
}

.tax-btn>* {
    position: relative;
    z-index: 1;
}

.tax-btn input[type="radio"] {
    display: none;
}

.tax-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.tax-btn.active {
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(200, 168, 75, 0.2);
}

.tax-btn.active::before {
    opacity: 0.05;
}

.tax-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.tax-name {
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
}

.tax-val {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.tax-btn.active .tax-name {
    color: var(--accent);
}

/* ── Items Table ── */
.items-header {
    display: none;
    padding: 0.5rem 0.5rem 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .items-header {
        display: flex;
    }
}

.col-name {
    flex: 4;
}

.col-qty {
    flex: 1;
    text-align: center;
}

.col-price {
    flex: 2;
    text-align: right;
    margin-right: 2.2rem;
}

.col-action {
    width: 30px;
}

#items-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.item-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.item-row:hover {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
    .item-row {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        background: transparent;
        padding: 0.5rem 0;
        border: none;
        border-radius: 0;
    }

    .item-row:hover {
        background: transparent;
        border-color: transparent;
    }

    .item-row:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

.item-col-name {
    flex: 4;
    min-width: 150px;
}

.item-col-qty {
    flex: 1;
    min-width: 70px;
}

.item-col-price {
    flex: 2;
    min-width: 130px;
}

.item-col-action {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
}

/* Desktop Input Overrides */
@media (min-width: 768px) {
    .item-col-qty .form-input {
        text-align: center;
    }

    .item-col-price .form-input {
        text-align: right;
        font-size: 1.15rem;
    }
}

/* ── Buttons ── */
/* Smaller Delete Button */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0 0 2px 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: rgba(239, 71, 111, .1);
    color: var(--accent2);
    border: 1px solid rgba(239, 71, 111, .3);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all .2s;
    outline: none;
    line-height: 1;
}

.btn-icon:hover:not(:disabled) {
    background: var(--accent2);
    color: #fff;
}

.btn-icon:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    filter: grayscale(1);
}

.item-actions-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1.25rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Uses global .btn-outline style from main.css */

/* ── Top Results ── */
.glass-panel {
    background: linear-gradient(180deg, rgba(30, 30, 35, 0.95) 0%, rgba(20, 20, 25, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.gradient-text {
    background: -webkit-linear-gradient(0deg, var(--accent), #f9d423);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.res-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 600px) {
    .res-summary {
        flex-direction: row;
    }

    .res-summary>.res-box {
        flex: 1;
    }
}

.res-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.res-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    font-size: 1.5rem;
}

.res-info {
    flex: 1;
}

.res-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.res-val-group {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.res-val {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.res-currency {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
}

.error-box .res-icon {
    background: rgba(239, 71, 111, .1);
    border-color: rgba(239, 71, 111, .2);
}

.error-box .res-val {
    color: var(--accent2);
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

.highlight-box {
    background: rgba(6, 214, 160, .05);
    border: 1px solid rgba(6, 214, 160, .2);
    padding: 1.25rem;
    border-radius: var(--radius);
}

.highlight-box .res-label {
    color: #06D6A0;
}

.big-text {
    font-size: 2.5rem;
    text-shadow: 0 0 15px rgba(6, 214, 160, 0.3);
}

.baht-box {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(200, 168, 75, .05);
    border-radius: var(--radius);
}

.baht-box .res-val {
    font-size: 2rem;
}