:root {
	--jqc-purple: #7C4DFF; /* IntelliJ-like purple */
	--jqc-black: #1E1E1E;  /* deep background */
	--jqc-orange: #FF8C42; /* accent orange */
	--jqc-bg: #0f1724; /* subtle near-black */
	font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

/* Page background: slightly lighter than pure black for better readability */
body {
	padding-bottom: 40px;
	background: linear-gradient(180deg, #111827 0%, #071426 100%);
	color: #e6eef8;
	font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

.container { max-width: 1180px }

.card {
	margin-bottom: 20px;
	border: 0;
	background: rgba(255,255,255,0.045);
	box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}

.card .card-body { background: rgba(255,255,255,0.02); position: relative; }
.navbar-brand { letter-spacing: .2px }

/* Ensure ticket description text is clearly visible on dark cards */
.card .card-body .card-text {
	color: #ffffff !important;
}
.card .card-body .card-title {
	color: #ffffff !important;
}

/* Navbar custom styling to resemble IntelliJ theme */
.jqc-nav {
	background: linear-gradient(90deg, var(--jqc-purple) 0%, #5f3bdb 60%, var(--jqc-bg) 100%);
	border-bottom: 3px solid #3d2aa8;
}
.jqc-nav .navbar-brand { color: #fff; display: flex; align-items: center; gap: 6px; }
.jqc-purple { color: var(--jqc-purple); font-weight: 800; }
.jqc-orange { color: var(--jqc-orange); font-weight: 600; }
.jqc-white { color: #ffffff; font-weight: 600; }

/* stronger rule to avoid overrides from Bootstrap or other styles */
.jqc-nav .navbar-brand .jqc-white { color: #ffffff !important; }
/* enforce white for the whole brand (covers Bootstrap overrides and hover states) */
.jqc-nav .navbar-brand,
.jqc-nav .navbar-brand * {
	color: #ffffff !important;
}
.jqc-nav .navbar-brand:hover,
.jqc-nav .navbar-brand:focus {
	color: #ffffff !important;
	text-decoration: none !important;
}

/* Make admin and logout buttons in the navbar identical size */
.jqc-nav .nav-action-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	/* slightly thinner buttons */
	height: 30px !important;
	min-width: 76px !important;
	padding: 2px 8px !important;
	border-radius: 8px !important;
	font-size: 0.88rem !important;
}

/* Display name styling in header: normal text and slightly smaller */
.header-display-name {
	font-style: normal;
	font-size: 0.85rem;
	opacity: 0.95;
	color: #ffffff !important;
}

.btn-outline-light { border-color: rgba(255,255,255,0.15); color: #fff; }
.btn-light { background: #fff; color: var(--jqc-black); }

/* Orange logout button */
.btn-jqc-logout {
	background: var(--jqc-orange);
	color: #1b1b1b;
	border: none;
	padding-left: 10px;
	padding-right: 10px;
}
.btn-jqc-logout:hover { filter: brightness(0.95); text-decoration: none; }

/* small adjustments for readability */
.alert-info { background: rgba(124,77,255,0.12); color: #e6e6ff; border: 1px solid rgba(124,77,255,0.2); }

/* logo sizing */
.site-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }

/* Make the navbar logo slightly smaller for a tighter header layout */
.jqc-nav .site-logo { width: 20px !important; height: 20px !important; }

/* Nudge the Joomz logo slightly down inside the navbar so it sits visually
	 lower in the dark band. This keeps the brand text alignment intact. */
.jqc-nav .site-logo {
	/* Keep logo default placement so the navbar layout remains stable.
	   Per-state adjustments are applied with more specific selectors. */
	position: static;
	top: auto;
	transform: none;
}

/* Default brand text baseline (no vertical offset). For the login area
   (guest view) we apply a specific rule below to move it 20px down. */
.jqc-nav .brand-text {
	position: relative;
	top: 0;
}

/* Guest-only: move brand text 20px down in the login/header area so the
   rest of the site (logged-in users) keeps the original alignment. */
.jqc-guest .jqc-nav .brand-text {
	/* Keep brand text baseline consistent to avoid header misalignment.
	   The login page vertical spacing is handled inside the login card so
	   the navbar remains visually aligned across pages. */
	top: 0 !important;
}

/* Accent button used for primary actions (orange) */
.btn-jqc-accent {
	background: var(--jqc-orange);
	color: #1b1b1b;
	border: none;
}
.btn-jqc-accent:hover { filter: brightness(0.95); }

/* brand-text layout and responsive tweaks */
.brand-text { display: inline-flex; align-items: center; gap: 6px; }

/* On very small screens hide the text and make the logo a bit larger for tappability */
@media (max-width: 575.98px) {
	.brand-text { display: none !important; }
	.site-logo { width: 36px; height: 36px; }
}

/* When on 127.0.0.1:8001, make all buttons orange and prevent hover color changes */
.jqc-all-orange .btn,
.jqc-all-orange .btn-sm,
.jqc-all-orange .btn-primary,
.jqc-all-orange .btn-outline-secondary,
.jqc-all-orange .btn-outline-light {
	background: var(--jqc-orange) !important;
	color: #1b1b1b !important;
	border-color: var(--jqc-orange) !important;
}
.jqc-all-orange .btn:hover,
.jqc-all-orange .btn:focus,
.jqc-all-orange .btn:active {
	background: var(--jqc-orange) !important;
	color: #1b1b1b !important;
	filter: none !important;
	opacity: 1 !important;
}

/* Alert fade-out for auto-dismissed flash messages */
.alert {
  transition: opacity .4s ease, transform .4s ease;
}
.alert.fade-out {
  opacity: 0 !important;
  transform: translateY(-8px);
  pointer-events: none;
}

/* Flash/alert wrapper: reserve vertical space so alerts don't push content down */
.alert-wrapper {
	position: relative;
}

.alert-space {
	/* Reserve approx one alert height. Reduced by 2px to tighten layout. */
	height: 54px;
	min-height: 46px;
}

.alert-stack {
	/* Make the alert stack fixed so showing an alert does NOT cause the
		 browser to scroll to the top of the page. Alerts visually float above
		 the page, while .alert-space keeps the original layout reserved. */
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	top: 72px; /* sits below a typical navbar; tweak if your navbar is taller */
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	pointer-events: none; /* allow clicks to pass through empty areas */
	padding-top: 6px;
	z-index: 1085; /* above navbar and modals but below special overlays if needed */
	width: 100%;
	max-width: 980px;
	box-sizing: border-box;
}

.alert-stack .alert {
	/* Allow interaction with the alert box (close button) */
	pointer-events: auto;
	width: 100%;
	max-width: 920px; /* keeps alerts nicely centered and constrained */
	margin: 0 12px;
	/* Slightly reduce vertical padding so alerts are 1-2px shorter */
	padding: 8px 12px;
	line-height: 1.15;
}

/* Make sure the close button contrast/placement works with these alerts */
.alert .btn-close {
	filter: brightness(1.2);
}

/* Close button for modals (small white cross in top-right) */
.jqc-modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(255,255,255,0.06);
	color: #ffffff;
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 6px;
	font-size: 20px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.jqc-modal-close:hover { background: rgba(255,255,255,0.12); }

/* Ensure an obvious focus ring for keyboard users */
.jqc-modal-close:focus {
	outline: 3px solid rgba(124,77,255,0.22);
	outline-offset: 2px;
}

/* Lightbox styles */
.jqc-lightbox { display: none; position: fixed; inset: 0; z-index: 1050; }
.jqc-lightbox[aria-hidden="false"] { display: block; }
.jqc-lightbox-backdrop { position: absolute; inset: 0; background: rgba(2,6,23,0.75); }
.jqc-lightbox-content { position: absolute; left:50%; top:50%; transform: translate(-50%,-50%); max-width: 90%; max-height: 86%; background: transparent; padding: 12px; border-radius: 8px; display:flex; flex-direction:column; align-items:center; }
.jqc-lightbox-content img { max-width: 100%; max-height: 72vh; border-radius:6px; box-shadow: 0 8px 30px rgba(0,0,0,0.6); }
.jqc-lightbox-close { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,0.5); color: #fff; border: none; width:32px; height:32px; border-radius:6px; font-size:18px; cursor:pointer; }
.jqc-lightbox-caption { margin-top:8px; color: #e6eef8; font-size: 13px; }
.thumb-link { text-decoration: none; }
.jqc-thumb { cursor: zoom-in; }

/* Delete confirmation modal styling (overlay + centered dialog) */
.jqc-delete-modal { display: none; position: fixed; inset: 0; z-index: 1060; }
.jqc-delete-modal[aria-hidden="false"] { display: block; }
.jqc-delete-backdrop { position: absolute; inset: 0; background: rgba(2,6,23,0.72); }
.jqc-delete-content { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 100%; max-width: 520px; padding: 12px; }

/* Hamburger menu in navbar */
.jqc-hamburger { display: inline-block; }
.jqc-hamburger #jqc-hamburger-btn {
	/* Strong overrides to avoid Bootstrap / .jqc-all-orange button styles
		 which may otherwise render this as an orange square. */
	background: transparent !important;
	border: none !important;
	padding: 6px 8px !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important; /* left-align bars so lengths step down to the right */
	justify-content: center !important;
	gap: 4px !important;
	cursor: pointer !important;
	min-width: 0 !important;
	height: auto !important;
}
.jqc-hamburger #jqc-hamburger-btn:focus { outline: none; }
.jqc-hamburger .jqc-hamb-bar {
	display: block !important;
	height: 3px !important;
	background: var(--jqc-orange) !important;
	border-radius: 2px !important;
}
.jqc-hamburger .jqc-hamb-bar.b1 { width: 22px; }
.jqc-hamburger .jqc-hamb-bar.b2 { width: 16px; }
.jqc-hamburger .jqc-hamb-bar.b3 { width: 10px; }

.jqc-hamburger-menu {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	background: rgba(11,18,32,0.98);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(2,6,23,0.6);
	min-width: 180px;
	z-index: 1070;
}
.jqc-hamburger-menu a, .jqc-hamburger-menu button {
	text-decoration: none;
}

/* small responsive tweak: align menu to full width on mobile */
@media (max-width: 575.98px) {
	.jqc-hamburger-menu { right: 8px; left: 8px; min-width: auto; }
}

/* Pagination: use theme purple instead of Bootstrap blue for the active/current page
	 and for hover/focus states so the current page and the "Next" link appear purple. */
.pagination .page-link {
	/* Only change: make page link text black. Leave backgrounds to Bootstrap defaults (gray). */
	color: #000000 !important;
}
.pagination .page-link:hover,
.pagination .page-link:focus {
	/* Keep text black on hover/focus; do not override background so Bootstrap defaults remain. */
	color: #000000 !important;
}
.pagination .page-item.active .page-link {
	/* Active page: change only the background/border color to the theme purple.
		 Leave other behavior (text color etc.) as-is so the rest remains the same. */
	background: var(--jqc-purple) !important;
	border-color: var(--jqc-purple) !important;
	color: #000000 !important;
	box-shadow: none !important;
}


/* Standardized ticket screenshot thumbnail to match edit/delete button size */
.ticket-thumb {
	/* Slightly narrower thumbnail so it lines up better with action buttons */
	width: 100px !important; /* reduced from 120 to 100 */
	height: 90px !important;
	object-fit: cover !important;
	border-radius: 6px !important;
	display: inline-block !important;
	vertical-align: middle !important;
}

/* Placeholder box used when no screenshot is attached so layout remains consistent */
.ticket-thumb-placeholder {
	width: 100px;
	height: 90px;
	border-radius: 6px;
	background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
	border: 1px dashed rgba(255,255,255,0.04);
	display: inline-block;
}

/* Layout rules so long descriptions don't shrink the thumbnail
	 - left column (text) grows and can wrap (min-width:0 to allow flex child to shrink properly)
	 - right column (thumbnail + actions) keeps a fixed width so thumbnails remain uniform
*/
.ticket-row .card-body > .d-flex { align-items: flex-start; }
.ticket-row .card-body > .d-flex > div:first-child {
	min-width: 0; /* allows text to wrap instead of forcing the sibling smaller */
	flex: 1 1 auto;
}
.ticket-row .card-body > .d-flex > .text-end {
	flex: 0 0 140px; /* reserve space for thumbnail + buttons */
	max-width: 140px;
}
.ticket-row .card-text {
	overflow-wrap: anywhere;
	word-break: break-word;
	white-space: normal;
}

/* Ensure the right column content stacks nicely */
.ticket-row .card-body .text-end .mt-2 { margin-top: 6px !important; }

/* status text positioned bottom-left inside the card */
.ticket-row .card-body { position: relative; }
.ticket-row .ticket-status {
	/* visuals only; layout handled by the .ticket-meta-wrap */
	display: inline-block;
	/* purple pill to match theme */
	background: rgba(124,77,255,0.14); /* translucent purple */
	border: 1px solid rgba(124,77,255,0.22);
	color: #ffffff; /* ensure high contrast */
	font-size: 0.80rem; /* slightly smaller to align with creator */
	font-weight: 600;
	padding: 3px 8px; /* a touch less vertical padding */
	border-radius: 10px;
	line-height: 1;
	box-shadow: 0 4px 12px rgba(2,6,23,0.45);
	align-self: flex-start;
}

/* Keep the inner small consistent and prevent overly reduced sizes */
.ticket-row .ticket-status small {
	/* Force white text for readability even if .text-muted is present */
	color: #ffffff !important;
	font-size: 0.82rem;
	font-weight: 600;
}

/* Extra defensive rule: ensure any .text-muted inside ticket-status stays white */
.ticket-row .ticket-status .text-muted {
	color: #ffffff !important;
}

/* Wrapper for status + creator line positioned bottom-left */
.ticket-row .ticket-meta-wrap {
	position: absolute;
	left: 12px;
	/* raise it slightly so the status sits a bit higher */
	bottom: 18px;
	z-index: 25;
	display: flex;
	flex-direction: column;
	gap: 4px; /* tighter spacing between status and creator */
	align-items: flex-start;
}

.ticket-row .ticket-creator small {
	color: rgba(230,238,248,0.9) !important;
	font-size: 0.78rem;
	font-weight: 500;
	/* align the left edge of this text with the inner text of the status pill */
	padding-left: 8px;
}

/* Ensure the card body reserves enough bottom padding to avoid overlap
	(reduced by 20px per request so the dark area appears shorter) */
.card .card-body { padding-bottom: 0px; }

/* Back button on edit screen */
.btn-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 0.9rem;
}
.btn-back i { font-size: 1rem; }

/* Footer styling */
.jqc-footer {
	border-top: 1px solid rgba(255,255,255,0.04);
	background: transparent;
}
.jqc-footer .text-muted {
	color: rgba(230,238,248,0.7) !important;
}

/* Delete button fixed size and positioned bottom-right of the card */
.jqc-delete-btn {
	position: absolute;
	right: 12px;
	bottom: 12px;
	min-width: 44px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 8px;
	border-radius: 8px;
	font-size: 0.95rem;
}

/* Admin panel controls: ensure update/delete controls are neatly stacked and aligned */
.list-group-item > .d-flex > div {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.list-group-item .admin-controls,
.list-group-item form > .d-grid {
  display: grid !important;
  gap: 8px;
}
.list-group-item .admin-controls .btn,
.list-group-item form .btn {
  width: 100%;
  text-align: center;
}
.list-group-item .form-control-sm { width: 100%; }

/* Keep login form input font-size stable on focus so text does not jump larger */
.login-card .form-control,
.login-card input,
.login-card textarea,
.login-card select {
	/* Use the larger, focused font-size as the default to avoid the
		 visible jump when focusing. 16px prevents mobile browsers from
		 auto-zooming smaller inputs and is a comfortable readable size. */
	font-size: 16px !important;
	line-height: 1.25 !important;
	transition: none !important;
	transform: none !important;
	-webkit-text-size-adjust: 100% !important;
}
.login-card .form-control:focus,
.login-card input:focus,
.login-card textarea:focus,
.login-card select:focus {
	/* Keep focus state identical to default so there's no jump */
	font-size: 16px !important;
	transform: none !important;
}

/* Small orange trash icon button for admin delete (compact) */
.jqc-delete-icon {
	background: var(--jqc-orange);
	color: #1b1b1b;
	border: none;
	width: 36px !important;
	height: 36px !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	font-size: 15px;
	cursor: pointer;
}
.jqc-delete-icon i { color: #1b1b1b; }
.jqc-delete-icon:focus { outline: 3px solid rgba(124,77,255,0.18); outline-offset: 2px; }

/* Save icon: small, aligned with delete icon */
.jqc-save-icon {
	background: var(--jqc-purple);
	color: #ffffff;
	border: none;
	width: 36px !important;
	height: 36px !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	font-size: 15px;
	cursor: pointer;
}
.jqc-save-icon i { color: #ffffff; font-size: 16px; }
.controls-row .jqc-save-icon,
.controls-row .jqc-delete-icon { line-height: 0; }

/* Ensure control icons align exactly and look balanced on narrow screens */
.controls-row { align-items: center; }
.controls-row .btn,
.controls-row button { padding: 0; }

/* Temporary highlight for updated tickets (subtle, non-scrolling) */
.jqc-highlight-ticket {
	box-shadow: 0 6px 24px rgba(124,77,255,0.08), 0 0 0 3px rgba(124,77,255,0.06) !important;
	transition: box-shadow 0.3s ease;
	border-radius: 8px;
}

/* Edit button placed to the left of delete button */
.jqc-edit-btn {
	position: absolute;
	right: 64px; /* space to the left of delete button */
	bottom: 12px;
	min-width: 44px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 8px;
	border-radius: 8px;
	font-size: 0.95rem;
}

/* Mobile: stack actions under content instead of absolute positioning */
@media (max-width: 575.98px) {
	.jqc-delete-btn {
		position: static;
		width: 100%;
		margin-top: 8px;
	}
	.jqc-edit-btn {
		position: static;
		width: 100%;
		margin-top: 8px;
	}
}

/* Keep the original absolute-positioned edit/delete buttons, but align the
   screenshot thumbnail's right edge with the buttons (they sit at right:12px).
   This preserves the original layout while ensuring the thumbnail lines up
   horizontally with the action buttons. */
.ticket-row .text-end img.ticket-thumb,
.ticket-row .text-end .ticket-thumb-placeholder {
	display: none; /* placeholders removed; keep the selector for backwards-compat */
}

/* Position the actual thumbnail absolutely so its right edge aligns with
   the delete button (both use right:12px). This keeps the original layout
   while guaranteeing exact horizontal alignment. */
.ticket-row .card-body img.ticket-thumb {
	position: absolute;
	right: 12px; /* align with .jqc-delete-btn */
	top: 18px;   /* place near the top of the right column */
	margin: 0;
}

/* Reserve vertical space for the thumbnail area so buttons and the status
   pill don't visually overlap. Keep modest min-height to avoid changing
   the original card proportions too much. */
.ticket-row .card-body .text-end > .mt-2 {
	min-height: 100px; /* thumbnail (90) + a bit of spacing; reduced to match shorter card */
}

/* Reserve space on the right column so the delete button doesn't overlap thumbnails */
.card .card-body .text-end {
	padding-bottom: 16px; /* reduced room for the absolute-positioned delete button to fit smaller cards */
}

/* Strong overrides for login form spacing and submit placement
	 Scoped to .login-form to avoid affecting other forms. */
.login-form .mb-2 {
	margin-bottom: 3px !important;
}
.login-form .login-actions {
	text-align: left !important;
	margin-top: 20px !important; /* move the button 20px down */
}
.login-form .login-submit {
	display: inline-block !important;
	padding: .28rem .6rem !important;
	min-width: 0 !important;
	width: auto !important;
	font-size: .95rem !important;
}



