/**
 * Sales Tax Calculator - Specific Styles
 */

.sales-tax-calculator .calculator-mode-toggle {
    display: flex;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.sales-tax-calculator .toggle-option {
    flex: 1;
    text-align: center;
    padding: 12px 15px;
    cursor: pointer;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.sales-tax-calculator .toggle-option.active {
    background-color: var(--primary-color);
    color: white;
}

.sales-tax-calculator .toggle-option:hover:not(.active) {
    background-color: #e0e0e0;
}

/* Toggle Switch */
.sales-tax-calculator .toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    margin-top: 5px;
}

.sales-tax-calculator .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sales-tax-calculator .toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.sales-tax-calculator .toggle-switch label:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.sales-tax-calculator .toggle-switch input:checked + label {
    background-color: var(--primary-color);
}

.sales-tax-calculator .toggle-switch input:checked + label:before {
    transform: translateX(26px);
}

/* Items Section */
.sales-tax-calculator #items-container {
    margin-top: 15px;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #f5f9ff;
}

.sales-tax-calculator .items-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 30px;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-dark);
}

.sales-tax-calculator #items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.sales-tax-calculator .item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 30px;
    gap: 10px;
    align-items: center;
}

.sales-tax-calculator .item-row input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.sales-tax-calculator .tax-exempt-toggle {
    display: flex;
    justify-content: center;
}

.sales-tax-calculator .tax-exempt-toggle input {
    width: auto;
}

.sales-tax-calculator .remove-item {
    width: 30px;
    height: 30px;
    padding: 0;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.sales-tax-calculator #add-item {
    width: 100%;
    padding: 10px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.sales-tax-calculator #add-item:hover {
    background-color: #36b08e;
}

/* Results Styling */
.sales-tax-calculator .highlight-result {
    background-color: #f5f9ff;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.sales-tax-calculator .highlight-result .result-value {
    font-size: 28px;
}

.sales-tax-calculator .items-breakdown {
    margin-top: 20px;
    background-color: #f5f9ff;
    border-radius: 6px;
    padding: 15px;
}

.sales-tax-calculator .breakdown-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.sales-tax-calculator .items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sales-tax-calculator .items-table th,
.sales-tax-calculator .items-table td {
    padding: 10px;
    border: 1px solid var(--border-color);
    text-align: right;
}

.sales-tax-calculator .items-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    text-align: center;
}

.sales-tax-calculator .items-table tr:hover {
    background-color: #f9f9f9;
}

.sales-tax-calculator .items-table .tax-exempt-item {
    background-color: #f5f5f5;
}

.sales-tax-calculator .items-table .items-total {
    font-weight: 600;
    background-color: #f5f9ff;
}

/* Tax Visualization */
.sales-tax-calculator .tax-visualization {
    margin-top: 20px;
    background-color: #f5f9ff;
    border-radius: 6px;
    padding: 15px;
}

.sales-tax-calculator .tax-breakdown-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.sales-tax-calculator .tax-bar {
    height: 24px;
    background-color: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    margin-bottom: 10px;
}

.sales-tax-calculator .pre-tax-segment {
    height: 100%;
    background-color: var(--primary-color);
    width: 100%;
    transition: width 0.8s ease;
}

.sales-tax-calculator .tax-segment {
    height: 100%;
    background-color: var(--secondary-color);
    width: 0%;
    transition: width 0.8s ease;
}

.sales-tax-calculator .tax-breakdown-legend {
    display: flex;
    justify-content: space-around;
}

.sales-tax-calculator .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sales-tax-calculator .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.sales-tax-calculator .pre-tax-color {
    background-color: var(--primary-color);
}

.sales-tax-calculator .tax-color {
    background-color: var(--secondary-color);
}

/* Responsive styles */
@media (max-width: 768px) {
    .sales-tax-calculator .items-header,
    .sales-tax-calculator .item-row {
        grid-template-columns: 2fr 1fr 1fr 40px;
    }
    
    .sales-tax-calculator .items-header div:nth-child(4),
    .sales-tax-calculator .item-row .tax-exempt-toggle {
        display: none;
    }
    
    .sales-tax-calculator .tax-breakdown-legend {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .sales-tax-calculator .toggle-option {
        padding: 10px;
        font-size: 12px;
    }
    
    .sales-tax-calculator .items-header,
    .sales-tax-calculator .item-row {
        grid-template-columns: 2fr 1fr 40px;
        font-size: 12px;
    }
    
    .sales-tax-calculator .items-header div:nth-child(3),
    .sales-tax-calculator .item-row input:nth-child(3) {
        display: none;
    }
    
    .sales-tax-calculator .item-row input {
        padding: 6px;
        font-size: 12px;
    }
}