/* إزالة التأثيرات على body لمنع تخريب قالب الموقع */

.paint-app-container {
  width: 100%;
}

/* الشريط الجانبي المخصص للألوان */
.paint-sidebar {
  width: 100%;
  max-width: 340px;
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

.paint-sidebar * {
  box-sizing: border-box;
}

.paint-upload-section {
  margin-bottom: 20px;
}

#imageInput {
  display: none !important;
}

.btn-upload {
  display: block;
  width: 100%;
  text-align: center;
  background: #2563eb;
  color: #fff !important;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-upload:hover {
  background: #1d4ed8;
}

#applyColorBtn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.paint-status {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: #475569;
  font-size: 14px;
  text-align: center;
}

.paint-status.is-error {
  color: #b91c1c;
}

/* حاوية البحث */
.paint-search-container {
  position: relative;
  margin-bottom: 20px;
}

.paint-search-container label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

#colorSearch {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cccccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
}

/* قائمة النتائج المنسدلة للبحث */
.search-results-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.search-result-item:hover {
  background-color: #f5f5f5;
}

.color-preview {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  margin-left: 10px;
  border: 1px solid #ccc;
  display: inline-block;
}

.no-result {
  padding: 12px;
  color: #777;
  text-align: center;
}

/* شبكة أزرار الألوان الأساسية */
.colors-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  max-height: 250px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background-color: #fafafa;
}

/* تنسيق أزرار الألوان */
.color-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s, border-color 0.2s;
}

.color-btn:hover {
  transform: scale(1.1);
  z-index: 2;
}

.color-btn.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4);
}

/* منطقة عرض الصورة والـ Canvas */
.paint-canvas-container {
  flex: 1;
  background: #ffffff;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 480px;
}

.paint-canvas-container canvas {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.paint-families { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.paint-family-button { min-height: 44px; border: 1px solid rgba(20, 35, 55, .18); border-radius: 10px; padding: 7px 4px; font-size: 13px; font-weight: 700; transition: box-shadow .15s; }
.paint-family-button[aria-pressed="true"] { outline: 2px solid #2563eb; outline-offset: 2px; box-shadow: 0 3px 10px rgba(27,43,68,.16); }
.paint-family-button:focus-visible { outline: 3px solid #17243a; outline-offset: 3px; }
