/*
Theme Name: Astra Child
Theme URI: https://wpastra.com/
Template: astra
Author: Brainstorm Force
Description: Child theme for Astra with custom Tajawal font and MegaSham Brand Colors.
Version: 4.11.15.1764528270
*/

/* =========================================
   1. FONTS IMPORT & GLOBAL RESETS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  --brand-green: #007A3D;       
  --brand-green-dark: #005c2e;  
  --brand-black: #1a1a1a;       
  --brand-light-bg: #f4f7f6;    
  --brand-accent-red: #D72810;  
  --brand-card-bg: #ffffff;
}

html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
  background-color: var(--brand-light-bg); 
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* =========================================
   2. MAIN CONTAINER
   ========================================= */
.main_div_container {
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 30px;
  width: 90%;
  max-width: 800px;
  margin: 50px auto;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  border-top: 5px solid var(--brand-green);
  direction: rtl;
  text-align: right;
}

.main_div_container h1,
.main_div_container h2 {
  font-family: 'Tajawal', sans-serif;
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.4;
  color: var(--brand-green);
}

.main_div_container h3,
.main_div_container h4,
.main_div_container h5,
.main_div_container h6 {
  color: var(--brand-black);
  font-weight: 700;
}

/* =========================================
   3. MESSAGE BOX
   ========================================= */
.div_message {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 25px auto;
  padding: 15px;
  background-color: #e9f7ef; 
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  font-family: 'Tajawal', sans-serif;
  text-align: center;
  color: #155724;
}

/* =========================================
   4. STANDARD HTML TABLE STYLES
   ========================================= */
.general_table_classs {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
}

.general_table_classs caption {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
  background-color: #e9f7ef;
  text-align: center;
  padding: 12px;
  color: var(--brand-green);
  border-radius: 6px;
}

.general_table_classs th,
.general_table_classs td {
  border: 1px solid #eee;
  padding: 14px 15px;
  text-align: right;
  vertical-align: middle;
  word-break: break-word;
}

.general_table_classs th {
  background-color: #fcfcfc;
  color: var(--brand-black);
  font-weight: 800;
}

/* Footer */
.general_table_classs tfoot {
  background-color: #f8f9fa;
  font-weight: bold;
  border-top: 2px solid #ddd;
}

.general_table_classs tfoot td {
  border-top: 1px solid #ccc;
  text-align: center;
  padding: 15px;
  color: #555;
}

/* =========================================
   5. DIV-BASED TABLE STYLES
   ========================================= */
.div_table_caption {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
  background-color: #fff;
  padding: 12px;
  text-align: center;
  border-bottom: 2px solid var(--brand-green);
  color: var(--brand-black);
  border-radius: 6px 6px 0 0;
}

.div_table_row_header {
  display: grid;
  grid-template-columns: 30% 70%;
  background-color: var(--brand-black);
  font-weight: bold;
  border-bottom: 1px solid #e9ecef;
  color: #fff;
  padding: 14px 15px;
  align-items: center;
  text-align: center;
}

.div_table_row {
  display: grid;
  grid-template-columns: 30% 70%;
  border-bottom: 1px solid #f0f0f0;
  padding: 0;
  align-items: stretch;
  background-color: #fff;
  transition: background-color 0.2s;
}
.div_table_row:last-child {
  border-bottom: none;
}
.div_table_row:hover {
    background-color: #fbfbfb;
}

.div_table_cell {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  min-width: 0;
  word-break: break-word;
}

.div_table_cell_label {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  background-color: #f9fbfd; 
  color: #444;
  border-left: 1px solid #eee;
  text-align: right;
  min-width: 0;
  word-break: break-word;
}

.div_table_row_footer {
  display: flex;
  justify-content: center;
  background-color: #f8f9fa;
  font-weight: bold;
  border-top: 1px solid #ddd;
  color: #333;
  padding: 20px 15px;
}

/* =========================================
   6. FORMS & INPUTS
   ========================================= */
.main_div_container fieldset {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border: 1px solid #e0e0e0;
  padding: 25px;
  margin-bottom: 25px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  width: 100%;
}

.main_div_container legend {
  font-size: 16px;
  font-weight: bold;
  padding: 0 12px;
  color: var(--brand-green);
  background-color: #fff;
  border-radius: 4px;
}

.main_div_container label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.main_div_container input[type="text"],
.main_div_container input[type="email"],
.main_div_container input[type="password"],
.main_div_container input[type="number"],
.main_div_container input[type="url"],
.main_div_container input[type="date"],
.main_div_container input[type="time"],
.main_div_container input[type="search"],
.main_div_container input[type="tel"],
.main_div_container input[type="file"],
.main_div_container textarea,
.main_div_container select {
  width: 100%;
  padding: 12px;
  margin: 5px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  background-color: #fff;
  transition: all 0.2s ease;
}

.main_div_container input:focus,
.main_div_container textarea:focus,
.main_div_container select:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(0, 122, 61, 0.15);
}

.main_div_container select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23333" d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 1em;
  padding-left: 35px;
}

/* =========================================
   7. BUTTONS
   ========================================= */
.main_div_container input[type="submit"],
.main_div_container input[type="button"],
.main_div_container button {
  background-color: var(--brand-green);
  color: #fff;
  border: none;
  padding: 14px 24px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: block;
  min-width: 150px;
  width: 100%;
  max-width: 400px;
  margin: 15px auto;
  text-align: center;
  font-family: inherit;
  box-shadow: 0 4px 6px rgba(0, 122, 61, 0.2);
}

.main_div_container input[type="submit"]:hover,
.main_div_container button:hover {
  background-color: var(--brand-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 10px rgba(0, 122, 61, 0.3);
}

.general_table_classs tfoot button, 
.general_table_classs tfoot input[type="submit"],
#submit_insert_aa_vendors {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* =========================================
   8. RESPONSIVE MEDIA QUERIES (Mobile Enhancements)
   ========================================= */
@media (max-width: 768px) {
  
  .main_div_container {
    padding: 20px 15px;
    width: 96%;
    margin: 20px auto;
  }

  /* --- تحسينات الجداول (Card View) --- */
  .general_table_classs,
  .general_table_classs tbody,
  .general_table_classs tr,
  .general_table_classs td {
    display: block;
    width: 100%;
  }

  .general_table_classs thead { display: none; }

  /* تنسيق جديد للعنوان (Caption) في الموبايل ليغطي العرض كاملاً */
  .general_table_classs caption {
    display: block;
    width: 100%;
    margin-bottom: 15px;
    box-sizing: border-box;
  }

  .general_table_classs tr {
    margin-bottom: 20px; /* زيادة المسافة بين البطاقات */
    border: 1px solid #eee;
    border-radius: 10px; /* زوايا أكثر استدارة */
    /* إضافة حدود علوية ملونة لتمييز البطاقة */
    border-top: 4px solid var(--brand-green); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* ظل أوضح للبطاقة */
    background: #fff;
    overflow: hidden;
  }

  .general_table_classs td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 15px; /* زيادة الحشو لسهولة اللمس */
    padding-right: 45%; 
    position: relative;
    border: none;
    border-bottom: 1px dashed #eee; /* خط متقطع خفيف للفصل بين الحقول */
    min-height: 50px;
  }
  
  .general_table_classs td:last-child {
    border-bottom: none;
  }

  .general_table_classs td::before {
    content: attr(data-label);
    position: absolute;
    right: 15px;
    font-weight: 700;
    color: var(--brand-green-dark); /* لون أغمق للنص */
    text-align: right;
    width: 40%;
    font-size: 0.95em;
  }

  /* --- Footer Fix Mobile --- */
  .general_table_classs tfoot,
  .general_table_classs tfoot tr,
  .general_table_classs tfoot td {
      display: block;
      width: 100%;
      border: none;
  }
  
  .general_table_classs tfoot td {
      padding: 20px 15px !important;
      text-align: center;
      background-color: #f9f9f9;
  }

  .general_table_classs tfoot td::before { display: none; }

  /* --- Div Tables Mobile (Card View) --- */
  .div_table_row_header { display: none; }

  .div_table_row {
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    margin-bottom: 20px;
    border-radius: 10px;
    /* إضافة حدود علوية ملونة لتمييز البطاقة */
    border-top: 4px solid var(--brand-green);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    background-color: #fff;
    overflow: hidden;
  }

  .div_table_cell_label {
    width: 100%;
    border-left: none;
    border-bottom: 1px solid #f0f0f0;
    /* خلفية خضراء فاتحة جداً للعنوان في الموبايل */
    background-color: #f4fdf7; 
    padding: 12px 15px;
    color: var(--brand-green-dark);
    font-size: 15px;
  }

  .div_table_cell {
    width: 100%;
    padding: 20px 15px; /* مساحة أكبر للمحتوى */
    justify-content: flex-start;
  }
  
  /* Buttons Mobile */
  .main_div_container input[type="submit"],
  .main_div_container button,
  #submit_insert_aa_vendors {
    max-width: 100%;
    width: 100% !important;
    margin-top: 10px;
  }
}