/* Calculator Container */
.xw-calculator {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
    color: #1a2e26;
    max-width: 800px;
    margin: 0 auto;
}

.xw-calculator-columns {
    align-items: stretch !important;
}

.xw-calculator-columns .wp-block-column {
    display: flex;
    flex-direction: column;
}

#xw-calculator-form, #xw-calculator-results {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.xw-calc-form {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 20px;
}

.xw-calc-btn, .xw-calc-claim-btn {
    margin-top: auto !important;
}

/* Form Layout */

.xw-calc-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.xw-calc-input-group label {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Custom Radio Group */
.xw-calc-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.xw-calc-radio-group input[type="radio"] {
    display: none;
}

.xw-calc-radio-group label {
    padding: 10px 20px;
    border: 2px solid rgba(11, 59, 44, 0.2);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #1a2e26;
    font-weight: 500;
}

.xw-calc-radio-group label:hover {
    background: #f8faf9;
    border-color: rgba(11, 59, 44, 0.4);
}

.xw-calc-radio-group input[type="radio"]:checked + label {
    background: #e5a823;
    color: #0b3b2c;
    border-color: #e5a823;
    font-weight: bold;
}

/* Number Inputs */
.xw-calc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.xw-calc-input {
    width: 100%;
    padding: 15px 30px;
    background: #ffffff;
    border: 1px solid rgba(11, 59, 44, 0.2);
    border-radius: 12px;
    color: #1a2e26;
    font-size: 1.1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    appearance: none;
    -webkit-appearance: none;
}

.xw-calc-input:focus {
    outline: none;
    border-color: #0b3b2c;
    box-shadow: 0 0 0 3px rgba(11, 59, 44, 0.1);
    background: #ffffff;
}

.xw-calc-input.has-prefix { padding-left: 45px; }
.xw-calc-input.has-suffix { padding-right: 80px; }

.xw-calc-prefix, .xw-calc-suffix {
    position: absolute;
    color: #526e63;
    font-weight: 600;
    z-index: 2;
}

.xw-calc-prefix { left: 18px; }
.xw-calc-suffix { right: 18px; }

/* Calculate Button */
.xw-calc-btn {
    background: #ffd700;
    color: #000;
    border: none;
    border-radius: 50px;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

.xw-calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

/* Results Panel */
.xw-calc-results {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    display: none; /* Hidden by default */
    opacity: 0;
    transition: opacity 0.5s ease;
}

.xw-calc-results.show {
    display: block;
    animation: fadeIn 0.5s forwards;
}

.xw-calc-result-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    text-align: center;
}

.xw-calc-result-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.xw-calc-result-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Claim Button */
.xw-calc-claim-btn {
    background: #25d366; /* WhatsApp Green */
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s ease;
    text-decoration: none;
}

.xw-calc-claim-btn:hover {
    background: #128c7e;
    color: #fff;
}

/* Loading Spinner */
.xw-calc-loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.xw-calc-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: #ffd700;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* Responsive */
@media (min-width: 768px) {
    .xw-calc-results {
        display: none;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: center;
    }
    .xw-calc-results.show {
        display: grid;
    }
    .xw-calc-result-item:first-child {
        grid-column: span 2;
    }
}
