body {
  font-family: "Cairo", sans-serif;
}

.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 30px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h2 {
  color: #2c3e50;
  font-weight: 700;
}

.form-control:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.btn-primary {
  background-color: #2c3e50;
  border-color: #2c3e50;
}

.btn-primary:hover {
  background-color: #34495e;
  border-color: #34495e;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tables - Horizontal scroll on mobile */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Make tables more compact on mobile */
@media (max-width: 768px) {
  /* Container padding */
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Cards */
  .card {
    margin-bottom: 15px;
  }
  
  .card-body {
    padding: 15px;
  }
  
  /* Tables */
  .table td, .table th {
    padding: 8px 6px;
    font-size: 0.85rem;
  }
  
  /* Form controls */
  .form-control, .form-select {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 10px 12px;
  }
  
  /* Buttons */
  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  
  .btn-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  /* Headers */
  h1, .h1 { font-size: 1.5rem; }
  h2, .h2 { font-size: 1.3rem; }
  h3, .h3 { font-size: 1.15rem; }
  h4, .h4 { font-size: 1rem; }
  
  /* Page title flex */
  .d-flex.justify-content-between {
    flex-direction: column;
    gap: 10px;
    align-items: stretch !important;
  }
  
  .d-flex.justify-content-between .btn {
    width: 100%;
    text-align: center;
  }
  
  /* Login container */
  .login-container {
    margin: 30px 15px;
    padding: 20px;
  }
  
  /* Stats cards */
  .stats-card {
    margin-bottom: 10px;
  }
  
  /* Action buttons in table */
  .btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  
  /* Forms in modals */
  .modal-body {
    padding: 15px;
  }
  
  /* Navbar */
  .navbar-brand {
    font-size: 1rem;
  }
  
  .navbar-nav .nav-link {
    padding: 10px 15px;
  }
  
  /* Attendance table specifically */
  .attendance-table input[type="number"] {
    width: 60px;
    min-width: 60px;
  }
  
  .attendance-table select {
    min-width: 80px;
  }
  
  .attendance-table textarea {
    min-width: 100px;
  }
  
  /* Dashboard stats */
  .row > [class*="col-"] {
    margin-bottom: 15px;
  }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 576px) {
  /* Even more compact */
  .table td, .table th {
    padding: 6px 4px;
    font-size: 0.75rem;
  }
  
  .btn-sm {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
  
  /* Stack action buttons */
  td .d-inline, td form.d-inline {
    display: block !important;
    margin-bottom: 4px;
  }
  
  td .d-inline:last-child {
    margin-bottom: 0;
  }
  
  /* Login */
  .login-container {
    margin: 20px 10px;
    border-radius: 10px;
  }
  
  /* Forms */
  .row.mb-3 {
    margin-bottom: 10px !important;
  }
  
  label.form-label {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }
}

/* Touch-friendly improvements */
@media (pointer: coarse) {
  /* Larger touch targets */
  .btn, .nav-link, .form-check-input {
    min-height: 44px;
    min-width: 44px;
  }
  
  .form-check-input {
    width: 1.25em;
    height: 1.25em;
  }
  
  .form-check-label {
    padding-right: 8px;
  }
  
  /* Table row touch */
  .table tbody tr {
    cursor: pointer;
  }
  
  .table tbody tr:active {
    background-color: rgba(0, 0, 0, 0.05);
  }
}

/* Print styles */
@media print {
  .navbar, .btn, form, .no-print {
    display: none !important;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  .table {
    font-size: 10pt;
  }
}

/* Fix for iOS input zoom */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-size: 16px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better focus states for accessibility */
*:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* Card hover effect */
.card {
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
