/* 
 * POS Search Buttons Fix - إصلاح أزرار البحث في نقطة البيع
 * يضمن أن جميع الأزرار في مربع البحث متناسقة ومتساوية في الحجم
 * التحديث: دمج الأزرار داخل المربع بشكل احترافي
 */

/* Container for all search buttons - تصميم موحد */
.pos-search-container {
    position: relative;
    display: flex !important;
    align-items: center !important;
    background: white !important;
    border-radius: 10px !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12) !important;
    overflow: visible !important;
    border: 2px solid #dfe4ea !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 48px !important;
}

.pos-search-container:focus-within {
    border-color: #3498db !important;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.25) !important;
    transform: translateY(-1px);
}

/* Left buttons container - دمج داخل المربع */
.pos-search-left-buttons {
    display: flex !important;
    align-items: center !important;
    background: transparent !important;
    padding: 4px 8px !important;
    border-right: 2px solid #e8ecef !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

/* Right buttons container - دمج داخل المربع */
.pos-search-right-buttons {
    display: flex !important;
    align-items: center !important;
    background: transparent !important;
    padding: 4px 8px !important;
    border-left: 2px solid #e8ecef !important;
    flex-shrink: 0 !important;
}

/* Search input field */
.pos-search-input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    background: transparent;
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
}

.pos-search-input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

/* ==========================================
 * BUTTON STYLES - جميع الأزرار بنفس الحجم - مدمجة داخل المربع
 * ========================================== */

/* Common button styles */
.btn-search-config,
.btn-weighing-scale,
.pos_add_quick_product {
    border: none !important;
    color: white !important;
    padding: 6px 10px !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    min-width: 36px !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 15px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

/* Search config button - أزرق */
.btn-search-config {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
    margin-left: 4px;
}

.btn-search-config:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3) !important;
    color: white !important;
}

/* Weighing scale button - برتقالي */
.btn-weighing-scale {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%) !important;
}

.btn-weighing-scale:hover {
    background: linear-gradient(135deg, #d35400 0%, #e67e22 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.3) !important;
    color: white !important;
}

/* Quick add product button - أخضر */
.pos_add_quick_product {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
}

.pos_add_quick_product:hover {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3) !important;
    color: white !important;
}

/* ==========================================
 * ICON STYLES - حماية الأيقونات
 * ========================================== */

.btn-search-config i,
.btn-weighing-scale i,
.pos_add_quick_product i {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'FontAwesome' !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-size: 14px !important;
    color: white !important;
    display: inline-block !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================
 * RESPONSIVE STYLES - للشاشات الصغيرة
 * ========================================== */

@media (max-width: 768px) {
    .pos-search-container {
        flex-direction: row !important;
        border-radius: 8px !important;
        min-height: 44px !important;
    }
    
    .pos-search-left-buttons,
    .pos-search-right-buttons {
        padding: 3px 6px !important;
        gap: 4px !important;
    }
    
    .pos-search-left-buttons {
        border-right: 1px solid #e8ecef !important;
    }
    
    .pos-search-right-buttons {
        border-left: 1px solid #e8ecef !important;
    }
    
    .pos-search-input {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
    
    .btn-search-config,
    .btn-weighing-scale,
    .pos_add_quick_product {
        min-width: 32px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 13px !important;
        padding: 5px 8px !important;
    }
    
    .btn-search-config i,
    .btn-weighing-scale i,
    .pos_add_quick_product i {
        font-size: 12px !important;
    }
}

/* ==========================================
 * FOCUS & ACTIVE STATES
 * ========================================== */

.btn-search-config:focus,
.btn-weighing-scale:focus,
.pos_add_quick_product:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.btn-search-config:active,
.btn-weighing-scale:active,
.pos_add_quick_product:active {
    transform: scale(0.95);
}

/* ==========================================
 * DISABLED STATE
 * ========================================== */

.btn-search-config:disabled,
.btn-weighing-scale:disabled,
.pos_add_quick_product:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-search-config:disabled:hover,
.btn-weighing-scale:disabled:hover,
.pos_add_quick_product:disabled:hover {
    transform: none !important;
}

/* ==========================================
 * FINAL INTEGRATION FIXES - إصلاحات نهائية
 * ========================================== */

/* تأكد من عدم وجود مسافات خارجية */
.pos-search-left-buttons,
.pos-search-right-buttons {
    margin: 0 !important;
}

/* محاذاة مثالية للأزرار */
.pos-search-left-buttons > button,
.pos-search-right-buttons > button {
    vertical-align: middle !important;
}

/* إزالة أي borders أو outlines غير مرغوبة */
.pos-search-container * {
    box-sizing: border-box !important;
}

/* تحسين مظهر المربع بالكامل */
.pos-search-container:hover {
    border-color: #bdc3c7 !important;
}

/* ضمان أن الخط في مربع البحث عربي واضح */
.pos-search-input {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

/* حماية الأيقونات من أي تأثيرات خارجية */
.pos-search-container i {
    font-style: normal !important;
    text-rendering: auto !important;
}

/* تحسين التباعد داخل المربع */
.pos-search-container > * {
    flex-shrink: 0;
}

.pos-search-container .pos-search-input {
    flex-shrink: 1;
    flex-grow: 1;
    min-width: 0;
}
