/**
 * Vista Wallet Checkout Styles
 * Optimized for performance and WordPress standards
 *
 * @package Vista_Wallet_Plugin
 * @version 2.0.0
 */

/* Base Card */
.vista-wallet-checkout-card {
    max-width: 500px;
    margin: 40px auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,.06);
    padding: 38px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: transform .3s ease, box-shadow .3s ease;
    position: relative;
}

.vista-wallet-checkout-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,.08);
}

/* Heading */
.vista-wallet-checkout-card h2 {
    color: #1a1a2e;
    font-size: 2.3em;
    margin-bottom: 28px;
    font-weight: 800;
    letter-spacing: -.5px;
    position: relative;
    display: inline-block;
}

.vista-wallet-checkout-card h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    transition: width .3s ease;
}

.vista-wallet-checkout-card:hover h2::after {
    width: 100px;
}

/* Form Fields */
.vista-wallet-field {
    margin-bottom: 28px;
    text-align: left;
    position: relative;
}

.vista-wallet-field label {
    display: block;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 10px;
    font-size: .9em;
    letter-spacing: .3px;
    text-transform: uppercase;
    transition: color .2s ease;
    position: relative;
    padding-left: 2px;
}

.vista-wallet-field label::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: #6366f1;
    transition: height .2s ease;
    border-radius: 2px;
}

.vista-wallet-field:focus-within label {
    color: #6366f1;
}

.vista-wallet-field:focus-within label::before {
    height: 70%;
}

/* Inputs and Selects */
.vista-wallet-field input,
.vista-wallet-field select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 1.05em;
    box-sizing: border-box;
    transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
    background-color: #f9fafb;
    color: #1f2937;
    box-shadow: 0 2px 4px rgba(0,0,0,.03) inset;
}

.vista-wallet-field input::placeholder {
    color: #94a3b8;
    transition: opacity .2s ease;
}

.vista-wallet-field input:focus::placeholder {
    opacity: .6;
}

.vista-wallet-field input:focus,
.vista-wallet-field select:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 4px rgba(99,102,241,.15);
    background-color: #fff;
    transform: translateY(-2px);
}

/* Address Container */
.vista-wallet-address-container {
    background: linear-gradient(135deg, #f3f4f6, #f8fafc);
    padding: 22px;
    border-radius: 16px;
    margin: 30px 0;
    border: 2px solid #e5e7eb;
    position: relative;
    transition: all .3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.02);
}

.vista-wallet-address-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    opacity: 0;
    transition: opacity .3s ease;
}

.vista-wallet-address-container:hover::before {
    opacity: 1;
}

.vista-wallet-address-input {
    display: flex;
    gap: 14px;
    align-items: center;
}

.vista-wallet-address-input input {
    flex-grow: 1;
    border: 2px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* QR Code */
.vista-wallet-qr {
    position: relative;
    margin: 30px auto;
}

.vista-wallet-qr img {
    max-width: 185px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
    padding: 12px;
    background: #fff;
    transition: transform .3s ease, box-shadow .3s ease;
    border: 2px solid #f3f4f6;
}

.vista-wallet-qr img:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,.12);
    border-color: #e5e7eb;
}

/* Timer */
.vista-wallet-timer {
    font-size: 1.3em;
    color: #333347;
    font-weight: 700;
    margin: 25px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: color .3s ease;
}

.vista-wallet-timer::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #10b981;
    animation: vw-pulse 2s infinite;
}

.vista-wallet-timer.warning {
    color: #ef4444;
    animation: vw-shake .5s ease-in-out;
}

.vista-wallet-timer.warning::before {
    background: #ef4444;
}

/* Animations */
@keyframes vw-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16,185,129,.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16,185,129,0);
    }
}

@keyframes vw-shake {
    0%, 100% { transform: translateX(0); }
    25%, 75% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
}

@keyframes vw-slide-in {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes vw-pulse-subtle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Buttons */
.vista-wallet-button {
    padding: 14px 26px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    transition: all .3s ease;
    box-shadow: 0 6px 15px rgba(99,102,241,.2);
}

.vista-wallet-button:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(99,102,241,.25);
}

.vista-wallet-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(99,102,241,.2);
}

/* Submit Button */
.vista-wallet-submit {
    width: 100%;
    padding: 18px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1.15em;
    font-weight: 700;
    cursor: pointer;
    transition: all .3s ease;
    margin-top: 15px;
    letter-spacing: .6px;
}

.vista-wallet-submit:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239,68,68,.3);
}

.vista-wallet-submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(239,68,68,.2);
}

/* Messages */
.vista-wallet-message {
    padding: 20px;
    margin: 28px 0;
    border-radius: 14px;
    text-align: center;
    font-weight: 500;
    border-left: 4px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    animation: vw-slide-in .5s forwards;
}

.vista-wallet-message::before {
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.vista-wallet-message.error {
    background: #fef2f2;
    color: #b91c1c;
    border-left-color: #ef4444;
    box-shadow: 0 5px 15px rgba(239,68,68,.1);
}

.vista-wallet-message.error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ef4444'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1-7v2h2v-2h-2zm0-8v6h2V7h-2z'/%3E%3C/svg%3E");
    animation: vw-pulse-subtle 2s infinite;
}

.vista-wallet-message.success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #22c55e;
    box-shadow: 0 5px 15px rgba(34,197,94,.1);
}

.vista-wallet-message.success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322c55e'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.997-6l7.07-7.071-1.414-1.414-5.656 5.657-2.829-2.829-1.414 1.414L11.003 16z'/%3E%3C/svg%3E");
    animation: vw-pulse-subtle 2s infinite;
}

/* Loading State */
.vista-wallet-qr.loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    border-radius: 10px;
    animation: vw-pulse-subtle 1.5s infinite;
}

/* Responsive Design */
@media (max-width: 480px) {
    .vista-wallet-checkout-card {
        margin: 15px;
        padding: 25px 20px;
        border-radius: 16px;
    }

    .vista-wallet-checkout-card h2 {
        font-size: 1.8em;
    }

    .vista-wallet-address-input {
        flex-direction: column;
    }

    .vista-wallet-field {
        margin-bottom: 18px;
    }

    .vista-wallet-qr img {
        max-width: 150px;
    }

    .vista-wallet-submit {
        padding: 14px;
    }

    .vista-wallet-message {
        padding: 16px;
    }
}
