/* 🌐 Floating Action Buttons */
.floating-buttons {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  z-index: 999;
}

.floating-buttons button {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 1.3em;
  background: #2b2c33;
  color: #fff;
  border: none;
  cursor: pointer;

  transition: background 0.3s;
}

.floating-buttons button:hover {
  background: #333;
}

#settingsPanel {
  border-top: 1px solid #42434b;
  display: inline-block;
  bottom: 80px;
  background: rgb(43, 44, 51);
  padding: 20px 10px;
  inline-size: -webkit-fill-available;
  font-family: "Almarai", sans-serif;
  z-index: 1000;

  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
  transform: scale(1);
  min-width: -moz-available;
}

/* Tab Header */
.settings-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: nowrap; /* 🛠 Prevent wrapping */
}

.settings-tabs .tab {
  flex: 1; /* 🛠 Equal width for all tabs */
  text-align: center;
  padding: 10px 14px;
  cursor: pointer;
  background: #35363e;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 500;
  transition: background 0.3s;
  white-space: nowrap; /* 🛠 Prevent text from breaking to second line */
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  font-family: "Almarai", sans-serif;
}
.settings-tabs .tab:hover {
  background: #40424a;
}

.settings-tabs .tab.active {
  background: #f19b1a;
  color: white;
  font-weight: bold;
}

/* Tab Content Section */
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Input Styles */
label {
  font-weight: normal;
  display: flex;
  flex-direction: column;
  font-size: 0.95em;
  color: white;
  gap: 5px;
}

select {
  -webkit-appearance: none; /* Chrome/Safari */
  -moz-appearance: none; /* Firefox */
  appearance: none; /* Standard */

  background-color: #42434b;
  color: #fff;
  padding: 10px 40px 10px 10px; /* space for chevron */
  border-radius: 10px;
  border: 0;
  font-family: inherit;
  font-size: 16px;

  /* Chevron SVG instead of triangle */
  background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" fill-rule="evenodd" d="m2.58579 7.58579c.78104-.78105 2.04738-.78105 2.82842 0l6.58579 6.58581 6.5858-6.58581c.781-.78105 2.0474-.78105 2.8284 0 .7811.78104.7811 2.04738 0 2.82841l-8 8c-.781.7811-2.0474.7811-2.8284 0l-8.00001-8c-.78105-.78103-.78105-2.04737 0-2.82841z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  cursor: pointer;
}

input[type="range"] {
  margin-top: 6px;
  padding: 10px;
  border-radius: 10px;
  background-color: #42434b;
  border: 0px solid #78797f;
  font-family: inherit;
}

#tab-backgrounds h4 {
  font-weight: 500;
  margin: 14px 0 8px;
  font-size: 1em;
  color: white;
}

/* Background gallery container */
.bg-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: right;
}

/* Common thumbnail wrapper for image/video */
.bg-thumb {
  position: relative;
  width: 65px;
  height: 65px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border 0.3s ease;
}

/* Image and video same size and rounded */
.bg-thumb img,
.bg-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

/* Upload button */
.bg-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  font-size: 0.75em;
  color: #666;
  background: #f3f3f3;
  border-radius: 8px;
  border: 1px dashed #bbb;
  cursor: pointer;
  text-align: center;
  padding: 6px;
}

.bg-upload input {
  display: none;
}

.bg-upload:hover {
  background: #e8e8e8;
  color: #333;
}

.bg-thumb.selected {
  border-color: #f19b1a;
  box-shadow: 0 0 0 3px rgba(241, 155, 26, 0.3);
}

.bg-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bg-thumb .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: white;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 8px;
  border-radius: 50%;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bg-thumb:hover .play-icon {
  opacity: 0;
}

input[type="number"],
select {
  margin-top: 6px;
  padding: 10px;
  border-radius: 10px;
  background-color: #42434b;
  border: 1px solid #78797f;
  font-family: inherit;
  color: white;
}

input[type="color"] {
  height: 40px;
  align-self: self-end;
  padding: 2px;
  width: 100px;
  border-radius: 10px;
  background-color: #42434b;
  border: 1px solid #78797f;
  font-family: inherit;
  color: white;
}

.advanced-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.advanced-actions button {
  padding: 12px;
  border-radius: 10px;
  background: #35363e;
  cursor: pointer;
  border: none;
  transition: background 0.3s ease;
  color: white;
  font-family: "Almarai", sans-serif;
}

.advanced-actions button:hover {
  background: #454650;
}
.upload-thumb {
  border: 1px dashed #fff;
  background: transparent;
  color: #fff;
  flex-direction: column;
}

.upload-thumb .upload-content {
  text-align: center;
  font-size: 14px;
}

.upload-thumb .plus-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.upload-thumb .upload-text {
  font-size: 12px;
  opacity: 0.8;
}

/* =============== GROUP STYLING (Dark + Separators) =============== */
.group {
  padding: 12px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #42434b;
}

.group:last-child {
  border-bottom: none; /* آخر جروب من غير خط */
}

.group-header {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-start; /* RTL: العناصر تبدأ من اليمين */
  gap: 12px;
  margin-bottom: 24px;
  justify-self: right;
}

.group-header h3 {
  margin: 0;
  font-size: 1em;
  font-weight: bold;
  color: white;
  text-align: right;
}

/* =============== TAG STYLE (Box Preview) =============== */
.tag {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 6px;
  background-color: #35363e;
  color: white;
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-family: "Almarai", sans-serif;
  user-select: none;
  transition: all 0.3s ease;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid white;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  background-color: transparent; /* default empty */
  transition: all 0.2s;
}

/* Checked state */
input[type="checkbox"]:checked {
  background-color: #f19b1a;
  border-color: #f19b1a;
}

/* Optional: add check mark */
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 6px;
  width: 3px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* =============== RANGE INLINE (Alpha) =============== */
.group-header .range-inline {
  display: flex;
  flex-direction: row-reverse; /* RTL: العنوان والنسبة يمين */
  align-items: center;
  gap: 10px;
  background-color: #35363e;
  color: white;
  padding: 10px 16px;
  border-radius: 20px;
  font-family: "Almarai", sans-serif;
  user-select: none;
  transition: all 0.3s ease;
  font-size: 13px;
}

/* النص + القيمة */
.group-header .range-inline span,
.group-header .range-inline label {
  white-space: nowrap;
}

/* السلايدر */
.group-header .range-inline input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 10px;
  padding: 1px;
  background: #555;
  border-radius: 20px;
  outline: none;
  cursor: pointer;
  direction: rtl; /* عشان يتحرك طبيعي */
  transition: background 0.3s;
}

.group-header .range-inline input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 20px;
  border-radius: 20px;
  background: #f19b1a;
  cursor: pointer;
  transition: background 0.2s;
}

.group-header .range-inline input[type="range"]::-webkit-slider-thumb:hover {
  background: #ffae33;
}

.group-header .range-inline input[type="range"]::-moz-range-thumb {
  width: 30px;
  height: 20px;
  border-radius: 20px;
  background: #f19b1a;
  cursor: pointer;
  border: none;
}
