/* ==========================================================================
   HR Admin MIS - UI Components (Lilac & Magenta Theme)
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  border-color: transparent;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--text-heading);
}

.btn-secondary:hover {
  background: rgba(37, 99, 235, 0.16);
  color: var(--primary-dark);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.45);
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--text-heading);
}

.btn-outline:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-dark);
}

.btn-danger {
  background: rgba(225, 29, 72, 0.12);
  border-color: rgba(225, 29, 72, 0.35);
  color: #be123c;
}

.btn-danger:hover {
  background: rgba(225, 29, 72, 0.22);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 0.95rem;
  border-radius: var(--radius-lg);
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label .required {
  color: var(--danger);
  margin-left: 0.2rem;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-heading);
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* File Dropzone */
.file-dropzone {
  border: 2px dashed rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.03);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.attached-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.file-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  color: var(--text-heading);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(30, 58, 138, 0.04);
}

/* Stat Metrics Grid (Dashboard) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.metric-icon-box {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.1;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 700;
  margin-top: 0.2rem;
}

.metric-subtext {
  font-size: 0.7rem;
  color: var(--phase-completion);
  margin-top: 0.35rem;
  font-weight: 700;
}

/* Tables */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.table-toolbar {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(37, 99, 235, 0.02);
}

.table-toolbar div {
  color: var(--text-heading);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(37, 99, 235, 0.06);
  padding: 0.85rem 1.25rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-heading);
  font-weight: 800;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 1rem 1.25rem;
  font-size: 0.84rem;
  color: var(--text-heading);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-blue { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; border: 1px solid rgba(37, 99, 235, 0.3); }
.badge-green { background: rgba(5, 150, 105, 0.12); color: #047857; border: 1px solid rgba(5, 150, 105, 0.3); }
.badge-purple { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; border: 1px solid rgba(37, 99, 235, 0.28); }
.badge-amber { background: rgba(217, 119, 6, 0.12); color: #b45309; border: 1px solid rgba(217, 119, 6, 0.3); }
.badge-cyan { background: rgba(2, 132, 199, 0.12); color: #0369a1; border: 1px solid rgba(2, 132, 199, 0.3); }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: 1.5rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #ffffff;
  border: 1.5px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: all var(--transition-smooth);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.75rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
}

.modal-close-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  color: var(--text-heading);
}

.modal-body {
  padding: 1.5rem 1.75rem;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  color: var(--text-heading);
  font-size: 0.85rem;
  font-weight: 700;
  pointer-events: auto;
  transform: translateX(100%);
  opacity: 0;
  transition: all var(--transition-smooth);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success { border-left: 5px solid var(--success); }
.toast-info { border-left: 5px solid var(--primary); }
.toast-warning { border-left: 5px solid var(--warning); }
.toast-danger { border-left: 5px solid var(--danger); }
