/*
Theme Name:   IT Helpdesk Portal
Theme URI:    https://example.com/it-helpdesk-portal
Author:       IT Helpdesk
Author URI:   https://example.com
Description:  A clean, corporate-blue support-portal theme built to showcase the IT Helpdesk plugin. Ships with a dashboard-style front page (live ticket/queue stats for signed-in clients and techs), dedicated Client Portal and Tech Dashboard page templates, and standard blog/page templates for the rest of the site.
Version:      1.4.0
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  ithd-portal
*/

/* ==========================================================================
   1. Variables & reset
   ========================================================================== */

:root {
	/* Tell browsers/OSes with an automatic "dark theme for web content"
	   feature (common on Android Chrome, and some desktop browsers) that
	   this site already supplies its own colors — without this, some
	   browsers flatten custom backgrounds, background-images, and colors
	   into a generic forced-dark palette, which is what breaks the login
	   page's photo background and colors on those browsers. */
	color-scheme: light;

	--ithd-primary: #2271b1;
	--ithd-primary-dark: #135e96;
	--ithd-primary-light: #d7e8fc;
	--ithd-text: #1d2327;
	--ithd-text-muted: #50575e;
	--ithd-bg: #f6f7f7;
	--ithd-bg-alt: #ffffff;
	--ithd-border: #e2e4e7;
	--ithd-success: #1c6b2d;
	--ithd-success-bg: #dcf3df;
	--ithd-warn: #7a5b00;
	--ithd-warn-bg: #fff2cc;
	--ithd-danger: #8a1f11;
	--ithd-danger-bg: #fbdede;
	--ithd-radius: 6px;
	--ithd-max-width: 1140px;
	--ithd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--ithd-font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--ithd-text);
	background: var(--ithd-bg);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--ithd-primary);
	text-decoration: none;
}

a:hover,
a:focus {
	color: var(--ithd-primary-dark);
	text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.25;
	font-weight: 700;
	margin: 0 0 0.6em;
	color: var(--ithd-text);
}

p {
	margin: 0 0 1.2em;
}

ul, ol {
	margin: 0 0 1.2em;
	padding-left: 1.4em;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ==========================================================================
   2. Layout helpers
   ========================================================================== */

.ithd-container {
	max-width: var(--ithd-max-width);
	margin: 0 auto;
	padding: 0 24px;
}

.ithd-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.ithd-main {
	flex: 1 0 auto;
	padding: 40px 0 60px;
}

.ithd-layout {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 40px;
	align-items: start;
}

@media (max-width: 782px) {
	.ithd-layout {
		grid-template-columns: 1fr;
	}
}

.ithd-card {
	background: var(--ithd-bg-alt);
	border: 1px solid var(--ithd-border);
	border-radius: var(--ithd-radius);
	padding: 28px;
}

/* ==========================================================================
   3. Header
   ========================================================================== */

.ithd-header {
	background: var(--ithd-bg-alt);
	border-bottom: 1px solid var(--ithd-border);
}

.ithd-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	max-width: var(--ithd-max-width);
	margin: 0 auto;
	gap: 20px;
}

.ithd-branding {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ithd-branding img {
	max-height: 44px;
	width: auto;
}

.ithd-site-title {
	font-size: 1.25rem;
	margin: 0;
}

.ithd-site-title a {
	color: var(--ithd-text);
	text-decoration: none;
}

.ithd-site-description {
	margin: 0;
	font-size: 0.85rem;
	color: var(--ithd-text-muted);
}

.ithd-primary-nav {
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
}

.ithd-primary-nav ul {
	list-style: none;
	display: flex;
	gap: 20px;
	margin: 0;
	padding: 0;
}

.ithd-primary-nav a {
	color: var(--ithd-text);
	font-weight: 600;
	font-size: 0.95rem;
}

.ithd-primary-nav a:hover {
	color: var(--ithd-primary);
	text-decoration: none;
}

.ithd-header-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 0.9rem;
	white-space: nowrap;
}

.ithd-header-actions .ithd-button {
	white-space: nowrap;
}

.ithd-menu-toggle {
	display: none;
	background: none;
	border: 1px solid var(--ithd-border);
	border-radius: 4px;
	padding: 8px 10px;
	cursor: pointer;
}

.ithd-menu-toggle span {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--ithd-text);
	margin: 4px 0;
}

@media (max-width: 782px) {
	.ithd-header-inner {
		flex-wrap: wrap;
	}
	.ithd-menu-toggle {
		display: block;
	}
	.ithd-primary-nav {
		display: none;
		width: 100%;
		flex-direction: column;
		align-items: flex-start;
		order: 3;
	}
	.ithd-primary-nav.is-open {
		display: flex;
	}
	.ithd-primary-nav ul {
		flex-direction: column;
		width: 100%;
		gap: 0;
	}
	.ithd-primary-nav li {
		width: 100%;
		border-top: 1px solid var(--ithd-border);
	}
	.ithd-primary-nav a {
		display: block;
		padding: 12px 0;
	}
}

/* ==========================================================================
   4. Buttons & notices (kept visually consistent with the IT Helpdesk plugin)
   ========================================================================== */

.ithd-button {
	display: inline-block;
	background: var(--ithd-primary);
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 0.7em 1.5em;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.ithd-button:hover,
.ithd-button:focus {
	background: var(--ithd-primary-dark);
	color: #fff;
	text-decoration: none;
}

.ithd-button-outline {
	background: transparent;
	border: 1px solid var(--ithd-primary);
	color: var(--ithd-primary);
}

.ithd-button-outline:hover,
.ithd-button-outline:focus {
	background: var(--ithd-primary-light);
	color: var(--ithd-primary-dark);
}

/* ==========================================================================
   5. Hero / dashboard (front page)
   ========================================================================== */

.ithd-hero {
	background: linear-gradient(135deg, var(--ithd-primary) 0%, var(--ithd-primary-dark) 100%);
	color: #fff;
	padding: 64px 0;
}

.ithd-hero h1 {
	color: #fff;
	font-size: 2.2rem;
	margin-bottom: 0.4em;
}

.ithd-hero p.ithd-hero-subtitle {
	font-size: 1.1rem;
	max-width: 640px;
	color: rgba(255, 255, 255, 0.9);
	margin-bottom: 1.6em;
}

.ithd-hero-actions {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}

.ithd-hero .ithd-button-outline {
	border-color: #fff;
	color: #fff;
}

.ithd-hero .ithd-button-outline:hover {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

.ithd-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin: -40px 0 40px;
}

@media (max-width: 782px) {
	.ithd-stats {
		grid-template-columns: repeat(2, 1fr);
	}
}

.ithd-stat-card {
	background: var(--ithd-bg-alt);
	border: 1px solid var(--ithd-border);
	border-radius: var(--ithd-radius);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	padding: 20px;
	text-align: center;
}

.ithd-stat-card .ithd-stat-number {
	display: block;
	font-size: 2rem;
	font-weight: 700;
	color: var(--ithd-primary);
	line-height: 1;
	margin-bottom: 6px;
}

.ithd-stat-card .ithd-stat-label {
	font-size: 0.85rem;
	color: var(--ithd-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.ithd-stat-card.is-open .ithd-stat-number { color: var(--ithd-primary); }
.ithd-stat-card.is-progress .ithd-stat-number { color: var(--ithd-warn); }
.ithd-stat-card.is-resolved .ithd-stat-number { color: var(--ithd-success); }

.ithd-section {
	padding: 20px 0 40px;
}

.ithd-section h2 {
	font-size: 1.5rem;
	margin-bottom: 0.8em;
}

.ithd-cta-banner {
	background: var(--ithd-bg-alt);
	border: 1px solid var(--ithd-border);
	border-radius: var(--ithd-radius);
	padding: 32px;
	text-align: center;
}

.ithd-cta-banner h2 {
	margin-bottom: 0.4em;
}

.ithd-cta-banner p {
	color: var(--ithd-text-muted);
}

/* ==========================================================================
   6. Posts & pages
   ========================================================================== */

.ithd-entry-header {
	margin-bottom: 1.4em;
}

.ithd-entry-title {
	font-size: 1.9rem;
}

.ithd-entry-meta {
	font-size: 0.85rem;
	color: var(--ithd-text-muted);
}

.ithd-post-list article {
	border-bottom: 1px solid var(--ithd-border);
	padding: 24px 0;
}

.ithd-post-list article:first-child {
	padding-top: 0;
}

.ithd-post-list h2 {
	font-size: 1.3rem;
	margin-bottom: 0.3em;
}

.ithd-pagination {
	display: flex;
	gap: 10px;
	margin-top: 20px;
}

.ithd-widget {
	margin-bottom: 28px;
}

.ithd-widget h2,
.ithd-widget .widget-title {
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--ithd-text-muted);
	border-bottom: 1px solid var(--ithd-border);
	padding-bottom: 0.5em;
	margin-bottom: 0.8em;
}

/* ==========================================================================
   7. Footer
   ========================================================================== */

.ithd-footer {
	background: var(--ithd-text);
	color: #d6d8db;
	padding: 40px 0 24px;
	margin-top: 40px;
}

.ithd-footer a {
	color: #fff;
}

.ithd-footer-widgets {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin-bottom: 24px;
}

@media (max-width: 782px) {
	.ithd-footer-widgets {
		grid-template-columns: 1fr;
	}
}

.ithd-footer-widgets .ithd-widget h2,
.ithd-footer-widgets .widget-title {
	color: #fff;
	border-bottom-color: rgba(255, 255, 255, 0.2);
}

.ithd-footer-nav ul {
	list-style: none;
	display: flex;
	gap: 18px;
	padding: 0;
	margin: 0 0 12px;
	flex-wrap: wrap;
}

.ithd-footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	padding-top: 16px;
	font-size: 0.85rem;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
}

/* ==========================================================================
   8. Support portal template
   ========================================================================== */

.ithd-portal-header {
	margin-bottom: 24px;
}

.ithd-portal-columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	align-items: start;
}

@media (max-width: 900px) {
	.ithd-portal-columns {
		grid-template-columns: 1fr;
	}
}

.ithd-portal-columns .ithd-card h2 {
	font-size: 1.3rem;
	margin-bottom: 0.9em;
}

.ithd-portal-notice {
	background: var(--ithd-warn-bg);
	color: var(--ithd-warn);
	border-radius: var(--ithd-radius);
	padding: 16px 20px;
}

/* Align the plugin's own front-end form/list/detail styling with the theme's card look. */
.ithd-portal-columns .ithd-form,
.ithd-portal-columns .ithd-ticket-list,
.ithd-ticket-detail-wrap .ithd-ticket-detail {
	max-width: none;
	margin: 0;
}

/* ==========================================================================
   9. Login page (Login Page template)
   ========================================================================== */

.ithd-login-page {
	background: var(--ithd-text);
}

/* Rotating background: four stacked photos crossfade + slowly zoom, one at
   a time, forever. Pure CSS — no JS required. */
.ithd-login-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	background: var(--ithd-text);
}

.ithd-login-bg-slide {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	opacity: 0;
	animation: ithd-login-bg-cycle 32s infinite;
}

.ithd-login-bg-slide:nth-child(1) { animation-delay: 0s; }
.ithd-login-bg-slide:nth-child(2) { animation-delay: 8s; }
.ithd-login-bg-slide:nth-child(3) { animation-delay: 16s; }
.ithd-login-bg-slide:nth-child(4) { animation-delay: 24s; }

@keyframes ithd-login-bg-cycle {
	0% { opacity: 0; transform: scale(1); }
	4% { opacity: 1; }
	21% { opacity: 1; transform: scale(1.06); }
	25% { opacity: 0; transform: scale(1.08); }
	100% { opacity: 0; transform: scale(1.08); }
}

.ithd-login-bg-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(8, 18, 34, 0.55) 0%, rgba(8, 18, 34, 0.72) 100%);
}

@media (prefers-reduced-motion: reduce) {
	.ithd-login-bg-slide {
		animation: none;
		opacity: 0;
		transform: none;
	}
	.ithd-login-bg-slide:first-child {
		opacity: 1;
	}
}

.ithd-login-wrap {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
}

.ithd-login-home {
	display: inline-flex;
	align-items: center;
	margin-bottom: 28px;
}

.ithd-login-home a {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: #fff;
}

.ithd-login-home .custom-logo {
	max-height: 56px;
	width: auto;
}

.ithd-login-site-name {
	font-size: 1.4rem;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.01em;
}

.ithd-login-card {
	width: 100%;
	max-width: 420px;
	background: var(--ithd-bg-alt);
	border-radius: 14px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	padding: 40px 36px;
	text-align: center;
	position: relative;
	overflow: hidden;
}

/* A slim, multi-hue accent tying the card to the four rotating background
   colors (blue / teal / indigo / emerald), even while the card itself
   stays a clean, readable white. */
.ithd-login-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 5px;
	background: linear-gradient(90deg, #2271b1, #11897e, #5647b5, #178261);
}

.ithd-login-title {
	font-size: 1.6rem;
	margin: 0 0 0.3em;
	color: var(--ithd-text);
}

.ithd-login-subtitle {
	color: var(--ithd-text-muted);
	margin: 0 0 1.6em;
	font-size: 0.95rem;
}

/* The plugin renders the actual sign-in form (.ithd-login-form / .ithd-form);
   re-align it to sit centered and full-width inside the card. */
.ithd-login-card .ithd-login-form {
	max-width: none;
	margin: 0;
	text-align: left;
}

.ithd-login-card .ithd-notice {
	text-align: left;
}

.ithd-login-card .ithd-field {
	margin-bottom: 1.3em;
}

.ithd-login-card .ithd-field label {
	font-size: 0.9rem;
	color: var(--ithd-text-muted);
}

.ithd-login-card .ithd-form input[type="email"],
.ithd-login-card .ithd-form input[type="password"] {
	padding: 0.75em 0.9em;
	font-size: 1rem;
}

.ithd-login-card .ithd-button {
	width: 100%;
	padding: 0.8em 1.4em;
	font-size: 1.02rem;
	margin-top: 0.4em;
}

.ithd-login-card .ithd-login-help {
	text-align: center;
	margin-top: 1.4em;
	margin-bottom: 0;
}

.ithd-login-switch {
	margin: 1.4em 0 0;
	padding-top: 1.2em;
	border-top: 1px solid var(--ithd-border);
	text-align: center;
}

.ithd-login-switch a {
	font-weight: 600;
}

.ithd-login-back {
	margin: 24px 0 0;
}

.ithd-login-back a {
	color: rgba(255, 255, 255, 0.85);
	text-decoration: none;
	font-size: 0.9rem;
}

.ithd-login-back a:hover,
.ithd-login-back a:focus {
	color: #fff;
	text-decoration: underline;
}

@media (max-width: 480px) {
	.ithd-login-card {
		padding: 32px 24px;
	}
}
