/* ===== Base Styles ===== */
:root {
    --primary-color: #1a4b8c;
    --secondary-color: #2a75d8;
    --accent-color: #f8d64e;
    --text-dark: #2d3748;
    --text-light: #f8fafc;
    --bg-light: #f5f7fa;
    --border-color: #e2e8f0;
    --success-color: #28a745;
    --danger-color: #dc3545;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  /* ===== Header Styles ===== */
  .program-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 0;
    position: relative;
    border-bottom: 4px solid var(--accent-color);
  }
  
  .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
  }
  
  .logo-right, .logo-left {
    height: 70px;
    object-fit: contain;
    transition: transform 0.3s ease;
  }
  
  .title-container {
    flex-grow: 1;
    text-align: center;
    padding: 0 1rem;
  }
  
  .program-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
  }
  
  /* ===== Card Styles (for login/registration) ===== */
  .card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
  }
  
  .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
  }
  
  .card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
  }
  
  .card-body {
    padding: 2rem;
  }
  
  /* ===== Form Styles ===== */
  .form-group {
    margin-bottom: 1.5rem;
  }
  
  .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
  }
  
  .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
  }
  
  .form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(42, 117, 216, 0.2);
    outline: none;
  }
  
  .btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
  }
  
  .btn:hover {
    background: linear-gradient(135deg, #3a828b 0%, #2264c2 100%);
  }
  
  .error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
  }
  
  /* ===== Dashboard Specific Styles ===== */
  .topbar {
    background-color: #e0f7fa;
    color: #004d40;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #b2ebf2;
    font-weight: bold;
  }
  
  .topbar a {
    margin-left: 15px;
    text-decoration: none;
    color: #00695c;
    font-weight: bold;
    transition: color 0.3s;
  }
  
  .topbar a:hover {
    color: #004d40;
  }
  
  .form-div {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem auto;
    max-width: 1200px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  }
  
  .form-group1 input,
.form-group1 select {
  display: block;
  width: 100%;
  height: 2.375rem;
  padding: 0.375rem 0.75rem;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  font-size: 1rem;
}
/* Updated Form Container for 4 Select Inputs */
.form-div1 {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem auto;
    width: 90%; /* Takes 90% of page width */
    max-width: 1200px; /* Maximum width */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  }
  
  /* Form Row Layout */
  .form-row1 {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Space between inputs */
    justify-content: space-between;
  }
  
  /* Form Group for Select Inputs */
  .form-group1 {
    flex: 1;
    min-width: 200px; /* Minimum width for each select */
  }
  
  /* Select Input Styling */
  .form-control1 {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
    background-color: #f8fafc;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232d3748' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 16px;
    padding-right: 15px;
    padding-left: 40px;
  }
  
  /* Responsive Adjustments */
  @media (max-width: 992px) {
    .form-group1 {
      min-width: 180px;
    }
  }
  
  @media (max-width: 768px) {
    .form-row1 {
      flex-direction: column;
      gap: 15px;
    }
    
    .form-group1 {
      width: 100%;
      min-width: 100%;
    }
    
    .form-div1 {
      width: 95%;
      padding: 1rem;
    }
  }
.form-group1 input:focus,
.form-group1 select:focus {
  border-color: #4FC3A1;
  outline: none; }
  
  .counters {
    display: flex;
    gap: 20px;
    margin: 1rem 0;
  }
  
  /* ===== Table Styles ===== */
  table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
  }
  
  th, td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: center;
  }
  
  th {
    background: #f0f0f0;
  }
  
  .save-btn {
    padding: 5px 10px;
    background: var(--success-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .save-btn:disabled {
    background: #aaa;
    cursor: default;
  }
  
  /* ===== Page Specific Overrides ===== */
  
  /* Login Page */
  body.login-page {
    background: linear-gradient(rgba(255,255,255,0.95), rgba(255,255,255,0.95)), 
                url('assets/login-bg-pattern.png') center/cover;
    justify-content: center;
  }
  
  body.login-page .program-header {
    background: transparent;
    box-shadow: none;
    border-bottom: none;
  }
  
  /* Registration Page */
  body.registration-page {
    justify-content: center;
    background: var(--bg-light);
  }
  
  body.registration-page .container {
    max-width: 600px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  }
  
  /* ===== Responsive Design ===== */
  @media (max-width: 768px) {
    .header-content {
      flex-direction: column;
      padding: 0 1rem;
    }
    
    .logo-right, .logo-left {
      height: 60px;
      margin: 0.5rem 0;
    }
    
    .program-title {
      font-size: 1.3rem;
    }
    
    .card-body {
      padding: 1.5rem;
    }
  }
  /* Style for the students table */
#studentsTableContainer table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: 'Tajawal', sans-serif;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  }
  
  #studentsTableContainer th {
    background-color: #004d40;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 700;
  }
  
  #studentsTableContainer td {
    padding: 10px 8px;
    border-bottom: 1px solid #ddd;
    text-align: center;
    vertical-align: middle;
  }
  
  #studentsTableContainer tr:nth-child(even) {
    background-color: #f2f2f2;
  }
  
  #studentsTableContainer tr:hover {
    background-color: #e0f7fa;
  }
  
  /* Remove arrows from number inputs */
  #studentsTableContainer input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    margin: 0;
    text-align: center;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  
  #studentsTableContainer input[type="number"]::-webkit-outer-spin-button,
  #studentsTableContainer input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  
  /* Style for the save button */
  #studentsTableContainer .save-btn {
    background-color: #004d40;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  #studentsTableContainer .save-btn:hover {
    background-color: #00695c;
  }
  
  #studentsTableContainer .save-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
  }
  
  /* Style for radio buttons */
  #studentsTableContainer input[type="radio"] {
    margin: 0 5px;
  }
  
  /* Responsive adjustments */
  @media (max-width: 768px) {
    #studentsTableContainer table {
      font-size: 14px;
    }
    
    #studentsTableContainer th, 
    #studentsTableContainer td {
      padding: 8px 5px;
    }
  }