/* Quantana deploy override — served by nginx, injected via sub_filter. */

/* Hide the Solidtime SVG wordmark and overlay "Quantana" text. */
a:has(> svg[viewBox="0 0 168 30"]) > svg { display: none !important; }
a:has(> svg[viewBox="0 0 168 30"])::after {
    content: "Quantana";
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: currentColor;
    display: inline-block;
    line-height: 1;
}

/* Sign in with Google button injected on /login and /register. */
.quantana-sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #d0d0d0;
    border-radius: 0.375rem;
    background: #fff;
    color: #1f1f1f;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 1.2rem;
    transition: background 0.15s;
}
.quantana-sso-btn:hover { background: #f5f5f5; }
.quantana-sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    margin: 1rem 0;
}
.quantana-sso-divider::before,
.quantana-sso-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #d0d0d0;
}
.quantana-sso-divider::before { margin-right: 0.6rem; }
.quantana-sso-divider::after  { margin-left: 0.6rem; }

/* Google Calendar — Clockify-style overlay on Solidtime's time grid.
   Each Google Calendar event is rendered as a "ghost" block on top of
   the existing calendar columns. Click a ghost to open a popover that
   logs it to the timesheet. A small status pill anchors the connect /
   refresh / disconnect controls. */

/* Ghost event on the grid.
   These are unlogged Google Calendar events drawn over Solidtime's time
   grid. They use a saturated gradient fill (not a faint tint) so the text
   stays legible on both light and dark calendar themes, while the dashed
   border keeps signalling "draft / not yet logged". */
.qcal-ghost {
    position: absolute;
    left: 6px;
    right: 6px;
    z-index: 5;
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    border: 1px dashed rgba(255, 255, 255, 0.6);
    border-radius: 5px;
    padding: 3px 6px;
    overflow: hidden;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(8, 47, 73, 0.55);
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.35);
    transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, filter 0.12s;
    box-sizing: border-box;
}
.qcal-ghost:hover {
    background: linear-gradient(135deg, #4cc6fb 0%, #0ea5e9 100%);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.5);
    filter: brightness(1.04);
}
.qcal-ghost-upcoming {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    border-color: rgba(120, 53, 15, 0.5);
    color: #422006;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.35);
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.35);
}
.qcal-ghost-upcoming:hover {
    background: linear-gradient(135deg, #fcc63d 0%, #ea8204 100%);
    border-color: rgba(120, 53, 15, 0.7);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45);
    filter: brightness(1.03);
}
.qcal-ghost-time {
    font-size: 10px;
    line-height: 1.2;
    opacity: 0.92;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.qcal-ghost-title {
    font-size: 11.5px;
    line-height: 1.25;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.qcal-ghost-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(66, 32, 6, 0.9);
    color: #fef3c7;
    text-shadow: none;
    font-weight: 700;
}
/* Hover affordance: "Copy as time entry" button, revealed on ghost hover */
.qcal-ghost-copy {
    position: absolute;
    bottom: 3px;
    right: 4px;
    z-index: 6;
    font: inherit;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(2, 132, 199, 0.92);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.12s, transform 0.12s;
    pointer-events: none;
}
.qcal-ghost:hover .qcal-ghost-copy {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.qcal-ghost-copy:hover { background: rgba(3, 105, 161, 1); }

/* Log modal (centered, over a dimmed backdrop) */
.qcal-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}
.qcal-modal {
    width: 26rem;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: #ffffff;
    color: #111827;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    padding-bottom: 0.85rem;
}

/* Modal header / fields (class names shared with the former popover) */
.qcal-pop-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem 0.85rem 0.4rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.qcal-pop-title {
    font-weight: 600;
    font-size: 13.5px;
    color: #0f172a;
    line-height: 1.3;
}
.qcal-pop-close {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
}
.qcal-pop-close:hover { color: #111827; }
.qcal-pop-when {
    padding: 0.45rem 0.85rem;
    color: #6b7280;
    font-size: 11.5px;
    background: #f9fafb;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.qcal-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.55rem 0.85rem 0;
}
.qcal-field-row { display: flex; gap: 0.5rem; }
.qcal-field-half { flex: 1; padding: 0.55rem 0 0; }
.qcal-field-row .qcal-field-half:first-child { padding-left: 0.85rem; }
.qcal-field-row .qcal-field-half:last-child  { padding-right: 0.85rem; }
.qcal-input[type="datetime-local"] {
    font-variant-numeric: tabular-nums;
    padding-right: 0.3rem;
}
.qcal-field-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 600;
}
.qcal-input {
    background: #fff;
    color: #111827;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    padding: 0.42rem 0.55rem;
    font: inherit;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}
.qcal-input:focus { outline: 2px solid #3b82f6; outline-offset: -1px; border-color: #3b82f6; }

/* Duration (computed, read-only) */
.qcal-duration {
    font-variant-numeric: tabular-nums;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #9ca3af;
}
.qcal-duration.qcal-duration-ok { color: #0f172a; }

/* Tags multi-select (chips + add dropdown) */
.qcal-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.qcal-tag-chips:empty { display: none; }
.qcal-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.2rem 0.15rem 0.5rem;
    border-radius: 999px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}
.qcal-tag-chip-x {
    background: transparent;
    border: none;
    color: #6366f1;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
}
.qcal-tag-chip-x:hover { color: #312e81; }
.qcal-tag-select:disabled { color: #9ca3af; background: #f9fafb; }

/* Billable toggle (mirrors upstream BillableToggleButton) */
.qcal-billable-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    padding: 0.3rem 0.6rem 0.3rem 0.35rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.qcal-billable-knob {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.12s, background 0.12s;
}
.qcal-billable-toggle.qcal-billable-on {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}
.qcal-billable-toggle.qcal-billable-on .qcal-billable-knob {
    background: #22c55e;
    border-color: #16a34a;
    transform: translateX(2px);
}

.qcal-log-btn {
    margin: 0.7rem 0.85rem 0;
    padding: 0.5rem 0.85rem;
    border-radius: 5px;
    background: #03a9f4;
    border: 1px solid #0288d1;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    width: calc(100% - 1.7rem);
}
.qcal-log-btn:hover:not(:disabled) { background: #0288d1; }
.qcal-log-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.qcal-feedback {
    padding: 0.35rem 0.85rem 0.7rem;
    font-size: 12px;
    min-height: 0;
    color: #b91c1c;
}
.qcal-error { color: #b91c1c; }

/* Status pill — docked inline in Solidtime's calendar toolbar, beside the
   week/day tabs. Transparent + inherits the toolbar's text colour so it
   matches light and dark themes and never floats over (collides with) events. */
.qcal-widget {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2rem;                 /* matches Solidtime's h-8 toolbar buttons */
    padding: 0 0.65rem;
    background: transparent;
    color: inherit;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    border-radius: 999px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1;
    opacity: 0.95;
    position: relative;           /* positioning context for the dropdown menu */
}
/* Fallback only: if the toolbar anchor can't be found, float bottom-right so
   the status / refresh / connect controls are never lost. */
.qcal-widget.qcal-widget-floating {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9998;
    height: auto;
    padding: 0.32rem 0.55rem 0.32rem 0.7rem;
    background: rgba(17, 19, 24, 0.85);
    backdrop-filter: blur(6px);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    opacity: 1;
}
.qcal-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.qcal-dot-on { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.6); }
.qcal-dot-off { background: #6b7280; }
.qcal-widget-text { white-space: nowrap; opacity: 0.9; }
.qcal-widget-action {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
    padding: 0 0.3rem;
}
.qcal-widget-action:hover { text-decoration: underline; }
.qcal-widget-icon {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.65;
    cursor: pointer;
    font-size: 13px;
    width: 1.2rem;
    height: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.qcal-widget-icon:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
/* Dropdown opens downward (pill sits at the top, in the toolbar). */
.qcal-widget-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.4rem;
    background: rgba(17, 19, 24, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    min-width: 8rem;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}
/* In the bottom-right fallback the menu must open upward instead. */
.qcal-widget-floating .qcal-widget-menu { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 0.4rem; }
.qcal-widget-menu-open { display: block; }
.qcal-widget-menu-item {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 12.5px;
}
.qcal-widget-menu-item:hover { background: rgba(255, 255, 255, 0.08); }

