/* Payment Modal Styles */

/* Modal Overlay & Container */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.payment-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.payment-modal-content {
    position: relative;
    background: var(--bg-white, #ffffff);
    border-radius: var(--radius-xl, 1rem);
    box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.payment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: linear-gradient(135deg, var(--primary-green-lighter, rgba(1, 223, 74, 0.05)), transparent);
}

.payment-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0;
}

.payment-modal-header h2 svg {
    color: var(--primary-green, #01df4a);
}

.payment-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-gray, #f1f3f5);
    border-radius: var(--radius-full, 9999px);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
}

.payment-modal-close:hover {
    background: var(--danger-light, rgba(239, 68, 68, 0.1));
    color: var(--danger, #ef4444);
}

.payment-modal-close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Plan Info */
.payment-modal-plan-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-light, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.plan-label {
    color: var(--text-secondary, #6c757d);
    font-size: 0.875rem;
}

.plan-name {
    font-weight: 600;
    color: var(--primary-green, #01df4a);
}

.plan-price-tag {
    margin-right: auto;
    background: var(--primary-green-light, rgba(1, 223, 74, 0.1));
    color: var(--primary-green, #01df4a);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full, 9999px);
    font-weight: 600;
    font-size: 0.9rem;
}

.plan-price-tag .currency {
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

/* Modal Body */
.payment-modal-body {
    padding: 1.5rem;
}

/* Payment Tabs */
.payment-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-gray, #f1f3f5);
    padding: 0.375rem;
    border-radius: var(--radius-lg, 0.75rem);
}

.payment-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-md, 0.5rem);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary, #6c757d);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
}

.payment-tab:hover {
    color: var(--text-primary, #1a1a1a);
}

.payment-tab.active {
    background: var(--bg-white, #ffffff);
    color: var(--primary-green, #01df4a);
    box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
}

.payment-tab svg {
    fill: currentColor;
}

/* Payment Content */
.payment-content {
    display: none;
}

.payment-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Online Payment */
.online-payment-info {
    padding: 1.5rem;
    background: var(--bg-light, #f8f9fa);
    border-radius: var(--radius-lg, 0.75rem);
    margin-bottom: 1.5rem;
}

.gateway-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-white, #ffffff);
    border: 2px solid var(--primary-green, #01df4a);
    border-radius: var(--radius-md, 0.5rem);
    cursor: pointer;
    margin-bottom: 1rem;
}

.gateway-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-green, #01df4a);
}

.gateway-option label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    flex: 1;
}

.gateway-logo {
    height: 28px;
    object-fit: contain;
}

.gateway-description {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary, #6c757d);
    font-size: 0.875rem;
    margin: 0;
}

.gateway-description svg {
    color: var(--success, #22c55e);
    fill: currentColor;
}

/* Bank Info Card */
.bank-info-card {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    padding: 1.25rem;
    border-radius: var(--radius-lg, 0.75rem);
    margin-bottom: 1.5rem;
}

.bank-info-card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
    font-weight: 500;
}

.bank-info-card h4 svg {
    fill: currentColor;
}

.bank-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.bank-info-row:last-child {
    margin-bottom: 0;
}

.bank-info-row .label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    min-width: 100px;
}

.bank-info-row .value {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.bank-info-row .card-number {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
    direction: ltr;
}

.bank-info-row.amount-row {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.bank-info-row .amount {
    color: #48bb78;
    font-size: 1.1rem;
}

.btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm, 0.375rem);
    cursor: pointer;
    transition: background 0.2s ease;
    margin-right: auto;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-copy svg {
    fill: white;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    font-size: 0.9rem;
}

.form-group label svg {
    fill: var(--text-secondary, #6c757d);
}

.form-group label .optional {
    font-weight: 400;
    color: var(--text-secondary, #6c757d);
    font-size: 0.8rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--bg-white, #ffffff);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green, #01df4a);
    box-shadow: 0 0 0 3px var(--primary-green-light, rgba(1, 223, 74, 0.1));
}

.form-control[readonly] {
    background: var(--bg-light, #f8f9fa);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    border: 2px dashed var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 0.75rem);
    background: var(--bg-light, #f8f9fa);
    color: var(--text-secondary, #6c757d);
    text-align: center;
    transition: all 0.2s ease;
}

.file-upload-wrapper:hover .file-upload-label {
    border-color: var(--primary-green, #01df4a);
    background: var(--primary-green-lighter, rgba(1, 223, 74, 0.05));
}

.file-upload-label svg {
    fill: var(--primary-green, #01df4a);
}

.file-upload-label small {
    font-size: 0.75rem;
    color: var(--text-light, #9ca3af);
}

.file-preview {
    position: relative;
    border-radius: var(--radius-lg, 0.75rem);
    overflow: hidden;
    background: var(--bg-light, #f8f9fa);
}

.file-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.remove-file {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--danger, #ef4444);
    color: white;
    border-radius: var(--radius-full, 9999px);
    cursor: pointer;
    transition: background 0.2s ease;
}

.remove-file:hover {
    background: #dc2626;
}

.remove-file svg {
    fill: currentColor;
}

/* Error Message */
.error-message {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8rem;
    color: var(--danger, #ef4444);
}

/* Pay Button */
.btn-pay {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    background: linear-gradient(135deg, var(--primary-green, #01df4a) 0%, #00c040 100%);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg, 0.75rem);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
    box-shadow: 0 4px 14px rgba(1, 223, 74, 0.35);
}

.btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 223, 74, 0.45);
}

.btn-pay:active {
    transform: translateY(0);
}

.btn-pay svg {
    fill: currentColor;
}

/* Loading Overlay */
.payment-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl, 1rem);
    z-index: 10;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-green, #01df4a);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.payment-loading p {
    color: var(--text-secondary, #6c757d);
    font-size: 0.95rem;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--text-primary, #1a1a1a);
    color: white;
    border-radius: var(--radius-lg, 0.75rem);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    z-index: 10000;
    animation: toastSlideUp 0.3s ease;
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast-notification.toast-success {
    background: var(--success, #22c55e);
}

.toast-notification.toast-error {
    background: var(--danger, #ef4444);
}

.toast-notification.toast-warning {
    background: var(--warning, #f59e0b);
}

.toast-message {
    font-size: 0.95rem;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

/* JalaliDatePicker Customization */
.jdp-container {
    font-family: 'Vazirmatn', sans-serif !important;
    z-index: 10001 !important;
}
jdp-container {
    font-family: 'Vazirmatn', sans-serif !important;
    z-index: 10001 !important;
}

.jdp-header {
    background: var(--primary-green, #01df4a) !important;
}

.jdp-day.selected {
    background: var(--primary-green, #01df4a) !important;
}

.jdp-day:hover:not(.disabled):not(.selected) {
    background: var(--primary-green-light, rgba(1, 223, 74, 0.1)) !important;
}

/* Responsive */
@media (max-width: 576px) {
    .payment-modal {
        padding: 0.5rem;
    }

    .payment-modal-content {
        max-height: 95vh;
        border-radius: var(--radius-lg, 0.75rem);
    }

    .payment-modal-header {
        padding: 1rem;
    }

    .payment-modal-header h2 {
        font-size: 1.1rem;
    }

    .payment-modal-plan-info {
        flex-wrap: wrap;
        padding: 0.875rem 1rem;
    }

    .plan-price-tag {
        margin-right: 0;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }

    .payment-modal-body {
        padding: 1rem;
    }

    .payment-tab {
        font-size: 0.8rem;
        padding: 0.625rem 0.5rem;
    }

    .payment-tab svg {
        width: 16px;
        height: 16px;
    }

    .bank-info-card {
        padding: 1rem;
    }

    .bank-info-row .label {
        min-width: 80px;
        font-size: 0.8rem;
    }

    .bank-info-row .card-number {
        font-size: 0.95rem;
        letter-spacing: 1px;
    }

    .btn-pay {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
}

/* ===== Payment Result Modal ===== */
.result-modal .payment-modal-content {
    max-width: 450px;
    text-align: center;
    padding: 2rem;
}

.result-modal-content {
    animation: resultModalIn 0.4s ease;
}

@keyframes resultModalIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-icon.success {
    background: var(--success-light, rgba(34, 197, 94, 0.1));
    color: var(--success, #22c55e);
}

.result-icon.success svg {
    animation: checkmarkDraw 0.5s ease 0.2s forwards;
}

@keyframes checkmarkDraw {
    from {
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.result-icon.error {
    background: var(--danger-light, rgba(239, 68, 68, 0.1));
    color: var(--danger, #ef4444);
}

.result-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
}

.result-title.success {
    color: var(--success, #22c55e);
}

.result-title.error {
    color: var(--danger, #ef4444);
}

.result-title.info {
    color: #3b82f6;
}

.result-message {
    color: var(--text-secondary, #6c757d);
    font-size: 1rem;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
}

.result-details {
    background: var(--bg-light, #f8f9fa);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: right;
}

.result-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.result-detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary, #6c757d);
    font-size: 0.9rem;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.detail-value.success {
    color: var(--success, #22c55e);
}

.result-help {
    background: var(--warning-light, rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md, 0.5rem);
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: right;
}

.result-help p {
    margin: 0;
    color: #b45309;
    font-size: 0.875rem;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.result-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md, 0.5rem);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
    border: none;
    font-family: inherit;
}

.result-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-green, #01df4a) 0%, #00c040 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(1, 223, 74, 0.3);
}

.result-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 223, 74, 0.4);
}

.result-actions .btn-secondary {
    background: var(--bg-gray, #f1f3f5);
    color: var(--text-primary, #1a1a1a);
}

.result-actions .btn-secondary:hover {
    background: var(--border-color, #e5e7eb);
}

.result-actions .btn svg {
    fill: currentColor;
}

@media (max-width: 480px) {
    .result-modal .payment-modal-content {
        padding: 1.5rem;
    }

    .result-icon {
        width: 64px;
        height: 64px;
    }

    .result-icon svg {
        width: 48px;
        height: 48px;
    }

    .result-title {
        font-size: 1.25rem;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Discount Code Section */
.discount-code-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-gray-50, #f9fafb);
    border-radius: var(--radius-lg, 0.5rem);
    border: 1px solid var(--border-color, #e5e7eb);
}

.discount-code-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.discount-code-input-group input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 0.375rem);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.discount-code-input-group input:focus {
    outline: none;
    /*border-color: var(--primary-color, #3b82f6);*/
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.discount-code-input-group input:disabled {
    /*background-color: var(--bg-gray-100, #f3f4f6);*/
    cursor: not-allowed;
}

.discount-code-input-group .btn {
    padding: 0.625rem 1rem;
    white-space: nowrap;
    font-size: 0.875rem;
}

.discount-code-message {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md, 0.375rem);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.discount-code-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.discount-code-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.discount-code-info {
    padding: 0.75rem;
    background: var(--bg-white, #ffffff);
    border-radius: var(--radius-md, 0.375rem);
    border: 1px solid var(--border-color, #e5e7eb);
}

.discount-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.discount-info-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.discount-info-row.total-row {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    /*border-top: 2px solid var(--primary-color, #3b82f6);*/
    font-weight: 600;
    font-size: 1rem;
}

.discount-value {
    /*color: var(--primary-color, #3b82f6);*/
    font-weight: 500;
}

.discount-amount {
    color: #059669;
    font-weight: 500;
}

.final-amount {
    /*color: var(--primary-color, #3b82f6);*/
    font-weight: 700;
    font-size: 1.125rem;
}

@media (max-width: 640px) {
    .discount-code-input-group {
        flex-direction: column;
    }

    .discount-code-input-group .btn {
        width: 100%;
    }
}

