/* Koora Online panel: styles on top of Vuexy (loaded on every page) */

/* Arabic parts of the panel use Cairo, everything else Vuexy's Public Sans */
[lang=ar], [dir=rtl] { font-family:'Cairo', var(--bs-font-sans-serif); }
.app-brand-logo .icon-base { width:28px; height:28px; }
code, .font-monospace { direction:ltr; unicode-bidi:isolate; }
textarea.font-monospace, input.font-monospace { font-size:13px; }
.guide pre { background:#25293c; color:#e1def5; padding:12px; border-radius:6px; direction:ltr; text-align:left; font-size:12.5px; }
[dir=rtl] .table th, [dir=rtl] .table td { text-align:right; }
[dir=rtl] .form-text, [dir=rtl] p, [dir=rtl] li { text-align:right; }

/* Card header: title on the start side, badges/actions on the end side */
.card-header { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.card-header .card-actions { margin-inline-start:auto; }
.card.border-dashed { border:1px dashed var(--bs-border-color); box-shadow:none; }
.progress-thin { height:6px; }

/* Settings pages: cards flow in balanced columns instead of ragged rows */
.masonry { column-gap:1.5rem; }
@media (min-width: 992px) { .masonry { column-count:2; } }
.masonry > .card { break-inside:avoid; margin-bottom:1.5rem; }
.card-title small { font-weight:400; }
.field.is-hidden, .card.is-hidden { display:none; }
.field .form-check-label .form-text { margin-top:2px; }
textarea.autogrow { resize:vertical; overflow:hidden; min-height:38px; }

/* Page heading row */
.page-head { display:flex; flex-wrap:wrap; align-items:center; gap:1rem; margin-bottom:1.5rem; }
.page-head .actions { margin-inline-start:auto; display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; }
.filter-box { width:240px; }
@media (max-width: 575px) { .filter-box { width:100%; } .page-head .actions { width:100%; } }

/* Appears only when the form has unsaved changes */
.save-bar { position:fixed; left:50%; bottom:20px; transform:translate(-50%, 160%); transition:transform .2s ease;
  z-index:1080; width:min(720px, calc(100% - 32px)); background:var(--bs-paper-bg); border:1px solid var(--bs-border-color);
  border-radius:var(--bs-border-radius-lg); box-shadow:var(--bs-box-shadow-lg); padding:10px 12px 10px 16px; }
@media (min-width: 1200px) { .layout-menu-fixed:not(.layout-menu-collapsed) .save-bar { left:calc(50% + 130px); } }
.save-bar.show { transform:translate(-50%, 0); }

/* ---- motion: Vuexy's animate.css + animate-on-scroll, plus a few small touches ---- */
:root { --animate-duration:.6s; }
.save-bar { transition:transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.btn { transition:transform .12s ease, background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.btn:active:not(:disabled) { transform:scale(.96); }
.progress-bar { animation:bar-grow .9s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes bar-grow { from { width:0; } }
/* Settings that come back when the filter changes fade in */
.filtering .field:not(.is-hidden), .filtering .masonry > .card:not(.is-hidden) { animation:field-in .25s ease-out; }
@keyframes field-in { from { opacity:0; transform:translateY(4px); } }
/* AOS slides 100px by default; a short rise suits a dashboard */
html body [data-aos="fade-up"]:not(.aos-animate) { transform:translate3d(0, 24px, 0); }
.menu-inner > .menu-item > .menu-link .menu-icon { transition:transform .2s ease; }
.menu-inner > .menu-item > .menu-link:hover .menu-icon { transform:scale(1.15); }
@media (prefers-reduced-motion: reduce) {
  .save-bar, .btn { transition:none; }
  .btn:active:not(:disabled), .menu-inner > .menu-item > .menu-link:hover .menu-icon { transform:none; }
  .progress-bar, .filtering .field:not(.is-hidden), .filtering .masonry > .card:not(.is-hidden) { animation:none; }
}
.content-wrapper { padding-bottom:4rem; }

/* ---- Home ---- */
.min-w-0 { min-width:0; }
.home-welcome { position:relative; overflow:hidden; }
.home-welcome-art { position:absolute; right:-14px; top:-16px; width:96px; height:96px; color:var(--bs-primary); opacity:.08; transform:rotate(-15deg); z-index:0; }
.home-welcome .card-body > *:not(.home-welcome-art) { position:relative; z-index:1; }
/* Arabic titles and texts start next to their icon, like the rest of the list */
.home-list [dir=auto] { text-align:left; }
.home-list > li { padding:.625rem 0; }
.home-list > li + li { border-top:1px solid var(--bs-border-color); }
.home-list a { color:inherit; text-decoration:none; border-radius:var(--bs-border-radius); margin:-.375rem -.5rem; padding:.375rem .5rem; transition:background-color .15s ease; }
.home-list a:hover { background:rgba(var(--bs-primary-rgb), .06); }
.home-shortcut { color:inherit; text-decoration:none; padding:.875rem; border:1px solid var(--bs-border-color); border-radius:var(--bs-border-radius-lg);
  transition:border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.home-shortcut:hover { border-color:var(--bs-primary); transform:translateY(-2px); box-shadow:var(--bs-box-shadow-sm); }
@media (prefers-reduced-motion: reduce) { .home-shortcut:hover { transform:none; } }

/* ---- Matches (tracker) ---- */
.match-list > li + li { border-top:1px solid var(--bs-border-color); }
.match-row { display:flex; align-items:center; gap:1rem; padding:.625rem .5rem; border-radius:var(--bs-border-radius); transition:background-color .15s ease; }
.match-row:hover { background:rgba(var(--bs-primary-rgb), .04); }
.match-row.is-tracked { background:rgba(var(--bs-success-rgb), .06); }
.match-row > .badge:first-child { min-width:4.25rem; text-align:center; }
.match-teams { flex:1; min-width:0; display:grid; grid-template-columns:1fr auto auto auto 1fr; align-items:center; gap:.5rem; }
.match-team { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--bs-heading-color); font-weight:500; }
/* Names hug their logo, whatever the language */
.match-team { text-align:left; }
.match-team.home { text-align:right; }
.match-logo { width:24px; height:24px; object-fit:contain; display:inline-block; }
.match-score { min-width:3.5rem; text-align:center; font-weight:600; color:var(--bs-heading-color); font-variant-numeric:tabular-nums; }
.match-actions { display:flex; align-items:center; gap:.75rem; flex-shrink:0; }
.match-live { animation:match-breathe 2s ease-in-out infinite; }
@keyframes match-breathe { 50% { opacity:.55; } }
.day-comp + .day-comp { margin-top:1.25rem; }
.day-comp-head { display:flex; align-items:center; gap:.5rem; padding:.25rem .5rem .5rem; border-bottom:1px solid var(--bs-border-color); }
@media (max-width: 767.98px) {
  .match-row { flex-wrap:wrap; gap:.5rem; }
  .match-teams { flex-basis:100%; order:2; }
  .match-actions { margin-left:auto; }
}
@media (prefers-reduced-motion: reduce) { .match-live { animation:none; } }
/* Cards that are still loading */
.is-loading .placeholder { min-height:1em; }

/* ---- Match servers ---- */
.codes-side { position:sticky; top:6rem; }
.codes-list { max-height:calc(100vh - 22rem); min-height:4rem; overflow-y:auto; }
.codes-list .list-group-item.active small { opacity:.9; }
.server-item { background:rgba(var(--bs-primary-rgb), .02); transition:border-color .15s ease; }
.server-item:focus-within { border-color:rgba(var(--bs-primary-rgb), .5) !important; }
/* Select2 dropdowns hang off <body>; Vuexy's full width there would widen the page */
body > .select2-container { width:auto !important; }
