/* MyCRED Buy Wrapper Styles */
.mycred-buy-wrapper {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mycred-buy-wrapper h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5em;
    text-align: center;
    font-weight: 600;
}

.mycred-amount-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.mycred-amount-option {
    position: relative;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.mycred-amount-option:hover {
    border-color: #007cba;
    background: #f0f8ff;
    transform: translateY(-2px);
}

.mycred-amount-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.mycred-amount-option label {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    margin: 0;
}

.mycred-amount-option input[type="radio"]:checked + label {
    color: #007cba;
}

.mycred-amount-option input[type="radio"]:checked ~ .mycred-amount-option {
    border-color: #007cba;
    background: #e6f3ff;
}

.mycred-amount-option:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background: #e6f3ff;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Custom amount styling */
.mycred-amount-option.custom-amount {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin-top: 10px;
}

.mycred-amount-option.custom-amount label {
    margin-right: 15px;
    white-space: nowrap;
}

.mycred-custom-amount {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 1em;
    background: #fff;
    transition: border-color 0.3s ease;
    display: none;
}

.mycred-custom-amount:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Buy button styling */
.mycred-buy-button-container {
    text-align: center;
}

.mycred-buy-button {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mycred-buy-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.mycred-buy-button:disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mycred-buy-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .mycred-amount-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .mycred-buy-wrapper {
        margin: 10px;
        padding: 15px;
    }
    
    .mycred-amount-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .mycred-amount-option {
        padding: 12px 8px;
    }
    
    .mycred-amount-option.custom-amount {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .mycred-amount-option.custom-amount label {
        margin-right: 0;
        text-align: center;
    }
    
    .mycred-buy-button {
        width: 100%;
        min-width: auto;
    }
}

/* Loading state */
.mycred-buy-button.loading {
    position: relative;
    color: transparent;
}

.mycred-buy-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error message styling */
.mycred-error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    text-align: center;
}

/* Success message styling */
.mycred-success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    text-align: center;
} 

.mycred-buy-wrapper, .mycred-buy-wrapper h3, body.text-ui-light .mycred-buy-wrapper h3, body.text-ui-light .mycred-buy-wrapper input[type="number"]{
    color: #000;
}

.mycred-buy-wrapper.dark{
    background: #000;
}
.mycred-buy-wrapper.dark, .mycred-buy-wrapper.dark h3, body.text-ui-light .mycred-buy-wrapper.dark h3, body.text-ui-light .mycred-buy-wrapper.dark input[type="number"]{
    color: #fff;
}

.mycred-buy-wrapper.dark .mycred-amount-option{
    background: #333;
    color:#FFF
}

.mycred-buy-wrapper.dark .mycred-amount-option:has(input[type="radio"]:checked){
    background: #000;
}

.mycred-buy-wrapper.dark .mycred-amount-option label{
    color: #fff;
}

.mycred-buy-wrapper.dark input[type="number"], body.text-ui-light .mycred-buy-wrapper.dark input[type="number"]{
    background-color: rgb(90 90 90 / 20%);
}

/* Form styling */
.mycred-buy-form {
    margin: 0;
    padding: 0;
}

.mycred-buy-form input[type="hidden"] {
    display: none;
}

/* Ensure form elements don't interfere with existing styles */
.mycred-buy-form .mycred-amount-options {
    margin-bottom: 25px;
}

.mycred-buy-form .mycred-buy-button-container {
    margin-top: 20px;
}

/* Form validation styling */
.mycred-buy-form.error .mycred-amount-option {
    border-color: #dc3545;
}

.mycred-buy-form.error .mycred-amount-option input[type="radio"]:checked + label {
    color: #dc3545;
}

/* Ensure the form submits properly */
.mycred-buy-form button[type="submit"] {
    cursor: pointer;
}

.mycred-buy-form button[type="submit"]:disabled {
    cursor: not-allowed;
}