/* ****************************************************
 IMTA Admissions Manager - Frontend Styles
 Put this file at: /assets/imta-frontend.css
 Scope: only inside .imta wrapper
***************************************************** */

:where(.imta) {
  --imta-bg: #ffffff;
  --imta-surface: #ffffff;
  --imta-text: #0f172a;
  --imta-muted: #475569;
  --imta-border: rgba(15, 23, 42, 0.12);
  --imta-ring: rgba(59, 130, 246, 0.35);
  --imta-shadow: 0 10px 30px rgba(2, 6, 23, 0.10);
  --imta-radius: 18px;
  --imta-radius-sm: 12px;

  --imta-primary: #2563eb;
  --imta-primary-2: #7c3aed;

  --imta-success: #16a34a;
  --imta-danger: #dc2626;

  color: var(--imta-text);
  font: inherit;
}

@media (prefers-color-scheme: dark) {
  :where(.imta) {
    --imta-bg: #0b1220;
    --imta-surface: #0f172a;
    --imta-text: #e5e7eb;
    --imta-muted: #a1a1aa;
    --imta-border: rgba(226, 232, 240, 0.16);
    --imta-ring: rgba(96, 165, 250, 0.40);
    --imta-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  }
}

/* Layout container */
:where(.imta .imta-container) {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
}

/* Card */
:where(.imta .imta-card) {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.96));
  border: 1px solid var(--imta-border);
  border-radius: var(--imta-radius);
  box-shadow: var(--imta-shadow);
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  :where(.imta .imta-card) {
    background: linear-gradient(180deg, rgba(15,23,42,0.98), rgba(15,23,42,0.92));
  }
}

:where(.imta .imta-card__header) {
  padding: 18px 18px 10px 18px;
  border-bottom: 1px solid var(--imta-border);
}

:where(.imta .imta-card__title) {
  margin: 0;
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

:where(.imta .imta-card__subtitle) {
  margin: 6px 0 0 0;
  color: var(--imta-muted);
  font-size: 14px;
  line-height: 1.4;
}

:where(.imta .imta-card__body) {
  padding: 18px;
}

/* Form */
:where(.imta .imta-form) {
  display: grid;
  gap: 14px;
}

:where(.imta .imta-field) {
  display: grid;
  gap: 8px;
}

:where(.imta .imta-label) {
  font-weight: 700;
  font-size: 14px;
  color: var(--imta-text);
}

:where(.imta .imta-control) {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--imta-radius-sm);
  border: 1px solid var(--imta-border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--imta-text);
  outline: none;
  box-sizing: border-box;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

@media (prefers-color-scheme: dark) {
  :where(.imta .imta-control) {
    background: rgba(2, 6, 23, 0.25);
  }
}

:where(.imta .imta-control:focus) {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 4px var(--imta-ring);
  transform: translateY(-1px);
}

:where(.imta .imta-actions) {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 4px;
}
.imta-card__body button {
    color: #fff !important;
}
/* Button */
:where(.imta .imta-btn) {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff !important;
  background: linear-gradient(135deg, var(--imta-primary), var(--imta-primary-2));
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  user-select: none;
}

:where(.imta .imta-btn:hover) {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

:where(.imta .imta-btn:active) {
  transform: translateY(0px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.22);
}

:where(.imta .imta-btn:focus-visible) {
  outline: none;
  box-shadow: 0 0 0 4px var(--imta-ring), 0 10px 25px rgba(37, 99, 235, 0.22);
}

@media (max-width: 520px) {
  :where(.imta .imta-actions) {
    justify-content: stretch;
  }
  :where(.imta .imta-btn) {
    width: 100%;
    text-align: center;
  }
}

/* Alerts */
:where(.imta .imta-alert) {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--imta-radius);
  border: 1px solid var(--imta-border);
  background: rgba(148, 163, 184, 0.12);
  color: var(--imta-text);
}

:where(.imta .imta-alert p) {
  margin: 0;
  line-height: 1.5;
}

:where(.imta .imta-alert--error) {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.10);
}

:where(.imta .imta-alert--success) {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.10);
}

/* Result spacing */
:where(.imta .imta-stack) {
  display: grid;
  gap: 14px;
}

/* Table (desktop) */
:where(.imta .imta-table) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--imta-border);
  border-radius: var(--imta-radius);
}

:where(.imta .imta-table th),
:where(.imta .imta-table td) {
  padding: 12px 14px;
  border-bottom: 1px solid var(--imta-border);
  vertical-align: top;
}

:where(.imta .imta-table tr:last-child th),
:where(.imta .imta-table tr:last-child td) {
  border-bottom: 0;
}

:where(.imta .imta-table th) {
  width: 38%;
  font-weight: 800;
  color: var(--imta-text);
  background: rgba(148, 163, 184, 0.10);
}

:where(.imta .imta-table td) {
  color: var(--imta-text);
}

:where(.imta .imta-table tr:nth-child(even) td) {
  background: rgba(148, 163, 184, 0.06);
}

/* Mobile: turn each row into a small card */
@media (max-width: 640px) {
  :where(.imta .imta-table),
  :where(.imta .imta-table tbody),
  :where(.imta .imta-table tr) {
    display: block;
    width: 100%;
  }

  :where(.imta .imta-table) {
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  :where(.imta .imta-table tr) {
    margin: 0 0 12px 0;
    border: 1px solid var(--imta-border);
    border-radius: var(--imta-radius);
    background: rgba(148, 163, 184, 0.06);
    overflow: hidden;
  }

  :where(.imta .imta-table th),
  :where(.imta .imta-table td) {
    display: block;
    width: 100%;
    border-bottom: 0;
  }

  :where(.imta .imta-table th) {
    background: rgba(148, 163, 184, 0.12);
    padding-bottom: 8px;
  }

  :where(.imta .imta-table td) {
    padding-top: 0;
  }
}
.imta-table th:first-child {
  padding-left: 10px !important;
}
/* IMTA Admin Styles - Giao diện đẹp & hiện đại */

.imta-wrap h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #1d2327;
}

.imta-wrap .form-table th {
    width: 200px;
    font-weight: 600;
}

.imta-wrap .form-table input.regular-text,
.imta-wrap .form-table select,
.imta-wrap .form-table textarea {
    width: 100%;
    max-width: 400px;
}

.imta-wrap .form-table td {
    padding: 15px 10px;
}

/* Cải thiện bảng danh sách */
.imta-wrap table.widefat {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.imta-wrap table.widefat th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1d2327;
    text-align: left;
    padding: 12px 15px;
}

.imta-wrap table.widefat td {
    padding: 12px 15px;
    vertical-align: middle;
}

.imta-wrap table.widefat tr:nth-child(even) {
    background: #f9f9f9;
}

.imta-wrap table.widefat tr:hover {
    background: #f0f6fc;
}

/* Nút hành động trong bảng */
.imta-wrap .button-small {
    margin-right: 8px;
    padding: 4px 12px;
    font-size: 12px;
}

/* Phân trang đẹp hơn */
.imta-wrap .tablenav-pages {
    margin-top: 20px;
}

.imta-wrap .tablenav-pages a,
.imta-wrap .tablenav-pages .current {
    padding: 8px 14px !important;
    margin: 0 4px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

.imta-wrap .tablenav-pages .current {
    background: #2271b1;
    color: white;
    border: none;
}

/* Form lọc ở trang danh sách */
.imta-filter-bar {
    background: #fff;
    padding: 15px 20px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.imta-filter-bar label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    color: #1d2327;
}

.imta-filter-bar select,
.imta-filter-bar input[type="text"] {
    height: 36px;
    padding: 0 12px;
    border-radius: 4px;
}

/* Tổng số thí sinh */
.imta-total-count {
    font-size: 16px;
    font-weight: 600;
    color: #2271b1;
    margin: 20px 0;
}

/* Responsive cho mobile */
@media screen and (max-width: 782px) {
    .imta-filter-bar {
        padding: 15px;
    }
    
    .imta-filter-bar > div {
        margin-bottom: 15px;
    }
    
    .imta-wrap table.widefat thead {
        display: none;
    }
    
    .imta-wrap table.widefat tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        padding: 10px;
        background: #fff;
    }
    
    .imta-wrap table.widefat td {
        display: block;
        text-align: right;
        padding: 8px 10px;
        position: relative;
    }
    
    .imta-wrap table.widefat td:before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: #555;
    }
}