/* ============================================
   PAGINATION STYLES (Copied from exercise_systems)
   ============================================ */

.active-page a {
    background-color: #2563eb !important; /* blue-600 */
    color: white !important;
    border-color: #2563eb !important;
    pointer-events: none;
}

.disabled-page span, 
.disabled-page a {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f9fafb !important;
    pointer-events: none;
}

/* ============================================
   GLOBAL ERROR DISPLAY STYLES
   ============================================ */
.help-block {
    color: #ef4444; /* red-500 */
    font-size: 0.875rem; /* text-sm */
    margin-top: 0.25rem;
    font-style: italic;
    display: block;
}

.has-error .form-control {
    border-color: #ef4444 !important;
    background-color: #fef2f2; /* red-50 */
}

.has-error .help-block {
    color: #ef4444;
}

/* ============================================
   GRIDVIEW & YII DEFAULT STYLES (From site.css)
   ============================================ */
/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #b91c1c; /* red-700 */
    background: #fef2f2; /* red-50 */
    border-left: 3px solid #f87171; /* red-400 */
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* ============================================
   ADMIN PAGINATION - Dùng chung toàn hệ thống
   Dùng !important để đảm bảo không bị Tailwind CDN ghi đè
   ============================================ */
ul.admin-pagination,
.admin-pagination {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 1rem 0 0 !important;
}

ul.admin-pagination > li,
.admin-pagination > li {
    list-style: none !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

ul.admin-pagination > li > a,
ul.admin-pagination > li > span,
.admin-pagination > li > a,
.admin-pagination > li > span {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.875rem;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    border: 1px solid rgb(203 213 225) !important; /* slate-300 */
    background: #fff !important;
    color: rgb(51 65 85); /* slate-700 */
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    transition: all .18s ease;
    user-select: none;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

ul.admin-pagination > li:not(.active):not(.disabled) > a:hover,
.admin-pagination > li:not(.active):not(.disabled) > a:hover {
    border-color: rgb(147 197 253) !important; /* blue-300 */
    color: rgb(29 78 216); /* blue-700 */
    background: rgb(239 246 255) !important; /* blue-50 */
}

ul.admin-pagination > li.active > a,
ul.admin-pagination > li.active > span,
.admin-pagination > li.active > a,
.admin-pagination > li.active > span {
    border-color: rgb(37 99 235) !important; /* blue-600 */
    background: rgb(37 99 235) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .22);
    pointer-events: none;
}

ul.admin-pagination > li.disabled > span,
ul.admin-pagination > li.disabled > a,
.admin-pagination > li.disabled > span,
.admin-pagination > li.disabled > a {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
    background: #f8fafc !important;
    color: rgb(148 163 184) !important;
    border-color: rgb(226 232 240) !important;
}
