/* Custom Amount Checkout Plugin Styles */

.cac-widget {
    max-width: 400px;
    margin: 20px auto;
    padding: 40px 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
}

/* Full screen mode for mobile on /pay path */
@media (max-width: 767px) {
    body.cac-fullscreen-mode {
        overflow: hidden;
    }
    
    body.cac-fullscreen-mode .cac-widget {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: 100%;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 40px 20px;
        border-radius: 0;
        box-shadow: none;
        z-index: 999999;
        display: flex;
        flex-direction: column;
        justify-content: center;
        transition: none;
        transform: none;
        animation: none;
    }
    
    body.cac-fullscreen-mode .cac-form {
        max-width: 400px;
        margin: 0 auto;
        width: 100%;
    }
}

.cac-widget:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.cac-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: left;
    line-height: 1.3;
}

.cac-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cac-amount-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0 15px;
    transition: all 0.3s ease;
}

.cac-amount-wrapper:focus-within {
    border-color: #007cba;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.cac-currency-symbol {
    font-size: 18px;
    font-weight: 600;
    color: #6c757d;
    margin-right: 8px;
    user-select: none;
}

.cac-amount-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px 0;
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
    outline: none;
    width: 100%;
    margin-bottom: 0px;
	max-width:unset !important;
}

.cac-amount-input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.cac-amount-input::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.cac-amount-input::-webkit-outer-spin-button,
.cac-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cac-amount-input[type=number] {
    -moz-appearance: textfield;
    padding: 16px 10px;
    border-radius: 5px;
    border:2px solid #666 !important;
}

.cac-checkout-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.cac-checkout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.cac-checkout-button:active {
    transform: translateY(0);
}

.cac-checkout-button:disabled {
    background: #1f3b4f;
    transform: none;
    box-shadow: none;
}

.cac-checkout-button.loading {
    pointer-events: none;
}

.cac-checkout-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 #ffffff;
    border-radius: 50%;
    animation: cac-spin 1s linear infinite;
}

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

.cac-message {
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
    transition: all 0.3s ease;
}

.cac-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.cac-message.error {
    background: #f6f5f8;
    color: #721c24;
    display: block;
    text-align: left;
}

.cac-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

.cac-info {
    text-align: center;
    margin-top: 15px;
    color: #6c757d;
    font-size: 13px;
}

/* Modern Style */
.cac-style-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.cac-style-modern .cac-title {
    color: white;
    font-weight: 300;
    font-size: 28px;
}

.cac-style-modern .cac-amount-wrapper {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.cac-style-modern .cac-amount-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.cac-style-modern .cac-currency-symbol,
.cac-style-modern .cac-amount-input {
    color: white;
}

.cac-style-modern .cac-amount-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.cac-style-modern .cac-checkout-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.cac-style-modern .cac-checkout-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.cac-style-modern .cac-info {
    color: rgba(255, 255, 255, 0.8);
}

/* Minimal Style */
.cac-style-minimal {
    background: transparent;
    box-shadow: none;
    border: 1px solid #e9ecef;
    padding: 20px;
}

.cac-style-minimal .cac-title {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 20px;
}

.cac-style-minimal .cac-amount-wrapper {
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.cac-style-minimal .cac-checkout-button {
    background: #007cba;
    border-radius: 4px;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}

.cac-style-minimal .cac-checkout-button:hover {
    background: #005a87;
    transform: none;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 480px) {
    .cac-widget {
        margin: 10px;
        padding: 20px;
        max-width: none;
    }
    
    .cac-title {
        font-size: 20px;
    }
    
    .cac-amount-input {
        font-size: 16px;
        padding: 12px 0;
    }
    
    .cac-checkout-button {
        padding: 14px 24px;
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cac-widget {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .cac-title {
        color: #ecf0f1;
    }
    
    .cac-amount-wrapper {
        background: #34495e;
        border-color: #4a5f7a;
    }
    
    .cac-amount-wrapper:focus-within {
        border-color: #3498db;
        background: #3c5a78;
    }
    
    .cac-currency-symbol,
    .cac-amount-input {
        color: #ecf0f1;
    }
    
    .cac-amount-input::placeholder {
        color: #95a5a6;
    }
    
    .cac-info {
        color: #95a5a6;
    }
}

/* Animation for form appearance */
.cac-widget:not(.cac-no-animation) {
    animation: cac-fadeInUp 0.6s ease-out;
}

.cac-no-animation {
    max-width: 400px;
    margin: 20px auto;
    padding: 40px 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    opacity: 1;
    transform: translateY(0);
}
body .cac-widget.cac-no-animation .cac-title{
    text-align: center;
}

@keyframes cac-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus indicators for accessibility */


/* High contrast mode support */
@media (prefers-contrast: high) {
    .cac-widget {
        border: 2px solid #000000;
    }
    
    .cac-amount-wrapper {
        border: 2px solid #000000;
    }
    
    .cac-checkout-button {
        border: 2px solid #000000;
    }
}

/* Floating styles */
.cac-floating:not(.cac-no-animation) {
    position: fixed;
    z-index: 9999;
    margin: 0;
    animation: cac-slideInUp 0.5s ease-out;
}

.cac-floating.cac-no-animation {
    position: fixed;
    z-index: 9999;
    margin: 0;
}

/* PC floating styles - bottom right */
@media (min-width: 769px) {
    .cac-floating {
        bottom: 20px;
        right: 20px;
        max-width: 400px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        min-width: 350px;
    }
    
    .cac-floating:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    }
}

/* Mobile floating styles - full width bottom */
@media (max-width: 768px) {
    .cac-floating {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        padding: 20px;
    }
    
    .cac-floating .cac-form {
        gap: 15px;
    }
    
    .cac-floating .cac-title {
        font-size: 18px;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .cac-floating .cac-checkout-button {
        padding: 8px 24px;
        font-size: 16px;
        font-weight: 600;
    }
    body .cac-widget.cac-no-animation .cac-title{
        text-align: left;
    }
}

/* Floating animation */
@keyframes cac-slideInUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Special style adjustments for floating state */
.cac-floating .cac-amount-input {
    font-size: 16px;
}

.cac-floating .cac-message {
    font-size: 13px;
}

/* Ensure floating elements are not blocked by other elements */
.cac-floating {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Floating styles in dark mode */
@media (prefers-color-scheme: dark) {
    .cac-floating {
        background: rgba(44, 62, 80, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Floating styles in high contrast mode */
@media (prefers-contrast: high) {
    .cac-floating {
        border: 3px solid #000000;
        background: #ffffff;
    }
}