/* Időmérés gyorsvezérlő a Filament topbaron — App\Livewire\TopbarTimer.
   Kompakt, a topbar magasságába illő; szűk képernyőn a munkalapnév levágódik. */

.crm-topbar-timer {
    display: flex;
    align-items: center;
    min-width: 0;
    margin-inline-end: 0.75rem;
}

.crm-topbar-timer:empty {
    display: none;
}

.crm-topbar-timer .ctt-pill,
.crm-topbar-timer .ctt-start {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

/* Munkalaponkénti pillek egy sorban — több párhuzamos mérésnél a sor
   vízszintesen görgethető, de a topbar magassága nem nő. */
.crm-topbar-timer .ctt-pills {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    max-width: 42vw;
    overflow-x: auto;
    scrollbar-width: thin;
}

.crm-topbar-timer .ctt-pill--running {
    padding: 0.25rem 0.4rem 0.25rem 0.6rem;
    border-radius: 9999px;
    background: rgb(240 253 244);
    border: 1px solid rgb(187 247 208);
    flex-shrink: 0;
}

.dark .crm-topbar-timer .ctt-pill--running {
    background: rgb(20 83 45 / 0.35);
    border-color: rgb(22 101 52);
}

.crm-topbar-timer .ctt-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: rgb(34 197 94);
    flex-shrink: 0;
    animation: ctt-pulse 1.6s ease-in-out infinite;
}

@keyframes ctt-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.crm-topbar-timer .ctt-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(22 101 52);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 9rem;
}

.dark .crm-topbar-timer .ctt-name {
    color: rgb(187 247 208);
}

.crm-topbar-timer .ctt-clock {
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    font-weight: 700;
    color: rgb(21 128 61);
    flex-shrink: 0;
}

.dark .crm-topbar-timer .ctt-clock {
    color: rgb(134 239 172);
}

.crm-topbar-timer [x-cloak] {
    display: none !important;
}

.crm-topbar-timer .ctt-select {
    max-width: 16rem;
    font-size: 0.8125rem;
    padding: 0.3rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(209 213 219);
    background-color: rgb(255 255 255);
    color: rgb(17 24 39);
    line-height: 1.2;
}

.dark .crm-topbar-timer .ctt-select {
    background-color: rgb(255 255 255 / 0.05);
    border-color: rgb(255 255 255 / 0.1);
    color: rgb(243 244 246);
}

/* ── Kereshető legördülő (combobox) ──────────────────────────── */
.crm-topbar-timer .ctt-combo {
    position: relative;
    min-width: 0;
}

.crm-topbar-timer .ctt-combo-input {
    width: 16rem;
    max-width: 40vw;
}

.crm-topbar-timer .ctt-combo-input::placeholder {
    color: rgb(107 114 128);
    opacity: 1;
}

.crm-topbar-timer .ctt-combo-panel {
    position: absolute;
    top: calc(100% + 0.3rem);
    inset-inline-start: 0;
    width: 20rem;
    max-width: 70vw;
    max-height: 18rem;
    overflow-y: auto;
    z-index: 50;
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(229 231 235);
    background: rgb(255 255 255);
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.2), 0 8px 10px -6px rgb(0 0 0 / 0.15);
}

.dark .crm-topbar-timer .ctt-combo-panel {
    background: rgb(24 24 27);
    border-color: rgb(63 63 70);
}

.crm-topbar-timer .ctt-combo-group {
    padding: 0.35rem 0.55rem 0.2rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgb(107 114 128);
}

.crm-topbar-timer .ctt-combo-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    width: 100%;
    text-align: start;
    padding: 0.4rem 0.55rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
}

.crm-topbar-timer .ctt-combo-item-name {
    font-size: 0.8125rem;
    color: rgb(17 24 39);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dark .crm-topbar-timer .ctt-combo-item-name {
    color: rgb(228 228 231);
}

.crm-topbar-timer .ctt-combo-item-case {
    font-size: 0.6875rem;
    color: rgb(107 114 128);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.crm-topbar-timer .ctt-combo-item:hover {
    background: rgb(243 244 246);
}

.dark .crm-topbar-timer .ctt-combo-item:hover {
    background: rgb(255 255 255 / 0.06);
}

.crm-topbar-timer .ctt-combo-item.is-selected {
    background: rgb(220 252 231);
    font-weight: 600;
}

.dark .crm-topbar-timer .ctt-combo-item.is-selected {
    background: rgb(22 101 52 / 0.4);
}

.crm-topbar-timer .ctt-combo-empty {
    padding: 0.6rem 0.55rem;
    font-size: 0.8125rem;
    color: rgb(107 114 128);
}

.crm-topbar-timer .ctt-btn {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.crm-topbar-timer .ctt-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.crm-topbar-timer .ctt-btn--start {
    background: rgb(34 197 94);
    color: #fff;
}

.crm-topbar-timer .ctt-btn--start:not(:disabled):hover {
    background: rgb(22 163 74);
}

.crm-topbar-timer .ctt-btn--stop {
    background: rgb(239 68 68);
    color: #fff;
}

.crm-topbar-timer .ctt-btn--stop:not(:disabled):hover {
    background: rgb(220 38 38);
}

@media (max-width: 1024px) {
    .crm-topbar-timer .ctt-pills { max-width: 34vw; }
    .crm-topbar-timer .ctt-name { max-width: 6rem; }
    .crm-topbar-timer .ctt-combo-input { width: 10rem; }
}

@media (max-width: 640px) {
    .crm-topbar-timer { margin-inline-end: 0.4rem; }
    .crm-topbar-timer .ctt-pills { max-width: 28vw; }
    .crm-topbar-timer .ctt-name { max-width: 4rem; }
    .crm-topbar-timer .ctt-combo-input { width: 7.5rem; }
    .crm-topbar-timer .ctt-btn { padding: 0.3rem 0.5rem; }
}
