/**
 * WebmasterSalam Payment Gateway - Frontend Styles
 * @version 1.0.0
 * @author WebmasterSalam.com
 */

:root {
    --wms-primary: #1FABE3;
    --wms-primary-dark: #2D3E77;
    --wms-success: #10b981;
    --wms-danger: #ef4444;
    --wms-warning: #f59e0b;
    --wms-text: #1f2937;
    --wms-text-light: #6b7280;
    --wms-border: #e5e7eb;
    --wms-bg: #f9fafb;
    --wms-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --wms-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* === فرم پرداخت === */
.wms-payment-wrapper {
    direction: rtl;
    max-width: 900px;
    padding: 0 20px;
}

.wms-payment-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--wms-shadow-lg);
    overflow: hidden;
    border: 1px solid var(--wms-border);
}

.wms-card-header {
    background: linear-gradient(135deg, var(--wms-primary) 0%, var(--wms-primary-dark) 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.wms-card-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.wms-card-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 15px;
}

.wms-card-body {
    padding: 40px;
}

/* === Grid دو ستونه === */
.wms-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.wms-form-group {
    display: flex;
    flex-direction: column;
}

.wms-form-group label {
    font-weight: 600;
    color: var(--wms-text);
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wms-required {
    color: var(--wms-danger);
}

.wms-form-control {
    padding: 8px;
    border: 2px solid var(--wms-border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
    color: var(--wms-text);
    font-family: inherit;
}

.wms-form-control:focus {
    outline: none;
    border-color: var(--wms-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wms-form-control::placeholder {
    color: var(--wms-text-light);
}

/* === Result Box === */
.wms-pay {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wms-result-box {
    margin: 10px 0;
    display: none;
    animation: slideDown 0.4s ease;
}

.wms-result-box.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wms-result-item {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
}

.wms-result-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.wms-result-label {
    font-weight: 600;
    color: var(--wms-text);
    font-size: 14px;
}

.wms-result-value {
    font-size: 20px;
    font-weight: 700;
    color: #000;
}

.wms-result-value.large {
    font-size: 24px;
}

/* === Buttons === */
.wms-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.wms-btn-group {
    margin-right: auto;
}

.wms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wms-btn-primary {
    background: var(--wms-primary);
    color: white;
    font-size: 14px;
    padding: 10px 20px;
    line-height: normal;
}

.wms-btn-success {
    background: var(--wms-success);
    color: white;
}

.wms-btn-success:hover:not(:disabled) {
    background: #059669;
}

.wms-btn-block {
    width: 100%;
    justify-content: center;
}

.wms-btn-group {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* === Alert Messages === */
.wms-alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

.wms-alert-success {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

.wms-alert-error {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.wms-alert-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

/* === Badge === */
.wms-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.wms-badge-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* === Loading Spinner === */
.wms-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* === Success/Failed Pages === */
.wms-result-page {
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.wms-result-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 48px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.wms-result-icon.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #10b981;
}

.wms-result-icon.failed {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #ef4444;
}

.wms-result-page h2 {
    font-size: 32px;
    margin: 0 0 15px 0;
    color: var(--wms-text);
}

.wms-result-page p {
    font-size: 16px;
    color: var(--wms-text-light);
    margin-bottom: 30px;
}

.wms-details-box {
    background: var(--wms-bg);
    border: 1px solid var(--wms-border);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    text-align: right;
}

.wms-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--wms-border);
}

.wms-detail-row:last-child {
    border-bottom: none;
}

.wms-detail-label {
    font-weight: 600;
    color: var(--wms-text);
}

.wms-detail-value {
    color: var(--wms-text-light);
}

.wms-tracking-code {
    font-size: 20px;
    font-weight: 700;
    color: var(--wms-success);
    font-family: 'Courier New', monospace;
}

/* === Footer === */
.wms-footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--wms-text-light);
    font-size: 14px;
}

.wms-footer a {
    color: var(--wms-primary);
    text-decoration: none;
    font-weight: 600;
}

.wms-footer a:hover {
    text-decoration: underline;
}

/* === Responsive === */
@media (max-width: 768px) {
    .wms-form-grid {
        grid-template-columns: 1fr;
    }
    
    .wms-card-body {
        padding: 25px;
    }
    
    .wms-card-header {
        padding: 25px;
    }
    
    .wms-card-header h2 {
        font-size: 20px;
    }
    
    .wms-btn-group {
        flex-direction: column;
    }
    
    .wms-result-page {
        padding: 40px 15px;
    }
}

@media (max-width: 480px) {
    .wms-payment-wrapper {
        padding: 0;
    }
    
    .wms-card-body {
        padding: 20px;
    }
    
    .wms-btn {
        adding: 8px 16px;
    }
    
    .wms-btn-group {
        margin-right: 0 !important;
    }
    
    .wms-pay {
        flex-direction: column;
    }
    
    .wms-btn-group {
        flex-direction: row;
    }
    
    .wms-card-header p{
        font-size: 13px !important;
    }
    
}

/* === Print Styles === */
@media print {
    .wms-btn,
    .wms-footer {
        display: none;
    }
}