/* public/rasafan-style.css */

.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
}

.rasafan-form-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    direction: rtl;
    font-family: 'Tahoma', 'Arial', sans-serif;
}

.rasafan-form-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.rasafan-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
}

.rasafan-section h3 {
    margin-top: 0;
    font-family: YekanBakhFaNum, sans-serif !important;
    color: #0073aa;
    font-size: 18px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
}

.form-group.full-width {
    width: 100%;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-family: YekanBakhFaNum, sans-serif !important;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
}

/* جستجو */
.search-box {
    position: relative;
}

#product_search {
    width: 100%;
    padding: 12px;
    border: 2px solid #0073aa;
    border-radius: 5px;
    font-size: 16px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f0f0f0;
}

.search-result-item .product-name {
    font-weight: bold;
    color: #333;
    margin-bottom : 10px;
}

.search-result-item .product-code {
    color: #666;
    font-size: 12px;
    margin-bottom : 10px;
}

.search-result-item .product-price {
    color: #0073aa;
    font-size: 14px;
    margin-bottom : 4px;
}

/* جدول محصولات */
.rasafan-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    background: white;
}

.rasafan-table th,
.rasafan-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
}

.rasafan-table th {
    background: #0073aa;
    font-family: YekanBakhFaNum, sans-serif !important;
    color: white;
    font-weight: bold;
}

.rasafan-table tbody tr:hover {
    background: #f5f5f5;
}

.rasafan-table input {
    width: 150px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

.rasafan-table tfoot td {
    background: #f9f9f9;
    font-size: 16px;
    padding: 15px;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-remove:hover {
    background: #c82333;
}

/* دکمه‌ها */
.rasafan-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #0073aa;
    color: white;
}

.btn-primary:hover {
    background: #005a87;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.pdf-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

.pdf-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pdf-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pdf-result a {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.pdf-result a:hover {
    background: #218838;
}

#total_amount {
    color: #0073aa;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
   .form-row {
        flex-direction: column;
    }
    
    .table-responsive-wrapper {
        overflow-x: auto;
    }

    .rasafan-table {
        font-size: 12px;
    }
    
    .rasafan-table th,
    .rasafan-table td {
        padding: 8px 4px;
        white-space: nowrap;
    }

    .rasafan-table input {
        width: 100px;
        font-size: 12px;
    }
}
