/**
 * NestPay Payment Styles
 */

/* Base Styles */
.nestpay-payment-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.nestpay-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.nestpay-input:focus {
    outline: none;
    border-color: #667eea;
}

.nestpay-input::placeholder {
    color: #999;
}

.nestpay-loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

.nestpay-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: nestpay-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 10px;
}

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

.nestpay-error {
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
}

.nestpay-error-box {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.nestpay-success-box {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
}

.nestpay-btn-primary {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: opacity 0.2s;
}

.nestpay-btn-primary:hover {
    opacity: 0.9;
}

.nestpay-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
.nestpay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nestpay-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.nestpay-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nestpay-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    flex-shrink: 0;
}

.nestpay-modal-header h4 {
    margin: 0;
    font-size: 18px;
}

.nestpay-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.nestpay-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Deposit Modal */
.deposit-modal-content {
    max-width: 400px;
}

.deposit-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.deposit-amount-section {
    margin-bottom: 20px;
}

.deposit-amount-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

.deposit-amount-options {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.amount-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-btn:hover,
.amount-btn.active {
    border-color: #11998e;
    background: #e6f9f6;
    color: #11998e;
}

.deposit-card-section {
    margin-bottom: 20px;
}

.card-field {
    margin-bottom: 12px;
}

.card-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.card-field .nestpay-input {
    width: 100%;
    box-sizing: border-box;
}

.card-row {
    display: flex;
    gap: 12px;
}

.card-row .card-field {
    flex: 1;
}

.card-number-wrap {
    position: relative;
}

.card-brand {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: #6b7280;
}

.card-brand.visa { background: #1a1f71; color: white; }
.card-brand.mastercard { background: #ff5f00; color: white; }
.card-brand.amex { background: #006fcf; color: white; }
.card-brand.troy { background: #00a859; color: white; }

.deposit-3d-option {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.nestpay-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.nestpay-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
}

.nestpay-checkbox-label span {
    font-weight: 500;
}

.nestpay-checkbox-label small {
    display: block;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

.deposit-notes {
    margin-top: 15px;
    text-align: center;
}

.deposit-try-note {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.deposit-try-note span {
    font-weight: 600;
    color: #374151;
}

.deposit-secure-note {
    color: #9ca3af;
    font-size: 12px;
}

.deposit-confirm-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.deposit-confirm-btn:hover {
    opacity: 0.9;
}

/* 3D Modal */
.nestpay-3d-modal-content {
    max-width: 480px;
}

.nestpay-3d-modal-body {
    position: relative;
    min-height: 450px;
}

#nestpay-3d-frame {
    width: 100%;
    height: 450px;
    border: none;
    display: block;
}

.nestpay-3d-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.nestpay-3d-loading p {
    margin-top: 15px;
    color: #6b7280;
    font-size: 14px;
}

/* Toast Notifications */
.nestpay-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.nestpay-toast {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 15px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: nestpayToastSlideIn 0.3s ease;
    border-left: 4px solid #667eea;
}

.nestpay-toast.toast-success {
    border-left-color: #28a745;
}

.nestpay-toast.toast-error {
    border-left-color: #dc3545;
}

.nestpay-toast.toast-warning {
    border-left-color: #ffc107;
}

.nestpay-toast.toast-info {
    border-left-color: #17a2b8;
}

.nestpay-toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.nestpay-toast-content {
    flex: 1;
}

.nestpay-toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.nestpay-toast-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.nestpay-toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.nestpay-toast-close:hover {
    color: #333;
}

.nestpay-toast.toast-exit {
    animation: nestpayToastSlideOut 0.3s ease forwards;
}

@keyframes nestpayToastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes nestpayToastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .nestpay-modal-content {
        margin: 15px;
        max-width: calc(100% - 30px);
        border-radius: 12px;
    }

    .nestpay-modal-body {
        padding: 20px;
    }

    .deposit-modal-content {
        max-width: calc(100% - 30px);
    }

    .deposit-amount-options {
        flex-wrap: wrap;
    }

    .amount-btn {
        flex: 1;
        min-width: 60px;
    }

    .card-row {
        flex-direction: column;
        gap: 15px;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .nestpay-modal-content {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .nestpay-modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .nestpay-modal-header h4 {
        font-size: 17px;
    }

    .nestpay-modal-close {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .nestpay-modal-body {
        padding: 20px 16px;
        overflow-y: auto;
    }

    .deposit-modal-content {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .deposit-amount-section {
        margin-bottom: 24px;
    }

    .deposit-amount-section label {
        font-size: 15px;
        margin-bottom: 12px;
        display: block;
    }

    .deposit-amount-options {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        margin-bottom: 14px;
    }

    .amount-btn {
        padding: 14px 8px;
        font-size: 14px;
        border-radius: 8px;
    }

    #deposit-amount {
        padding: 16px;
        font-size: 18px;
        text-align: center;
    }

    .deposit-card-section {
        margin-bottom: 20px;
    }

    .card-field {
        margin-bottom: 16px;
    }

    .card-field label {
        font-size: 14px;
        margin-bottom: 8px;
        display: block;
    }

    .card-field .nestpay-input {
        padding: 16px 14px;
        font-size: 16px;
    }

    .card-row {
        display: flex;
        flex-direction: row;
        gap: 12px;
    }

    .card-row .card-field {
        flex: 1;
    }

    .deposit-3d-option {
        margin-bottom: 20px;
        padding: 14px;
        background: #f8f9fa;
        border-radius: 10px;
    }

    .deposit-3d-option label {
        font-size: 14px;
    }

    .deposit-3d-option small {
        font-size: 12px;
        display: block;
        margin-top: 4px;
        color: #666;
    }

    .deposit-confirm-btn {
        padding: 18px;
        font-size: 17px;
    }

    .deposit-notes {
        margin-top: 20px;
    }

    .deposit-try-note,
    .deposit-secure-note {
        padding: 12px;
        font-size: 13px;
        text-align: center;
        border-radius: 8px;
    }

    /* 3D Modal Mobile */
    .nestpay-3d-modal-content {
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }

    #nestpay-3d-frame {
        min-height: calc(100vh - 100px);
    }

    /* Toast Mobile */
    .nestpay-toast-container {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .nestpay-toast {
        padding: 14px 16px;
        border-radius: 10px;
    }

    .nestpay-toast-icon {
        font-size: 22px;
    }

    .nestpay-toast-title {
        font-size: 14px;
    }

    .nestpay-toast-message {
        font-size: 13px;
    }

    .nestpay-toast-close {
        font-size: 20px;
        padding: 4px;
    }
}

/* Extra Small Devices */
@media (max-width: 360px) {
    .deposit-amount-options {
        grid-template-columns: repeat(2, 1fr);
    }
}
