/* ======================================================
   ADMIN DASHBOARD - GLASS THEME
   ====================================================== */

/* --- Nav Tabs --- */
.nav-tabs {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-tabs .nav-link {
  color: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 0.5rem 0.5rem 0 0;
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tabs .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 2px solid var(--accent-1);
  font-weight: 600;
}

/* --- Tables (Fix White Background) --- */
.table, .table > :not(caption) > * > * {
  background-color: transparent !important; /* Force transparent */
  color: var(--glass-text) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.table th {
  font-weight: 600;
  padding: 1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.table td {
  padding: 1rem;
  vertical-align: middle;
}

.table-hover tbody tr:hover > * {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

/* Ensure table inside glass-panel looks good */
.table-responsive {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Form Elements (Selects & Inputs) --- */
.glass-input, .form-control, .form-select {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff !important;
  border-radius: 0.6rem;
  backdrop-filter: blur(10px);
}

.glass-input:focus, .form-control:focus, .form-select:focus {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 0.25rem rgba(14, 165, 233, 0.25);
}

.form-select option {
  background-color: #1e293b; /* Dark slate */
  color: #fff;
}

/* --- Pagination --- */
.pagination .page-link {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0.25rem;
  border-radius: 0.5rem;
}

.pagination .page-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.pagination .page-item.active .page-link {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.05);
}

/* --- Agent Cards --- */
#agent-grid .glass-card {
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
}

#agent-grid .glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* --- Buttons --- */
.btn-glass {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.btn-glass:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
  color: #fff;
}

/* Specific buttons in Admin */
.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}
.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  color: #fff;
}

.btn-outline-danger {
  border-color: rgba(239, 68, 68, 0.5); /* Red-500 */
  color: #fca5a5; /* Red-300 */
}
.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fff;
}

/* --- Modals --- */
.modal-content.glass-panel {
  background: rgba(15, 23, 42, 0.9); /* Darker backdrop for modal */
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border-radius: 1.5rem;
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.btn-close-white {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Widen admin modals (modal-xl) */
@media (min-width: 1200px) {
  .modal-xl {
    max-width: 1400px !important; /* Make admin modals wider */
  }
}

/* Ensure tall modals scroll content within the body */
.modal-content.glass-panel { max-height: 90vh; display:flex; flex-direction:column; }
.modal-body { overflow-y:auto; }

/* --- Forms in Admin --- */
.agent-form, #create-user-form, #create-agent-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Chips/Badges fix */
.badge {
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: 0.5rem;
  padding: 0.5em 0.8em;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}



.glass-dropzone {
  padding: 30px;
  border: 2px dashed rgba(255,255,255,0.25);
  border-radius: 16px;
  text-align: center;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: 0.2s ease;
}

.glass-dropzone:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.5);
}

.glass-dropzone.dragover {
  background: rgba(255,255,255,0.18);
  border-color: #fff;
}

.selected-files { display:flex; flex-direction:column; gap:6px; }
.file-item { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:8px; background: rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.04); color: #fff; }
.file-item .file-name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-item .file-size { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.file-item .remove-file { color: rgba(255,255,255,0.6); cursor:pointer; }

/* Existing server-side media items show a slightly muted style */
.file-item.existing-media { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.03); color: rgba(255,255,255,0.8); }
.file-item.existing-media .file-size { color: rgba(255,255,255,0.5); }

/* Disease multi-select chip input */
.disease-chip-input { display:flex; flex-direction:column; gap:6px; }
.disease-chip-input .chip-list { display:flex; gap:6px; flex-wrap:wrap; }
.d-chip { display:inline-flex; align-items:center; padding:6px 8px; border-radius:999px; background: rgba(255,255,255,0.06); color:#fff; font-size:0.9rem; }
.d-chip .chip-remove { cursor:pointer; margin-left:8px; opacity:0.8; }
.disease-chip-input input[type="text"] { min-height:38px; padding: 8px 12px; }
.disease-chip-input input[type="text"]:focus { outline:none; box-shadow: 0 0 0 0.25rem rgba(14,165,233,0.12); }
