/* استایل‌های اصلی فرم */
.pbc-calculator-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.pbc-calculator-form {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    border: 1px solid #e1e1e1;
}

/* هدر فرم */
.pbc-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.pbc-form-title {
    color: #1e1e1e;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.pbc-form-description {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* بخش‌های فرم */
.pbc-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 4px solid #148bff;
}

.pbc-section-title {
    color: #1e1e1e;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
}

.pbc-section-title::before {
    content: "•";
    color: #148bff;
    margin-left: 8px;
    font-size: 24px;
}

/* گرید فرم */
.pbc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.pbc-full-width {
    grid-column: 1 / -1;
}

/* گروه‌های فرم */
.pbc-form-group {
    margin-bottom: 0;
}

.pbc-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.pbc-form-input,
.pbc-form-select,
.pbc-form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.pbc-form-input:focus,
.pbc-form-select:focus,
.pbc-form-textarea:focus {
    outline: none;
    border-color: #148bff;
    box-shadow: 0 0 0 3px rgba(20, 139, 255, 0.1);
}

.pbc-form-hint {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

/* چک‌باکس‌ها */
.pbc-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.pbc-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    background: #ffffff;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pbc-checkbox-label:hover {
    border-color: #148bff;
}

.pbc-checkbox-label input[type="checkbox"] {
    margin-left: 8px;
}

.pbc-checkbox-text {
    font-size: 14px;
    color: #495057;
}

/* بهبود استایل دکمه آپلود فایل */
.pbc-file-upload {
    margin-top: 10px;
}

.pbc-file-input {
    display: none;
}

.pbc-file-label {
    display: inline-flex;
    align-items: center;
    padding: 12px 25px;
    background: linear-gradient(135deg, #148bff, #0d7ae6);
    color: #ffffff !important;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid transparent;
    text-decoration: none !important;
}

.pbc-file-label:hover {
    background: linear-gradient(135deg, #0d7ae6, #0b6bc4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(20, 139, 255, 0.3);
    color: #ffffff !important;
    text-decoration: none !important;
}

.pbc-file-label:active {
    transform: translateY(0);
}

/* اطمینان از رنگ متن در همه حالت‌ها */
.pbc-file-label,
.pbc-file-label:hover,
.pbc-file-label:focus,
.pbc-file-label:active {
    color: #ffffff !important;
    text-decoration: none !important;
}

.pbc-file-icon {
    margin-left: 8px;
    font-size: 16px;
}

.pbc-file-list {
    margin-top: 15px;
}

.pbc-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    margin-bottom: 8px;
}

.pbc-file-name {
    font-size: 14px;
    color: #495057;
}

.pbc-file-remove {
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.pbc-file-remove:hover {
    color: #c82333;
}

/* نمایش قیمت */
.pbc-price-summary {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #148bff, #0dd674);
    border-radius: 12px;
    color: #ffffff;
    text-align: center;
}

.pbc-price-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.pbc-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 18px;
}

.pbc-price-total {
    font-size: 24px;
    font-weight: 700;
}

.pbc-price-discount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 16px;
}

.pbc-discount-value {
    color: #ffd700;
    font-weight: 600;
}

/* دکمه‌ها */
.pbc-form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pbc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 200px;
}

.pbc-btn-primary {
    background: #148bff;
    color: #ffffff;
}

.pbc-btn-primary:hover {
    background: #0d7ae6;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(20, 139, 255, 0.3);
}

.pbc-btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.pbc-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.pbc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* پیغام‌ها و آلرت‌ها */
.pbc-form-messages {
    margin-top: 20px;
}

.pbc-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.pbc-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pbc-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* مودال */
.pbc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pbc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: pbc-fadeIn 0.3s ease;
}

.pbc-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: pbc-scaleIn 0.3s ease;
    z-index: 1;
}

/* انیمیشن‌های مودال */
@keyframes pbc-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pbc-scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pbc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e1e1;
}

.pbc-modal-title {
    margin: 0;
    color: #1e1e1e;
    font-size: 18px;
    font-weight: 600;
}

.pbc-modal-close {
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pbc-modal-close:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.pbc-modal-body {
    padding: 25px;
}

.pbc-modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px 25px;
    border-top: 1px solid #e1e1e1;
}

.pbc-modal-footer .pbc-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pbc-modal-footer .pbc-modal-cancel:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.pbc-modal-footer .pbc-modal-confirm:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.pbc-modal-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
}

/* واکنش‌گرایی */
@media (max-width: 768px) {
    .pbc-calculator-form {
        padding: 20px;
        margin: 10px;
    }
    
    .pbc-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pbc-form-section {
        padding: 15px;
    }
    
    .pbc-form-actions {
        flex-direction: column;
    }
    
    .pbc-btn {
        min-width: auto;
        width: 100%;
    }
    
    .pbc-checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .pbc-price-row {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .pbc-modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .pbc-modal-footer {
        flex-direction: column;
    }
}

/* انیمیشن‌ها */
@keyframes pbc-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pbc-calculator-form {
    animation: pbc-fade-in 0.6s ease-out;
}

.pbc-modal-content {
    animation: pbc-fade-in 0.3s ease-out;
}

/* استایل‌های RTL */
.rtl .pbc-form-section {
    border-right: none;
    border-left: 4px solid #148bff;
}

.rtl .pbc-section-title::before {
    margin-left: 0;
    margin-right: 8px;
}

.rtl .pbc-checkbox-label input[type="checkbox"] {
    margin-left: 0;
    margin-right: 8px;
}

.rtl .pbc-file-icon {
    margin-left: 0;
    margin-right: 8px;
}

.rtl .pbc-modal-close {
    transform: none;
}

/* استایل برای فیلدهای خطادار */
.pbc-field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2) !important;
}

.pbc-error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* استایل برای فیلدهای موفق */
.pbc-field-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2) !important;
}

/* لودینگ */
.pbc-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #148bff;
    border-radius: 50%;
    animation: pbc-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes pbc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pbc-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 8px;
}

/* درگ و دراپ */
.pbc-drag-over {
    background: #f8f9fa !important;
    border: 2px dashed #148bff !important;
}

.pbc-drag-over .pbc-file-label {
    background: #0d7ae6 !important;
}