@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9;
}

.header-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tab-active {
    border-bottom: 4px solid white;
    font-weight: 700;
    opacity: 1 !important;
}

/* ─── Sidebar nav active state ─── */
.sidebar-nav-active {
    background: rgba(255, 255, 255, 0.12);
    border-left: 3px solid #fff;
    font-weight: 700;
    opacity: 1 !important;
}

/* ─── Sidebar transition ─── */
#sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Sidebar scrim ─── */
#sidebar-scrim {
    transition: opacity 0.3s ease;
}

.input-focus {
    outline: none;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.input-focus:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px #3b82f6;
}

.badge-new {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ─── QR Poster Generator ─── */
.poster-preview-wrapper {
    width: 100%;
    aspect-ratio: 8.5 / 11;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

/* ─── Print Rules ─── */
@media print {
    body>*:not(#active-print-clone) {
        display: none !important;
    }

    #active-print-clone {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        width: 8.5in !important;
        height: 11in !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        background: #fff !important;
        z-index: 99999 !important;
        page-break-inside: avoid;
    }

    #active-print-clone * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #active-print-clone #poster-preview {
        transform: scale(1) !important;
    }

    @page {
        size: letter portrait;
        margin: 0;
    }
}

/* Replaced IDE warnings for inline styles */
.bg-header-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

#mobile-topbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

#sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

#qr-poster-print-wrapper {
    position: relative;
    background: #fff;
    overflow: hidden;
    transform-origin: top left;
}

#poster-preview {
    font-family: 'Inter', sans-serif;
    width: 816px;
    height: 1056px;
    background: #fff;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 6% 7%;
    box-sizing: border-box;
}

/* ── Sidebar collapse: icon-rail (desktop only) ─────────── */
#sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 16rem;
    /* 256px = w-64 */
}

body.sidebar-collapsed #sidebar {
    width: 4rem;
    /* 64px = w-16 */
}

/* Hide text labels, widget, section headings when collapsed */
body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .sidebar-shift-widget,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-collapse-label {
    display: none;
}

/* Centre icons when collapsed */
body.sidebar-collapsed #sidebar nav button,
body.sidebar-collapsed #sidebar .sidebar-bottom-btn {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed #sidebar nav button svg,
body.sidebar-collapsed #sidebar .sidebar-bottom-btn svg {
    margin: 0 auto;
}

/* Tooltip on hover when collapsed */
body.sidebar-collapsed #sidebar button[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 4.25rem;
    background: #1e293b;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 6px;
    z-index: 9999;
    pointer-events: none;
}

body.sidebar-collapsed #sidebar button[data-tooltip] {
    position: relative;
}

/* Main content fluid margin transition */
main {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    body.sidebar-collapsed main {
        margin-left: 4rem;
        /* 64px */
    }
}

/* ── Empty State component ───────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem;
    text-align: center;
}

.empty-state-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.empty-state p {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

.empty-state-cta {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 0.5rem;
    background: #eff6ff;
    color: #3b82f6;
    border: 1px solid #bfdbfe;
    cursor: pointer;
    transition: background 0.15s;
}

.empty-state-cta:hover {
    background: #dbeafe;
}

/* ── Edit Time Entry modal: slide-in from right ──────────── */
#edit-time-modal {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0;
}

#edit-time-modal>div {
    height: 100%;
    max-height: 100vh;
    border-radius: 1.5rem 0 0 1.5rem;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 28rem;
    overflow-y: auto;
}

#edit-time-modal.flex>div,
#edit-time-modal:not(.hidden)>div {
    transform: translateX(0);
}

/* ── QR Studio full-screen overlay ───────────────────────── */
#qr-studio-modal {
    transition: opacity 0.25s ease;
}

#qr-studio-modal.hidden {
    display: none !important;
}

/* NUMPAD BUTTON STYLE */
.numpad-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 1.25rem;
    font-weight: 900;
    background: white;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    -webkit-user-select: none;
    user-select: none;
}

.numpad-btn:active {
    transform: scale(0.92);
    background: #f3f4f6;
}
