/* Payment Modal Specific Styles */
#paymentModal .modal-container {
    max-width: 900px;
    /* Wider for the split layout */
    padding: 0;
    /* Remove default padding, use internal padding */
    background: transparent;
    /* Let payment-container handle background */
    border: none;
    box-shadow: none;
}

#paymentModal .payment-container {
    background: #111;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    width: 100%;
    overflow: hidden;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#paymentModal .modal-close {
    z-index: 10;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.2);
}

#paymentModal .modal-close:hover {
    background: #FF4B4B;
}

/* Payment Gateway Styles (Ported from payment.html) */
.payment-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
}

.payment-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.payment-header p {
    font-size: 14px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

.payment-content {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    max-height: 70vh;
    /* Limit height for scrolling within modal */
    overflow-y: auto;
}

.payment-left-section {
    flex: 1;
    min-width: 300px;
    padding: 30px;
    background: #161616;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.payment-right-section {
    flex: 1;
    min-width: 300px;
    padding: 30px;
}

.payment-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-section-title i {
    color: #667eea;
}

/* Form Styles Override for Light Theme in Payment */
#paymentModal .form-group {
    margin-bottom: 20px;
}

#paymentModal label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-weight: 500;
    font-size: 14px;
}

#paymentModal label.required:after {
    content: " *";
    color: #ff6b6b;
}

#paymentModal input,
#paymentModal select,
#paymentModal textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.05);
    /* Force white background */
    color: #fff;
    /* Force dark text */
}

#paymentModal input:focus,
#paymentModal select:focus,
#paymentModal textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

#paymentModal .form-group select option {
    background-color: #222;
    color: #fff;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

#paymentModal .input-with-icon input,
#paymentModal .input-with-icon select {
    padding-left: 45px;
}

.input-with-icon i {
    z-index: 2;
}

.currency-group {
    display: flex;
    gap: 10px;
}

.currency-group select {
    flex: 0 0 100px;
}

.amount-summary {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.amount-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: #ccc;
}

.amount-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.amount-row.total {
    font-weight: bold;
    font-size: 20px;
    color: #fff;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.amount-label {
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 8px;
}

.amount-value {
    font-weight: 600;
    color: #fff;
}

.gst-badge {
    background: rgba(16, 183, 89, 0.15);
    color: #10b759;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
    margin-left: 5px;
    border: 1px solid rgba(16, 183, 89, 0.3);
}

.policies-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.policies {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.policy-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #aaa;
}

.policy-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.policy-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.policy-link:hover {
    text-decoration: underline;
}

.pay-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.pay-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.notification {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    /* Controlled by JS */
    align-items: center;
    gap: 10px;
}

.success {
    background: #e6f7ee;
    color: #10b759;
    border: 1px solid #a8e6c3;
}

.error {
    background: #fde8e8;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
}

.info {
    background: #e6f3ff;
    color: #3498db;
    border: 1px solid #bee5eb;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
    margin-top: 10px;
    font-size: 13px;
}

/* Policy Modal Nested */
.policy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    /* Higher than main modal */
    justify-content: center;
    align-items: center;
}

.policy-modal.active {
    display: flex;
}

.policy-content {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.policy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.policy-header h2 {
    color: #333;
    font-size: 20px;
}

.policy-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.policy-body {
    overflow-y: auto;
    padding-right: 10px;
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

.policy-body h3 {
    color: #333;
    margin: 15px 0 10px;
    font-size: 16px;
}

.policy-body ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .payment-content {
        flex-direction: column;
        max-height: 75vh;
    }

    .payment-left-section {
        border-right: none;
        border-bottom: 1px solid #eef1f7;
    }

    .payment-left-section,
    .payment-right-section {
        padding: 20px;
    }
}