/* ==========================================================================
   Markaz Ilm — Laravel additions on top of style.css / responsive.css
   (logo lockups, flash & validation states, pagination wrapper, small UI bits)
   ========================================================================== */

/* Logo lockups */
.brand-logo img { width: auto; height: 42px; display: block; }
.dash-sidebar .brand-logo img { height: 38px; }
.auth-aside .brand-logo img, .site-footer .brand-logo img { height: 96px; }
.auth-card .brand-logo img { height: 36px; }
@media (max-width: 575.98px) { .site-header .brand-logo img { height: 36px; } }

/* Alerts rendered by the server */
.flash-bar { border-radius: var(--mi-radius); padding: 12px 16px; display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; margin-bottom: 1rem; }
.flash-bar i { margin-top: 2px; }
.flash-bar.success { background: var(--mi-accent-50); color: var(--mi-accent-ink); }
.flash-bar.error { background: var(--mi-danger-50); color: var(--mi-danger); }
.flash-bar.info { background: var(--mi-info-50); color: var(--mi-info); }
.verify-bar { background: #FFF6E5; color: #7A4A00; font-size: .88rem; padding: 8px 12px; text-align: center; }
.verify-bar form { display: inline; }
.verify-bar button { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; font-weight: 600; }

/* Server-side validation */
.invalid-feedback.d-block { display: block; }
.choice-group.is-invalid + .invalid-feedback { display: block; }
.error-summary { border: 1px solid rgba(180,35,24,.25); background: var(--mi-danger-50); color: var(--mi-danger); border-radius: var(--mi-radius); padding: 12px 16px; margin-bottom: 1rem; font-size: .9rem; }
.error-summary ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* Busy submit buttons */
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 1.1em; height: 1.1em; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); border-top-color: transparent; animation: miSpin .7s linear infinite; }
.btn-outline-primary.is-busy::after, .btn-ghost.is-busy::after { border-color: var(--mi-primary); border-top-color: transparent; }
@keyframes miSpin { to { transform: rotate(360deg); } }

/* Pagination wrapper */
.mi-pagination nav > div:first-child { display: none; } /* hide "Showing x to y" on small screens */
.mi-pagination .pagination { justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.mi-pagination p.small { text-align: center; color: var(--mi-muted); }
@media (min-width: 576px) { .mi-pagination nav > div:first-child { display: none; } }

/* Listing: list view toggle */
.list-view > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }

/* Active filter chips (server rendered) */
.active-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.active-filters .chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; background: var(--mi-primary-50); color: var(--mi-primary-700); font-size: .8rem; font-weight: 500; }
.active-filters .chip a { color: inherit; display: inline-flex; }
.active-filters .chip a:hover { color: var(--mi-danger); }

/* Inline forms used for one-click actions */
.inline-form { display: inline; }
.btn-reset { background: none; border: 0; padding: 0; }

/* Saved state */
.btn-save.is-saved, .btn-icon.is-saved { color: var(--mi-primary); border-color: var(--mi-primary); background: var(--mi-primary-25); }

/* Upload box with a real file input */
.upload-box { position: relative; }
.upload-box input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box [data-file-name] { display: block; margin-top: .35rem; font-weight: 600; color: var(--mi-ink-2); }

/* Messages: unread conversation */
.thread-item { display: flex; gap: .75rem; padding: 12px 16px; border-bottom: 1px solid var(--mi-border); color: inherit; text-decoration: none; }
.thread-item:hover { background: var(--mi-primary-25); color: inherit; }
.thread-item.active { background: var(--mi-primary-50); }
.thread-item .ti-main { flex: 1; min-width: 0; }
.thread-item .ti-name { font-weight: 600; font-size: .9rem; display: flex; justify-content: space-between; gap: .5rem; }
.thread-item .ti-name small { font-weight: 400; color: var(--mi-muted); }
.thread-item .ti-preview { font-size: .82rem; color: var(--mi-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.thread-item.unread .ti-preview { color: var(--mi-ink); font-weight: 600; }
.unread-pill { width: 8px; height: 8px; border-radius: 50%; background: var(--mi-accent); display: inline-block; margin-left: .3rem; }

/* Admin tables: compact action buttons */
.table-mi td .inline-form + .inline-form { margin-left: .25rem; }
.admin-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Ratings input */
.rating-input { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-input label { font-size: 1.5rem; color: var(--mi-border-strong); cursor: pointer; line-height: 1; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: #E3A008; }
.rating-input input:focus-visible + label { outline: 2px solid var(--mi-primary); border-radius: 4px; }

.text-gold { color: var(--mi-accent-ink) !important; }
.mw-720 { max-width: 720px; }

/* Class cover picker */
.cover-pick { cursor: pointer; border-radius: 12px; padding: 3px; border: 2px solid transparent; }
.cover-pick:has(input:checked) { border-color: var(--mi-primary); }
.cover-pick input:focus-visible + img { outline: 2px solid var(--mi-primary); outline-offset: 2px; }
