/* Basic Tailwind CSS - compiled version */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* SweetAlert2 for modern alerts */
@import url('https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css');

/* Additional custom styles */
.table-responsive {
    overflow-x: auto;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
}

.alert-success {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

/* Mobile: fix tap highlight causing white overlay on anchors/buttons */
@media (hover: none) and (pointer: coarse) {
  a, button, [role="button"], .btn-primary, .btn-secondary {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-tap-highlight-color: transparent;
  }
}

/* iOS Safari: reduce white flash on clickable elements with rounded corners */
a, button, [role="button"] {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Ensure anchors inside flex containers don't stretch and cause full-width white blocks on mobile */
.group a {
  display: inline-flex;
}

/* Disable hover-only color swaps on mobile to prevent full-white anchors when tapped */
@media (hover: none) and (pointer: coarse) {
  a:hover {
    background-color: unset !important;
    color: unset !important;
  }
  .btn-primary:hover,
  .btn-secondary:hover {
    filter: none !important;
    background-color: inherit !important;
    color: inherit !important;
  }
}

/* Mobile tap highlight & hover neutralization already present above */

/* Mobile active state: prevent pure white flash on elements with bg-white */
@media (hover: none) and (pointer: coarse) {
  .bg-white:active {
    background-color: #f8fafc !important; /* Tailwind gray-50 */
  }
  /* Avoid bright white flash on links/buttons when pressed */
  a:active,
  button:active,
  [role="button"]:active {
    background-color: transparent; /* keep original gradient/parent bg */
    filter: brightness(0.98);
  }
}

/* Mobile coarse pointer: soften pure-white gradients to avoid flash */
@media (hover: none) and (pointer: coarse) {
  .to-white { --tw-gradient-to: rgb(248 250 252 / 1) !important; }
  .from-white { --tw-gradient-from: rgb(248 250 252 / 1) !important; }
  .via-white { --tw-gradient-via: rgb(248 250 252 / 1) !important; }
  /* Also reduce hover effect on white backgrounds */
  .bg-white:hover { background-color: #f8fafc !important; }
}

/* Match your observed breakpoint: under 1107px width, reduce white intensity */
@media (max-width: 1107px) {
  .bg-white { background-color: #f8fafc !important; }
  .to-white { --tw-gradient-to: rgb(248 250 252 / 1) !important; }
  .from-white { --tw-gradient-from: rgb(248 250 252 / 1) !important; }
  .via-white { --tw-gradient-via: rgb(248 250 252 / 1) !important; }
  /* Neutralize hover-based white on narrow screens */
  .hover\:bg-white:hover { background-color: transparent !important; }
}