/*body {font-family: Arial; margin:0; background:#f5f5f5;}
.container {padding:20px; max-width:1000px; margin:auto;}
.grid {display:grid; grid-template-columns:repeat(2,1fr); gap:10px;}
@media(min-width:768px){.grid{grid-template-columns:repeat(4,1fr);}}
.template {border:3px solid transparent; cursor:pointer; border-radius:12px; overflow:hidden;}
.template img {width:100%; height:140px; object-fit:cover;}
.template.selected {border-color:#007bff;}
.fixed-next {position:fixed; bottom:0; left:0; right:0; background:#fff; padding:10px; box-shadow:0 -2px 10px rgba(0,0,0,.1);}
.btn {padding:12px; background:#007bff; color:#fff; border:none; width:100%; font-size:16px; border-radius:10px;}
.hidden{display:none;}
.preview img{max-width:150px;border-radius:12px;}
.loader{position:fixed;top:0;left:0;right:0;bottom:0;background:#000a;color:#fff;display:flex;align-items:center;justify-content:center;font-size:20px;display:none;}
.blur-img{filter:blur(15px);transition:filter 2s;}
.blur-img.loaded{filter:blur(0);}
.download-icon{position:absolute;top:10px;right:10px;background:#fff;padding:10px;border-radius:50%;}
*/

body {
  font-family:Tajawal, Cairo, Arial, sans-serif;
  margin: 0;
  background: #f5f5f5;
  direction: rtl;
}

.container {
  padding: 10px;
  max-width: 1000px;
  margin: auto;
}

h2 {
  /*text-align: center;*/
}

/* شبكة الصور */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.template {
  border: 3px solid transparent;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
}

.template img {
  width: 100%;
  /*height: 130px;*/
  object-fit: cover;
}

.template.selected {
  border-color: #007bff;
}

/* زر ثابت أسفل الشاشة */
.fixed-next {
  display: flex;
  gap: 10px; /* مسافة بين الزرين */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 10px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}
.fixed-next .btn {
  flex: 1; /* الزر الرئيسي يأخذ المساحة الأكبر */
  width: auto;
  font-size: 16px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

.fixed-next .btn-back {
  flex: 0.2; /* أصغر حجم */
  background: #ffffff; /* لون أقل أهمية */
  border: 1px solid #007bff;
  color: #007bff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px; /* مسافة بين الرمز والنص */
  font-size: 20px;
  padding: 0px;
}



/* الأزرار */
.btn {
  padding: 12px;
  background: #007bff;
  color: #fff;
  border: none;
  width: 100%;
  font-size: 16px;
  border-radius: 12px;
}



.btn1 {
    background: linear-gradient(135deg, #ff8a00, #ff3e3e);
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(255, 90, 0, 0.3);
    /*font-family: "Tajawal", sans-serif;*/
    padding: 12px;
    color: #fff;
    border: none;
    width: 100%;
    font-size: 16px;
    border-radius: 12px;
}

/* إخفاء الأقسام */
.hidden {
  display: none;
}

/* معاينة الصورة */
.preview img {
  max-width: 120px;
  margin: auto;
  display: block;
  border-radius: 12px;
}

/* شاشة التحميل */
/*
.loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: none;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  z-index: 9999;
  text-align: center;
  width:100%;
}*/

/*BOF-- شاشة التحميل */
/* حذف أي سبّينر قديم من القالب */

#ahla-loader {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  
  width: 100% !important;
  max-width: 100% !important; /* يمنع WordPress من التضييق */

  height: 100vh !important;
  background: rgba(0,0,0,0.7);
  color: #fff;

  display: flex !important; /* مهم جداً */
  justify-content: center;
  align-items: center;

  font-size: 20px;
  z-index: 999999 !important;

  visibility: hidden;
  opacity: 0;
  transition: opacity .25s ease;

  margin: 0 !important;
  padding: 0 !important;

  box-sizing: border-box !important;
}
#ahla-loader.show {
  visibility: visible;
  opacity: 1;
}


/* صندوق العناصر */
.ahla-loader-box {
  text-align: center;
}

/* الدائرة */
.ahla-spinner {
  width: 65px;
  height: 65px;
  border: 6px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite, glow 1.5s ease-in-out infinite;
  margin: 0 auto 20px;
}

/* النص */
.ahla-loader-text {
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  margin-top: 10px;
}

/* دوران */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* نبض الضوء */
@keyframes glow {
  0% { box-shadow: 0 0 10px rgba(255,255,255,0.1); }
  50% { box-shadow: 0 0 30px rgba(255,255,255,0.4); }
  100% { box-shadow: 0 0 10px rgba(255,255,255,0.1); }
}
/*BOF-- شاشة التحميل */




/* صورة النتيجة مع مؤثر blur */
.blur-img {
  max-width: 100%;
  border-radius: 12px;
  filter: blur(15px);
  transition: filter 2s ease;
}

.blur-img.loaded {
  filter: blur(0);
}

/* أيقونة التحميل */
.download-icon {
  position: absolute;
  top: 10px;
  right: 10px; /* جهة اليمين لأنها RTL */
  background: #fff;
  padding: 10px;
  border-radius: 50%;
  font-size: 18px;
}


/*BOF--Drag and Drop uploader styles*/
.upload-container {
  max-width: 400px;
  margin: 20px auto;
  text-align: center;
}

.custom-upload-box {
  border: 2px dashed #aaa;
  max-width: 400px;
  text-align: center;
  margin: 20px auto;
  border-radius: 16px;
  padding: 20px 20px;
  cursor: pointer;
  background-color: #fafafa;
  transition: 0.3s ease;
  display: block;
}

.custom-upload-box:hover {
  background-color: #f0f0f0;
  border-color: #4CAF50;
}

.plus-icon {
  font-size: 48px;
  color: #4CAF50;
  font-weight: bold;
}

.upload-text {
  margin-top: 10px;
  font-size: 16px;
  color: #555;
}

.custom-upload-box.dragover {
  background-color: #e8f5e9;
  border-color: #2e7d32;
}

#preview-container img {
  max-width: 100%;
  margin-top: 15px;
  border-radius: 12px;
}
/*EOF--Drag and Drop uploader styles*/


.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 15pt;
  opacity: 0;
  pointer-events: none;
  transition: 0.4s ease;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  /*font-family: 'Tajawal', sans-serif;*/
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}





/*BOF--Results Styles*/
.result-card {
  background: #fff;
  padding: 25px;
  border-radius: 18px;
  box-shadow: 0 6px 25px rgba(0,0,0,0.07);
  margin-top: 20px;
  animation: fadeIn 0.6s ease;
}

.result-title {
  text-align: center;
  font-size: 22px;
  margin-bottom: 10px;
  color: #333;
  font-weight: bold;
}

.result-box {
  text-align: center;
  margin-bottom: 20px;
}

.result-img {
  /*width: 150px;*/
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  margin-bottom: 15px;
  transition: transform 0.3s;
}

.result-img:hover {
  transform: scale(1.02);
}

.download-btn {
  /*font-family:Tajawal, Cairo, Arial, sans-serif;*/
  background: #6c5ce7;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 16px;
  text-decoration: none !important;
  display: inline-block;
  transition: 0.3s;
}

.download-btn:hover {
  background: #4834d4;
  color: #fff;
}

.divider {
  margin: 35px 0;
  border: 0;
  border-bottom: 1px solid #e6e6e6;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
/*EOF--Results Styles*/





.ahla-credit-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    background: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    direction: rtl;
    font-size: 15px;
}

.ahla-credit-box .item {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.ahla-credit-box .value {
    font-weight: bold;
    color: #0073aa;
    margin-right: 4px;
}

.ahla-credit-box .buy-btn {
    background: #28a745;
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
    display: inline-block;
    text-decoration: none !Important;
    transition: 0.2s;
}

.ahla-credit-box .buy-btn:hover {
    background: #218838;
}

/* Mobile Optimization */
@media (max-width: 480px) {
    .ahla-credit-box {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .ahla-credit-box .item {
        justify-content: center;
        width: 100%;
    }
    .ahla-credit-box .buy-btn {
        width: 100%;
        text-align: center;
        padding: 8px 0;
    }
}








.center-container {
    text-align: center;
    margin: 15px 0;
}
.ahla-buy-credit-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff8a00, #ff3e3e);
    color: #fff;
    padding: 10px 22px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(255, 90, 0, 0.3);
    transition: all 0.3s ease;
    /*font-family: "Tajawal", sans-serif;*/
}

.ahla-buy-credit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 90, 0, 0.4);
}

.ahla-buy-credit-btn:active {
    transform: scale(0.97);
}







.ahla-warning-box {
    background: #fff4f4;
    border-left: 5px solid #e53935;
    padding: 18px;
    border-radius: 12px;
    /*font-family: "Tajawal", sans-serif;*/
    max-width: 500px;
    margin: 20px auto;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.ahla-warning-text {
    font-size: 16px;
    color: #b71c1c;
    margin-bottom: 12px;
    font-weight: bold;
}

.ahla-login-btn {
    display: inline-block;
    padding: 10px 22px;
    background: linear-gradient(135deg, #ff8a00, #ff3e3e);
    color: #fff;
    font-size: 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(255,90,0,0.3);
    transition: 0.3s ease;
    text-decoration:none !important;
}
.ahla-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255,90,0,0.4);
}





 