/* ================================================================
 * Time Tracker — Stili custom
 * Bootstrap 5.3 + dark mode via data-bs-theme
 * ================================================================ */

:root {
    --tt-primary: #6366f1;
    --tt-primary-dark: #4f46e5;
    --tt-success: #22c55e;
    --tt-danger: #ef4444;
    --tt-navbar-bg: #1e1b4b;
    --tt-card-radius: 0.75rem;
    --tt-dot-size: 10px;
}

/* ── Body ─────────────────────────────────────────────────────── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────────────── */
.tt-navbar {
    background: var(--tt-navbar-bg) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.tt-navbar .navbar-brand,
.tt-navbar .nav-link,
.tt-navbar .navbar-toggler-icon {
    color: rgba(255,255,255,.9) !important;
}
.tt-navbar .nav-link:hover {
    color: #fff !important;
}
.tt-navbar .dropdown-menu {
    border: 1px solid rgba(0,0,0,.15);
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

/* ── Avatar utente ────────────────────────────────────────────── */
.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--tt-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Bottone icona ghost ──────────────────────────────────────── */
.btn-ghost-icon {
    background: transparent;
    border: none;
    color: var(--bs-body-color);
    padding: .25rem .5rem;
    border-radius: .5rem;
}
.btn-ghost-icon:hover { background: var(--bs-secondary-bg); }

.btn-xs {
    padding: .15rem .4rem;
    font-size: .75rem;
    border-radius: .35rem;
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
    border-radius: var(--tt-card-radius);
    border: 1px solid var(--bs-border-color);
}

/* Card timer avvio */
.tt-card-start .card-header {
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color);
}

/* Card timer attivo */
.tt-card-timer {
    border: 2px solid var(--tt-primary);
    background: linear-gradient(135deg, rgba(99,102,241,.05) 0%, transparent 100%);
}
[data-bs-theme="dark"] .tt-card-timer {
    background: linear-gradient(135deg, rgba(99,102,241,.12) 0%, transparent 100%);
}

/* ── Timer display ────────────────────────────────────────────── */
.tt-timer-big {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--tt-primary);
    line-height: 1;
}

.tt-timer-display {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fff;
}

/* ── Timer navbar ─────────────────────────────────────────────── */
.tt-navbar-timer {
    display: flex;
    align-items: center;
}

.tt-timer-running {
    background: rgba(99,102,241,.2);
    border-radius: 2rem;
    padding: .3rem .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ── Pulse dot (timer in corso) ───────────────────────────────── */
.tt-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tt-success);
    animation: tt-pulse 1.5s ease-in-out infinite;
    margin-right: .25rem;
}
@keyframes tt-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .5; transform: scale(1.3); }
}

/* Badge "In corso" */
.tt-badge-running {
    background: rgba(34,197,94,.15);
    color: var(--tt-success);
    border: 1px solid rgba(34,197,94,.3);
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
}

/* ── Color dot ────────────────────────────────────────────────── */
.tt-color-dot {
    display: inline-block;
    width: var(--tt-dot-size);
    height: var(--tt-dot-size);
    border-radius: 50%;
    flex-shrink: 0;
}
.tt-color-dot-lg {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
}

/* ── Auth pages ───────────────────────────────────────────────── */
.tt-auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.tt-auth-wrap {
    width: 100%;
    max-width: 420px;
}
.tt-auth-card {
    border-radius: 1rem;
    border: none;
}
.tt-auth-logo {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--tt-primary), var(--tt-primary-dark));
    color: #fff;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(99,102,241,.4);
}

/* ── Utilities ────────────────────────────────────────────────── */
.min-width-0 { min-width: 0; }
.font-monospace { font-family: 'SF Mono', 'Fira Code', monospace; }

/* ── Dark mode tweaks ─────────────────────────────────────────── */
[data-bs-theme="dark"] .tt-navbar {
    background: #0f0e1a !important;
}
[data-bs-theme="dark"] .table-light {
    --bs-table-bg: rgba(255,255,255,.03);
}
[data-bs-theme="dark"] .card {
    border-color: rgba(255,255,255,.1);
}
[data-bs-theme="dark"] .list-group-item {
    border-color: rgba(255,255,255,.08);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .tt-timer-big { font-size: 1.6rem; }
}
