/**
 * Zuwad Plugin - Main Styles
 *
 * This file contains general styles used throughout the Zuwad plugin
 * including global styles, tables, buttons, and layout components.
 */

/* =====================
   Font Declarations
   ===================== */

/* Qatar Regular */
@font-face {
    font-family: 'Qatar';
    src: url('../../fonts/Qatar.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Qatar Medium */
@font-face {
    font-family: 'Qatar';
    src: url('../../fonts/Qatar-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Qatar Bold */
@font-face {
    font-family: 'Qatar';
    src: url('../../fonts/Qatar-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Legacy support for 'Qatar-medium' name used in existing CSS */
@font-face {
    font-family: 'Qatar-medium';
    src: url('../../fonts/Qatar-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* =====================
   Global Styles
   ===================== */
body {
    --primary-color: #8b0628;
    --second-color: #f7bf00;
}

button {
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

button:hover {
    background-color: var(--second-color);
}

/* Styling for the modal form */
#user_modal {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    max-width: 700px;
    margin: 0 auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 80%;
    animation: popup-animation 0.3s ease-out;
    overflow-y: auto; /* Make the form scrollable */
    max-height: 90vh; /* Limit height to 90% of the viewport height */
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 5px;
    font-weight: bold;
}

input, textarea {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}


select {
    background-color: #ffeaea;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

button {
    padding: 10px 20px;
    background-color: #8b0628;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #6a041a;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .form-column {
        flex: none;
        width: 100%;
    }
}







.teacher-heading {
    background-color: var(--primary-color);
    color : #ffffff;
    padding: 10px 20px;
    margin: 0px 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .teacher-title {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
  }

  .heading-buttons {
    display: flex;
    align-items: center;
    gap: 0;
  }

  .heading-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: 0;
  }

  .heading-btn:first-child {
    border-radius: 0 6px 6px 0;
  }

  .heading-btn:last-child {
    border-radius: 6px 0 0 6px;
  }

  .heading-btn:only-child {
    border-radius: 6px;
  }

  .heading-btn + .heading-btn {
    border-right: none;
  }

  .heading-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
  }

  .heading-btn:active {
    background-color: rgba(255, 255, 255, 0.15);
  }

  /* Responsive design for teacher heading */
  @media (max-width: 768px) {
    .teacher-heading {
      flex-direction: column;
      align-items: stretch;
      text-align: center;
      padding: 15px;
    }

    .teacher-title {
      margin-bottom: 10px;
      text-align: center;
    }

    .heading-buttons {
      justify-content: center;
    }

    .heading-btn {
      font-size: 13px;
      padding: 6px 10px;
    }
  }

  @media (max-width: 480px) {
    .heading-btn {
      font-size: 12px;
      padding: 5px 8px;
    }
  }

  /* =============================================
     UNIFIED USER MODAL STYLES
     ============================================= */

  /* Modal Styles */
  #unified_user_modal {
    max-width: 1000px;
  }

  .unified-form-container {
    padding: 30px;
  }

  .form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
  }

  .form-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
  }

  .form-header .close-modal {
    color: #666;
    transition: color 0.2s ease;
    line-height: 1;
  }

  .form-header .close-modal:hover {
    color: #333;
  }

  .role-selection-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
  }

  .role-selection-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
  }

  .role-selection-section select {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
  }

  .role-selection-section select:focus {
    outline: none;
    border-color: #da9c00ff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
  }

  .form-row {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
  }

  .form-column {
    flex: 1;
    min-width: 280px;
  }

  .form-column.left-column {
    border-right: 1px solid #eee;
    padding-right: 30px;
  }

  .form-column.right-column {
    padding-left: 30px;
  }

  /* Column headers for desktop */
  .form-column::before {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, #ffbe16, transparent);
    margin-bottom: 20px;
    border-radius: 1px;
  }

  .form-column.left-column::after {
    content: 'معلومات أساسية';
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
  }

  .form-column.right-column::after {
    content: 'معلومات إضافية';
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
  }

  .form-column label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
  }

  .form-column input[type="text"],
  .form-column input[type="email"],
  .form-column input[type="password"],
  .form-column input[type="number"],
  .form-column input[type="date"],
  .form-column select,
  .form-column textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    margin-bottom: 16px;
  }

  .form-column input:focus,
  .form-column select:focus,
  .form-column textarea:focus {
    outline: none;
    border-color: #da9c00ff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
  }

  .form-column textarea {
    resize: vertical;
    min-height: 80px;
  }

  .role-fields {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
  }

  .form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
  }

  .form-actions .button {
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .form-actions .button-primary {
    background: #da9c00ff;
    color: white;
  }

  .form-actions .button-primary:hover {
    background: #828700;
  }

  .form-actions .button-secondary {
    background: #f0f0f0;
    color: #333;
  }

  .form-actions .button-secondary:hover {
    background: #e0e0e0;
  }

  /* Multi-select styles */
  .multi-select-container {
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 16px;
  }

  .multi-select-option {
    margin-bottom: 8px;
  }

  .multi-select-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
  }

  .multi-select-option input[type="checkbox"] {
    margin-left: 8px;
    margin-right: 8px;
  }

  .option-label {
    flex: 1;
  }

  .checkmark {
    color: #da9c00ff;
    font-weight: bold;
  }

  /* Modal responsive styles */
  @media (max-width: 1024px) {
    #unified_user_modal {
      max-width: 90%;
      width: 90%;
    }

    .form-column.left-column {
      border-right: none;
      padding-right: 0;
    }

    .form-column.right-column {
      padding-left: 0;
      padding-top: 20px;
      border-top: 1px solid #eee;
    }

    .form-column::before {
      display: none;
    }

    .form-column.left-column::after,
    .form-column.right-column::after {
      display: none;
    }
  }

  @media (max-width: 768px) {
    #unified_user_modal {
      width: 95%;
      max-width: 95%;
      max-height: 95vh;
    }

    .unified-form-container {
      padding: 20px;
    }

    .form-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
    }

    .form-header h3 {
      font-size: 20px;
    }

    .form-row {
      flex-direction: column;
      gap: 0;
    }

    .form-column {
      min-width: auto;
    }

    .form-column.left-column {
      border-right: none;
      padding-right: 0;
    }

    .form-column.right-column {
      padding-left: 0;
      padding-top: 0;
      border-top: none;
    }

    .form-actions {
      flex-direction: column;
    }

    .form-actions .button {
      width: 100%;
      text-align: center;
    }

    .role-selection-section {
      padding: 15px;
    }

    .role-selection-section select {
      max-width: 100%;
    }
  }

  /* Loading and validation states */
  .form-column input:invalid,
  .form-column select:invalid {
    border-color: #dc3545;
  }

  .form-column small {
    color: #666;
    font-size: 12px;
    margin-top: -8px;
    margin-bottom: 12px;
    display: block;
  }
  



  .multi-select-container {
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
}
.multi-select-option {
    margin-bottom: 5px;
}
.multi-select-option:last-child {
    margin-bottom: 0;
}