/* القيم الافتراضية */
:root {
    --bg-color: #000;
    --text-color: #fff;
    --border-color: var(--text-color);
  }
  
  /* الثيم الداكن */
  body.dark-theme {
    --bg-color: #000;
    --text-color: #fff;
    --border-color: #fff;
  }
  
  /* الثيم الفاتح */
  body.light-theme {
    --bg-color: #fff;
    --text-color: #000;
    --border-color: #000;
  }
/* General Styles */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden; /* منع الشريط الأفقي */
    font-family: 'SFDroob', sans-serif; /* استخدام SFDroob كخط افتراضي */
    font-display: swap; /* أو optional */
    transition: all 0.4s ease;
  }
  
  * {
    color: var(--text-color);
    background-color: var(--bg-color);
    border-color: var(--border-color);
  }
  
  h1, p {
    color: var(--text-color);
  }
  
  /* زر تبديل الثيم - دائري صغير */
  .icon-theme-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 99999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white; /* نستخدم اللون الأبيض للرمز */
    font-size: 20px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    outline: none; /* إزالة التركيز الخارجي */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
  }
  
  /* الخطوط والعناصر الأخرى */
  
  h1 {
    font-family: 'SFDroob', sans-serif;
    font-weight: 900;
    font-display: swap;
  }
  
  p {
    font-family: 'SFDroob', sans-serif;
    font-weight: 100;
    font-stretch: 50% 200%;
    font-size: 18px;
    font-display: swap;
  }
  
  .logo {
    text-decoration: none;
    color: var(--text-color);
    font-family: 'SFDroob', sans-serif;
    font-size: 24px;
    transition: color 0.3s ease;
  }
  @font-face {
    font-family: 'SFDroob';
    src: url('fonts/SFDroob.woff2') format('woff2');
    font-weight: 100 900;
    font-stretch: 100% 900%;
    font-style: oblique 0deg 15deg;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Mada';
    src: url('fonts/Mada.woff2') format('woff2');
    font-weight: 100 900;
    font-stretch: 100% 900%;
    font-style: oblique 0deg 15deg;
    font-display: swap;
  }
  
  .animated-title {
    font-family: 'SFDroob', sans-serif;
    font-weight: 900;
    font-display: swap;
    font-size: 2em;
    background-image: linear-gradient(270deg, #f200ff, #00BFFF, #f200ff);
    background-size: 300%;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-animation 5s ease infinite;
    margin-top: 0;
  }
  @keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
  }
  /* Navigation */
  nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }
  
  nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
  }
  
  nav ul li {
    position: relative;
  }
  
  nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px;
    display: block;
    transition: background-color 0.3s ease;
  }
  
  nav ul li a:hover {
    background-color: #444;
    color: var(--text-color);
  }
  
  .dropdown {
    position: relative;
    display: inline-block;
  }
  
  .dropdown-toggle {
    background-color: transparent;
    color: var(--text-color);
    padding: 10px 16px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 6px;
  }
  
  .dropdown-toggle .arrow {
    margin-left: 8px;
    font-size: 12px;
  }
  
  .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-color);
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 180px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--text-color);
  }
  
  .dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    color: var(--text-color);
    text-decoration: none;
  }
  
  .dropdown-menu li a:hover {
    background-color: #444;
    color: var(--text-color);
  }
  
  .dropdown-menu::-webkit-scrollbar {
    width: 6px;
  }
  
  .dropdown-menu::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 3px;
  }
  
  .dropdown:hover .dropdown-menu,
  .dropdown.open .dropdown-menu {
    display: block;
  }
  .controls-bar {
    background-color: #444;
    padding: 10px 20px;
    text-align: center;
    position: sticky;
    top: 50px;
    z-index: 90;
  }
  
  .controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
  }
  
  .slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  input[type="range"] {
    width: 45%;
    margin: 5px 0;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: #6fa5df;
    outline: none;
    border-radius: 5px;
  }
  
  .weight-buttons button {
    padding: 8px 16px;
    background-color: #555;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }
  
  .weight-buttons button:hover {
    background-color: #777;
  }
  
  .Layout-features {
    position: relative;
  }
  
  .features-toggle {
    padding: 10px;
    background-color: #555;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }
  
  .feature-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #444;
    padding: 10px;
    border-radius: 5px;
    z-index: 10;
    width: 200px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align-last: left;
  }
  
  .feature-list label {
    display: block;
    margin-bottom: 8px;
  }
  
  .feature-list.show {
    display: block;
  }
  
  .purchase-details h4 {
    display: none;
    margin-bottom: 10px;
  }
  
  .weight-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
  }
  
  .weight-buttons button {
    padding: 8px 12px;
    border: none;
    background-color: #555;
    color: #fff;
    cursor: pointer;
    border-radius: 5px;
  }
  
  .weight-buttons button:hover {
    background-color: #777;
  }
  
  .features-toggle {
    padding: 10px;
    background-color: #555;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }
  
  .feature-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #444;
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
    width: 200px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align-last: left;
  }
  
  .feature-list label {
    display: block;
    margin-bottom: 8px;
  }
  
  .feature-list.show {
    display: block;
  }
  
  .page-container {
    flex: 1;
    padding: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
    margin-bottom: 10px;
  }
  
  .font-pages {
    margin-bottom: 20px;
  }
  
  .font-page {
    display: none;
    text-align: center;
  }
  
  .font-page.active {
    display: block;
  }
  
  .main-content {
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: #151515;
    padding: 20px;
  }
  
  .preview-container,
  .main-content {
    background-color: var(--bg-color);
  }
  
  .preview-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
  }
  
  #editable-preview {
    width: 100%;
    max-width: 800px;
    min-height: 150px;
    padding: 30px;
    border: 2px dashed #00aeff;
    border-radius: 10px;
    background-color: var(--bg-color);
    color: #00aeff;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 60px;
    font-weight: 100;
    font-family: 'Mada', sans-serif;
    margin: 0 auto;
    display: block;
    outline: none;
    resize: none;
    overflow: auto;
  }
  
  #editable-preview:empty:before {
    content: attr(data-placeholder);
    color: #777;
    font-style: normal;
    display: block;
    margin: 0 auto;
  }
  #unique-text-container {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 20px auto;
  }
  
  #unique-arabic-text {
    direction: rtl;
    flex: 1;
  }
  
  #unique-english-text {
    direction: ltr;
    flex: 1;
  }
  
  .font-info {
    text-align: center;
    padding: 20px;
  }
  
  footer {
    background-color: #333;
    padding: 10px;
    text-align: center;
  }
  
  footer a {
    color: #fff;
    text-decoration: none;
  }
  
  footer {
    background-color: #1a1a1a;
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid #333;
  }
  
  footer p {
    margin: 5px 0;
    font-family: 'SFDroob', sans-serif;
    font-weight: 400;
  }
  
  footer {
    background-color: #2e2e2e;
    color: #b0b0b0;
  }
  
  footer a {
    color: #00aeff;
  }
  
  footer a:hover {
    color: #007bff;
  }
  @media (max-width: 600px) {
    table {
      display: block;
      overflow-x: auto;
    }
  }
  
  table {
    width: 80%;
    margin: 0 auto;
    border-collapse: collapse;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }
  
  th,
  td {
    border: 1px solid #404040;
    padding: 8px;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  
  a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
  }
  
  a:hover {
    color: hsl(211, 78%, 71%);
    text-decoration: underline;
  }
  
  a {
    text-decoration: none !important;
  }
  
  .btn {
    text-decoration: none !important;
  }
  
  .font-info-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    direction: rtl;
    font-family: 'SFDroob', sans-serif;
  }
  
  .font-card {
    border: 1px solid #606060;
    border-radius: 12px;
    padding: 10px;
    background-color: #282828;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    margin: 5px 0;
  }
  
  .font-card h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: rgb(255, 255, 255);
    margin: 5px 0;
  }
  
  .font-card p {
    margin: 0.5em 0;
    color: rgb(255, 255, 255);
    line-height: 1.6;
  }
  
  .font-card a {
    color: #0077cc;
    text-decoration: none;
  }
  
  .font-card a:hover {
    text-decoration: underline;
  }
  
  @media (max-width: 600px) {
    .font-card {
      padding: 12px;
    }
  
    .font-card h2 {
      font-size: 1rem;
    }
  
    .font-card p {
      font-size: 0.9rem;
    }
  }
  
  .explanation {
    font-size: 14px;
    color: #7d7c7c;
    margin-top: 10px;
    text-align: center;
    margin-bottom: 2px;
  }
  /* تحديث شامل لكل العناصر لتتبع الثيم */
  .card,
  .font-card,
  table,
  th, td,
  input[type="text"],
  input[type="range"],
  textarea,
  select,
  button,
  .dropdown-menu,
  nav ul li a,
  .purchase-details h4,
  .font-card h2,
  .font-card p,
  #editable-preview,
  #chat-window,
  #chat-message {
    color: var(--text-color);
    background-color: var(--bg-color);
    border-color: var(--text-color);
  }
  
  /* لتحديث الجداول فقط - ضمان رؤية الحواف في الثيم الفاتح */
  body.light-theme table th,
  body.light-theme table td {
    border-color: #000 !important;
    color: #000 !important;
  }
  
  /* لتحديث النصوص داخل chat window */
  body.light-theme #chat-window {
    color: #000;
  }
  
  /* لتحديث الزر عند التحويم - مع تباين أقل */
  input:hover, textarea:hover, select:hover,
  button:hover {
    background-color: #eee !important;
  }
  .icon-theme-button {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .icon-theme-button:focus {
    outline: none;
  }
  
  .icon-theme-button .color-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #fff; /* اللون الأبيض افتراضي */
    transition: background-color 0.3s ease;
  }
  /* منع أي مؤشر عند النقر أو التركيز */
  .icon-theme-button:focus {
    outline: none;
  }
  
  /* تأثيرات عند التحويم والضغط */
  .icon-theme-button:hover {
    transform: translateX(-50%) scale(1.1);
  }
  
  .icon-theme-button:active {
    transform: translateX(-50%) scale(0.95);
  }
  #unique-text-container,
  .page-container,
  .controls-bar,
  footer,
  #chat-window,
  #chat-icon {
    background-color: var(--bg-color);
    color: var(--text-color);
  }
  /* زر مستقل عن الثيم - دائمًا بنفس اللون */
.btn {
  display: inline-block;
  padding: 14px 30px;
  font-size: 18px;
  font-weight: bold;
  color: #fff !important;           /* دائمًا نص أبيض */
  background-color: #F04F58 !important; /* دائمًا لون وردي */
  border-radius: 8px;
  text-decoration: none !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: #d9454e !important;
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}
