/*
 * Oyoun Media client portal theme for osTicket 1.18.4
 * Put this file in /var/www/osticket/assets/custom/css/ after enabling
 * https://github.com/markus-michalski/osticket-custom-css-loader
 * Filename must contain "client". Client pages only; staff pages are untouched.
 * Edit the colours in :root to match your official brand palette.
 */
:root {
  --oy-ink: #18233d;
  --oy-muted: #59647c;
  --oy-brand: #5147cf;
  --oy-brand-hover: #3e35ae;
  --oy-brand-soft: #f0eeff;
  --oy-surface: #ffffff;
  --oy-background: #f6f7fb;
  --oy-border: #e3e7f0;
  --oy-radius: 18px;
  --oy-shadow: 0 16px 40px rgba(22, 32, 59, .07);
}

html { background: var(--oy-background); }
body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at 12% 2%, #edebff 0, transparent 35%), var(--oy-background);
  color: var(--oy-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
body, body * { box-sizing: border-box; }
a { color: var(--oy-brand); }
a:hover { color: var(--oy-brand-hover); }

/* Override osTicket's fixed desktop width without changing its templates. */
#container {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  background: transparent;
  border: 0;
  box-shadow: none;
}
#header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  min-height: 94px;
  padding: 14px 0;
  background: transparent;
}
#header #logo {
  order: -1;
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  float: none;
  max-width: min(250px, 55vw);
  height: auto;
  margin: 0;
}
#header #logo img { display: block; max-width: 100%; max-height: 64px; width: auto; height: auto; object-fit: contain; }
#header .pull-right { float: none; text-align: end; }
#header .pull-right p { margin: 0; }
#header .pull-right a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid var(--oy-border);
  border-radius: 999px;
  background: white;
  color: var(--oy-ink);
  font-weight: 650;
  text-decoration: none;
}
#header .pull-right a:hover { border-color: var(--oy-brand); color: var(--oy-brand); }

#nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 56px;
  margin: 0 0 22px;
  padding: 7px;
  list-style: none;
  border: 1px solid var(--oy-border);
  border-radius: 16px;
  background: var(--oy-surface);
  box-shadow: 0 6px 20px rgba(22, 32, 59, .035);
}
#nav li { float: none; margin: 0; padding: 0; }
#nav li a, #nav li a.active {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--oy-muted);
  font-weight: 650;
  text-decoration: none;
  white-space: normal;
}
#nav li a:hover, #nav li a.active { background: var(--oy-brand-soft); color: var(--oy-brand); }

#content {
  width: 100%;
  min-height: 48vh;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--oy-border);
  border-radius: var(--oy-radius);
  background: var(--oy-surface);
  box-shadow: var(--oy-shadow);
}
#content h1, #content h2, #content h3 { color: var(--oy-ink); line-height: 1.25; }
#content h1 { margin: 0 0 18px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.025em; }
#content h2 { font-size: clamp(20px, 2.5vw, 25px); }
#content p { color: var(--oy-muted); }
#content :focus-visible, #nav a:focus-visible, #header a:focus-visible {
  outline: 3px solid var(--oy-brand);
  outline-offset: 3px;
}

/* Landing page: content alongside the two key client actions. */
#landing_page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 290px); gap: 34px; align-items: start; }
#landing_page .main-content { grid-column: 1; grid-row: 1; float: none; width: auto; min-width: 0; }
#landing_page .sidebar { grid-column: 2; grid-row: 1; float: none; width: auto; min-width: 0; }
#landing_page .thread-body { padding: 0; background: transparent; }
#landing_page .front-page-button { text-align: initial; }
#landing_page .front-page-button p { margin: 0 0 12px; }
#landing_page .front-page-button a.button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid var(--oy-brand);
  border-radius: 12px;
  background: var(--oy-brand);
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: none;
}
#landing_page .front-page-button a.button:hover { background: var(--oy-brand-hover); border-color: var(--oy-brand-hover); }
#landing_page .front-page-button a.green.button {
  border-color: var(--oy-border);
  background: #fff;
  color: var(--oy-ink);
}
#landing_page .front-page-button a.green.button:hover { border-color: var(--oy-brand); color: var(--oy-brand); }

/* Form styles shared by sign-in, password recovery and ticket forms. */
#content input[type="text"], #content input[type="email"], #content input[type="password"],
#content input[type="tel"], #content input[type="search"], #content select, #content textarea {
  max-width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--oy-border);
  border-radius: 10px;
  background: #fff;
  color: var(--oy-ink);
  font: inherit;
  box-shadow: none;
}
#content textarea { min-height: 110px; }
#content input:focus, #content select:focus, #content textarea:focus {
  border-color: var(--oy-brand);
  outline: 3px solid rgba(81, 71, 207, .16);
}
#content input[type="submit"], #content button, #content .btn {
  min-height: 44px;
  padding: 9px 19px;
  border: 1px solid var(--oy-brand);
  border-radius: 10px;
  background: var(--oy-brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
#content input[type="submit"]:hover, #content button:hover, #content .btn:hover { background: var(--oy-brand-hover); }
#clientLogin .login-box { width: min(360px, 100%); max-width: 100%; }
#clientLogin .login-box input:not([type="submit"]) { width: 100%; margin: 0 0 12px; }
#clientLogin .login-box input[type="submit"] { width: 100%; }
#clientLogin > div { max-width: 100%; }

/* Ticket lists and thread cards, when the client is signed in. */
#content table { max-width: 100%; border-collapse: collapse; }
#content table th { padding: 12px; background: var(--oy-brand-soft); color: var(--oy-ink); text-align: start; }
#content table td { padding: 12px; border-bottom: 1px solid var(--oy-border); }
#content .thread-entry, #content .ticket_info, #content .ticket-details {
  max-width: 100%;
  border-radius: 12px;
}
#content img { max-width: 100%; height: auto; }

#footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 25px 0 35px;
  border: 0;
  background: transparent;
  color: var(--oy-muted);
  font-size: 12px;
}
#footer p { margin: 0; }
#footer a { color: var(--oy-muted); }

@media (max-width: 700px) {
  #container { width: min(100% - 20px, 600px); }
  #header { min-height: 78px; }
  #header #logo img { max-height: 52px; }
  #nav { gap: 2px; padding: 6px; }
  #nav li { flex: 1 1 auto; }
  #nav li a, #nav li a.active { justify-content: center; min-height: 42px; padding: 7px 10px; font-size: 13px; text-align: center; }
  #content { padding: 24px 19px; min-height: 40vh; }
  #landing_page { display: flex; flex-direction: column; gap: 22px; }
  #landing_page .main-content, #landing_page .sidebar { width: 100%; }
  #content table { display: block; max-width: 100%; overflow-x: auto; }
  #clientLogin > div { display: block !important; }
  #clientLogin > div > div { display: block !important; padding-inline: 0 !important; }
}
@media (prefers-reduced-motion: no-preference) {
  #nav a, #header a, #content .button, #content input[type="submit"] { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
}

/* Fix repeating osTicket navigation icons. */
#nav li a.new,
#nav li a.status {
  background-image: none !important;
}

/* Reduce empty space on the home page. */
@media (min-width: 701px) {
  #content { min-height: 300px; }
}
@media (max-width: 700px) {
  #content { min-height: 0; }
}

#nav li a {
  background-image: none !important;
}
