/* ============================================
   CertiTrack - Base CSS Loader
   Master file that imports all component styles
   ============================================ */

/* === Import Order (Important!) === */
@import url('theme.css');       /* 1. Theme variables first */
@import url('layout.css');      /* 2. Layout structure */
@import url('topbar.css');      /* 3. Navigation components */
@import url('forms.css');       /* 4. Form components */
@import url('animations.css');  /* 5. Animations last */

/* === Custom Utilities (Add here if needed) === */

/* Toast/Alert Component */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;

  box-shadow: var(--shadow-xl);
  z-index: 9999;

  display: flex;
  align-items: center;
  gap: 12px;

  min-width: 300px;
  max-width: 400px;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-error {
  border-left: 4px solid var(--danger);
}

.toast.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast.toast-info {
  border-left: 4px solid var(--info);
}

.toast-icon {
  font-size: 20px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 14px;
  color: var(--muted);
}

.toast-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
}

.toast-close:hover {
  color: var(--text);
}

/* === Modal/Dialog Component === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal,
.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);

  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;

  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3,
.modal-header h4,
.modal-header .modal-title {
  flex: 1;
  margin: 0;
  font-weight: 800;
  font-size: 18px;
}

.modal-title {
  font-weight: 800;
  font-size: 18px;
}

.modal-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 24px;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);

  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* === Badge Component === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 4px 10px;
  border-radius: var(--radius-full);

  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.badge-primary {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.badge-muted {
  background: var(--card-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge-info {
  background: rgba(96, 165, 250, 0.2);
  color: #60a5fa;
  border: 1px solid #60a5fa;
}

.badge-secondary {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 1px solid #94a3b8;
}

/* === Data Table === */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--card-2);
  border-bottom: 2px solid var(--border);
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.data-table tbody tr {
  transition: background-color 0.2s;
}

.data-table tbody tr:hover {
  background: var(--card-2);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* === Divider === */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background: var(--border);
}

/* === Link Styles === */
a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* === Image Utilities === */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-rounded {
  border-radius: var(--radius-md);
}

.img-circle {
  border-radius: var(--radius-full);
}

/* === Hidden Utilities === */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* === Print Styles === */
@media print {
  .topbar,
  .sidebar,
  .footer,
  .btn,
  .no-print {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }
}
