﻿/**
 * 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;
}

/* Preserve structured server error paragraphs in SweetAlert text messages. */
.swal2-html-container {
  white-space: pre-line;
}

/* 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 â€” redesigned per SUSPENDED-STUDENTS-DESIGN-SYSTEM.md */
#user_modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(94vw, 760px);
    max-height: 90vh;
    padding: 28px;
    border: 1px solid rgba(130, 12, 34, 0.16);
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 32px 80px rgba(23, 33, 43, 0.18);
    z-index: 1000;
    direction: rtl;
    animation: popup-animation 0.3s ease-out;
    overflow-y: auto;
}

#user_modal .form-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#user_modal .student-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -28px -28px 22px -28px;
    padding: 22px 56px 18px 28px;
    background: #820c22;
    border-radius: 28px 28px 0 0;
    border-bottom: none;
}

#user_modal .student-modal-header h3 {
    color: #ffffff;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    margin: 0;
}

#user_modal .close-modal {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    z-index: 2;
}

#user_modal .close-modal:hover {
    transform: rotate(90deg);
    background: #ffffff;
    color: #820c22;
}

#user_modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 22px;
}

#user_modal .form-column {
    display: flex;
    flex-direction: column;
}

#user_modal label {
    display: block;
    margin: 0 0 6px;
    color: #5d0f29;
    font-weight: 700;
    font-size: 14px;
}

#user_modal input,
#user_modal select,
#user_modal textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    margin-bottom: 12px;
    border: 1px solid #dce4ee;
    border-radius: 14px;
    font-size: 14px;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#user_modal input:focus,
#user_modal select:focus,
#user_modal textarea:focus {
    outline: none;
    border-color: #7cc5d1;
    box-shadow: 0 0 0 4px rgba(20, 150, 166, 0.14);
}

#user_modal input[type="file"] {
    padding: 10px;
}

#user_modal textarea {
    resize: vertical;
    min-height: 80px;
}

#user_modal .button,
#user_modal #update_teacher {
    width: 100%;
    min-height: 48px;
    margin-top: 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #820c22 0%, #9f1834 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(123, 23, 56, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#user_modal .button:hover,
#user_modal #update_teacher:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(123, 23, 56, 0.24);
}

#user_modal #teacher_classification_container,
#user_modal #lessons_name_container {
    margin-bottom: 12px;
}

/* Responsive Design â€” #user_modal */
@media screen and (max-width: 768px) {
    #user_modal {
        width: min(96vw, 760px);
        padding: 18px;
        border-radius: 22px;
        max-height: 94vh;
    }

    #user_modal .student-modal-header {
        margin: -18px -18px 16px -18px;
        padding: 18px 46px 14px 18px;
        border-radius: 22px 22px 0 0;
    }

    #user_modal .student-modal-header h3 {
        font-size: 22px;
    }

    #user_modal .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media screen and (max-width: 520px) {
    #user_modal {
        padding: 14px;
        border-radius: 18px;
    }

    #user_modal .close-modal {
        top: 10px;
        left: 10px;
        width: 38px;
        height: 38px;
        font-size: 24px;
    }

    #user_modal .student-modal-header {
        margin: -14px -14px 14px -14px;
        padding: 14px 42px 12px 14px;
        border-radius: 18px 18px 0 0;
    }

    #user_modal .student-modal-header h3 {
        font-size: 20px;
    }
}







.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;
    }
  }

  /* Supervisor home heading redesign */
  .teacher-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0;
    padding: 4px 0 2px;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    text-align: center;
  }

  .teacher-title {
    display: block;
    width: 100%;
    margin: 0;
    color: #ffffff;
    font-family: 'Qatar', Tahoma, sans-serif;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 2px 12px rgba(58, 7, 24, 0.28);
  }

  .heading-buttons {
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .heading-btn,
  .heading-btn:first-child,
  .heading-btn:last-child,
  .heading-btn:only-child {
    width: auto;
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 12px 26px;
    font-family: 'Qatar', Tahoma, sans-serif;
    font-size: 22px;
    font-weight: 800;
    white-space: nowrap;
    text-shadow: 0 2px 12px rgba(58, 7, 24, 0.28);
    box-shadow: none;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }

  .heading-btn + .heading-btn {
    border-right: 1px solid rgba(255, 255, 255, 0.18);
  }

  .heading-btn:hover {
    transform: translateY(-1px);
    border-color: #ffffff;
    background: #ffffff;
    color: #5d0f29;
    text-shadow: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  }

  .heading-buttons #open-report-modal {
    width: auto;
  }

  @media (max-width: 1100px) {
    .teacher-title {
      font-size: 28px;
    }
  }

  @media (max-width: 768px) {
    .teacher-heading {
      padding: 0;
    }

    .teacher-title {
      margin: 0;
      font-size: 24px;
    }

    .heading-buttons {
      width: 100%;
    }
  }

  @media (max-width: 480px) {
    .teacher-heading {
      gap: 10px;
    }

    .teacher-title {
      font-size: 20px;
    }

    .heading-buttons {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      overflow: visible;
      padding-bottom: 0;
    }

    .heading-btn,
    .heading-btn:first-child,
    .heading-btn:last-child,
    .heading-btn:only-child {
      width: 100%;
      justify-content: center;
      min-height: 44px;
      padding: 8px 6px;
      font-size: 14px;
      line-height: 1.3;
      white-space: normal;
      text-shadow: none;
    }

    .heading-buttons #open-report-modal {
      width: 100%;
    }

    .heading-buttons > :last-child:nth-child(odd) {
      grid-column: 1 / -1;
    }
  }

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

  /* Modal overlay + container â€” moved out of inline JS styles */
  #modal_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(23, 33, 43, 0.55);
    z-index: 999;
  }

  #unified_user_modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(94vw, 1000px);
    max-height: 90vh;
    padding: 0;
    border: 1px solid rgba(130, 12, 34, 0.16);
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 32px 80px rgba(23, 33, 43, 0.18);
    z-index: 1000;
    direction: rtl;
    overflow-y: auto;
  }

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

  .form-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: -28px -28px 22px -28px;
    padding: 22px 56px 18px 28px;
    background: #820c22;
    border-radius: 28px 28px 0 0;
    border-bottom: none;
  }

  .form-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  }

  .form-header .close-modal {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  }

  .form-header .close-modal:hover {
    transform: rotate(90deg);
    background: #ffffff;
    color: #820c22;
  }

  .role-placeholder {
    color: #66758a;
    text-align: center;
    padding: 40px 20px;
    margin: 0;
    font-size: 15px;
  }

  .role-selection-section {
    background: #f4f7fb;
    border: 1px solid #dce4ee;
    padding: 20px;
    border-radius: 14px;
    margin-bottom: 22px;
    text-align: center;
  }

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

  .role-selection-section select {
    width: 100%;
    max-width: 400px;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #dce4ee;
    border-radius: 14px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
  }

  .role-selection-section select:focus {
    outline: none;
    border-color: #7cc5d1;
    box-shadow: 0 0 0 4px rgba(20, 150, 166, 0.14);
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 22px;
    margin-bottom: 0;
  }

  .form-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  /* Legacy left/right column decorations removed (no border, no ::before/::after) */
  .form-column.left-column,
  .form-column.right-column {
    border: none;
    padding: 0;
  }

  .form-column label {
    display: block;
    margin: 0 0 6px;
    font-weight: 700;
    color: #5d0f29;
    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%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #dce4ee;
    border-radius: 14px;
    font-size: 14px;
    background: #ffffff;
    box-sizing: border-box;
    margin-bottom: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .form-column input[type="file"] {
    padding: 10px;
    min-height: 46px;
  }

  .phone-input-wrap {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
  }
  .phone-input-wrap input {
    flex: 1;
    margin-bottom: 0;
  }

  .form-column-full {
    grid-column: 1 / -1;
  }

  .form-column input:focus,
  .form-column select:focus,
  .form-column textarea:focus {
    outline: none;
    border-color: #7cc5d1;
    box-shadow: 0 0 0 4px rgba(20, 150, 166, 0.14);
  }

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

  .form-column small {
    color: #66758a;
    font-size: 12px;
    margin-top: -6px;
    margin-bottom: 12px;
    display: block;
    font-weight: normal;
  }

  .role-fields {
    background: #f4f7fb;
    border: 1px solid #dce4ee;
    padding: 18px;
    border-radius: 14px;
    margin-top: 18px;
  }

  .form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(130, 12, 34, 0.12);
  }

  .form-actions .button {
    min-height: 46px;
    padding: 10px 24px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  }

  .form-actions .button-primary {
    background: linear-gradient(135deg, #820c22 0%, #9f1834 100%);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(123, 23, 56, 0.2);
  }

  .form-actions .button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(123, 23, 56, 0.24);
  }

  .form-actions .button-secondary {
    background: #eef3f8;
    color: #17212b;
    border: 1px solid #dce4ee;
  }

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

  /* Multi-select styles */
  .multi-select-container {
    background: #ffffff;
    border: 1px solid #dce4ee;
    border-radius: 16px;
    padding: 8px;
    margin-bottom: 12px;
    max-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

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

  .multi-select-option:last-child {
    margin-bottom: 0;
  }

  .multi-select-option label {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    color: #17212b;
    transition: background-color 0.2s ease, border-color 0.2s ease;
  }

  .multi-select-option label:hover {
    background: #f7fafc;
    border-color: #dce4ee;
  }

  #user_modal .multi-select-option input[type="checkbox"],
  #unified_user_modal .multi-select-option input[type="checkbox"],
  .multi-select-option input[type="checkbox"] {
    width: 18px !important;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    border-radius: 4px;
    box-shadow: none;
    flex: 0 0 auto;
    accent-color: #820c22;
  }

  .option-label {
    min-width: 0;
    flex: 1;
    line-height: 1.5;
    word-break: break-word;
  }

  .checkmark {
    min-width: 22px;
    text-align: center;
    color: #820c22;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
  }

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

  /* Modal responsive styles */
  @media (max-width: 1024px) {
    #unified_user_modal {
      width: min(96vw, 1000px);
    }
  }

  @media (max-width: 768px) {
    #unified_user_modal {
      width: min(96vw, 1000px);
      max-height: 95vh;
      border-radius: 22px;
    }

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

    .form-header {
      margin: -18px -18px 16px -18px;
      padding: 18px 46px 14px 18px;
      border-radius: 22px 22px 0 0;
    }

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

    .form-header .close-modal {
      top: 10px;
      left: 10px;
      width: 38px;
      height: 38px;
      font-size: 24px;
    }

    .form-row {
      grid-template-columns: 1fr;
      gap: 0;
    }

    .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%;
    }

    .multi-select-container {
      max-height: 240px;
      padding: 6px;
    }

    .multi-select-option label {
      min-height: 50px;
      padding: 10px;
      gap: 8px;
    }
  }

  @media (max-width: 520px) {
    #unified_user_modal {
      border-radius: 18px;
    }

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

    .form-header {
      margin: -14px -14px 14px -14px;
      padding: 14px 42px 12px 14px;
      border-radius: 18px 18px 0 0;
    }

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

    .multi-select-container {
      max-height: 260px;
    }

    .multi-select-option label {
      grid-template-columns: 20px minmax(0, 1fr) 20px;
      min-height: 48px;
      padding: 9px 10px;
    }

    #user_modal .multi-select-option input[type="checkbox"],
    #unified_user_modal .multi-select-option input[type="checkbox"],
    .multi-select-option input[type="checkbox"] {
      width: 16px !important;
      min-width: 16px;
      height: 16px;
      min-height: 16px;
    }
  }
}
#unified_user_modal .hiring-panel {
    padding: 18px;
    margin-block: 16px;
    border: 1px solid #dce3ed;
    border-radius: 14px;
    background: #f5f7fa;
}

#unified_user_modal .hiring-panel label {
    display: block;
    margin-block-end: 8px;
}

#unified_user_modal .hiring-panel input,
#unified_user_modal .hiring-panel select,
#unified_user_modal .hiring-panel textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font: inherit;
}

#unified_user_modal #hiring_start_fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-block-start: 16px;
}

#unified_user_modal #hiring_start_fields > label,
#unified_user_modal #hiring_feedback,
#unified_user_modal #hiring_override {
    grid-column: 1 / -1;
}

#unified_user_modal #hiring_feedback {
    margin: 0;
    line-height: 1.8;
    color: #25344a;
    overflow-wrap: anywhere;
}

#unified_user_modal #hiring_start_fields[hidden],
#unified_user_modal #hiring_override[hidden] {
    display: none;
}
