/**
 * Beautiful Calculator Styles
 * Version: 1.0.2
 */

/* Container styles */
.beautiful-calculator {
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.beautiful-calculator h2 {
    color: #510C76;
    margin-bottom: 20px;
    font-weight: 600;
}

.instructions {
    margin-bottom: 20px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

/* Wall styles */
.wall {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.wall-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wall-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-group {
    flex: 1;
}

/* Input styles */
.calculator-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 5px;
}

/* Button styles */
.beautiful-calculator-button {
    background: #510C76;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.beautiful-calculator-button:hover {
    background: #3A0954;
}

.add-row-button,
.calculate-btn,
.transfer-btn {
    background: #510C76;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.add-row-button:hover,
.calculate-btn:hover,
.transfer-btn:hover {
    background: #3A0954;
}

.reset-button {
    background: #E4E5E6;
    color: #510C76;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.reset-button:hover {
    background: #D5D6D7;
}

.remove-row-button {
    background: #ea384d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
}

.remove-row-button:hover {
    background: #d62d3f;
}

/* Result section */
.result {
    margin-top: 20px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 4px;
    display: none;
}

.popup-total {
    text-align: right;
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Error and loading states */
.beautiful-calculator-error {
    color: #721c24;
    background: #f8d7da;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.beautiful-calculator-loading {
    text-align: center;
    padding: 20px;
}

@keyframes beautiful-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.beautiful-calculator-loading:before {
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #510C76;
    border-radius: 50%;
    animation: beautiful-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

/* Popup styles */
.beautiful-calculator-popup {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.beautiful-calculator-popup-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.beautiful-calculator-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* WooCommerce integration styles */
.woocommerce .beautiful-calculator-button {
    margin-bottom: 20px;
}

.woocommerce .quantity .qty[data-calculator-updated="true"] {
    background-color: #f7f7f7;
    transition: background-color 0.3s ease;
}

/* Responsive styles */
@media (max-width: 768px) {
    .beautiful-calculator-popup-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .beautiful-calculator-button {
        width: 100%;
    }
}
