/* RG-CODEX CUSTOMIZATION
 * Maintainer: RG, with assistance from OpenAI Codex
 * Purpose: Pneu-Dart public portal branding and responsive/mobile layout.
 * This is an osTicket override; review and preserve during core upgrades.
 */
:root {
  --pdi-blue: #5ba6e6;
  --pdi-blue-dark: #367fae;
  --pdi-ink: #2d3940;
  --pdi-muted: #657682;
  --pdi-gold: #e3b83f;
  --pdi-mint: #6ba69e;
  --pdi-canvas: #f3f6f8;
  --pdi-line: #d8e2e8;
  --pdi-white: #ffffff;
  --pdi-shadow: 0 12px 34px rgba(38, 61, 74, .12);
}

html, body {
  min-height: 100%;
}

body {
  background: linear-gradient(180deg, #edf4f9 0, #f7f9fa 360px, #eef2f4 100%) fixed;
  color: var(--pdi-ink);
  font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--pdi-blue-dark); }
a:hover { color: #245e83; }

#container {
  width: min(1120px, calc(100% - 40px));
  min-height: 620px;
  margin: 30px auto 18px;
  overflow: hidden;
  background: var(--pdi-white);
  border: 1px solid rgba(93, 125, 143, .16);
  border-radius: 14px;
  box-shadow: var(--pdi-shadow);
}

#header {
  box-sizing: border-box;
  height: 112px;
  padding: 28px 34px 20px;
  background: #fff;
  border-bottom: 1px solid #e5edf1;
}

#header #logo {
  display: inline-block;
  width: 300px;
  height: 62px;
  background-image: url('../../../images/pneudart-logo.png');
  background-position: center -41px;
  background-repeat: no-repeat;
  background-size: 300px auto;
}

#header #logo img,
#header #logo .valign-helper { display: none; }

#header p {
  width: auto;
  padding-top: 4px;
  color: var(--pdi-muted);
  font-size: 13px;
}

#header p a {
  display: inline-block;
  padding: 7px 15px;
  color: var(--pdi-blue-dark);
  background: #eef6fc;
  border: 1px solid #c9deec;
  border-radius: 999px;
  font-weight: 700;
}

#nav {
  box-sizing: border-box;
  height: auto;
  min-height: 48px;
  margin: 0;
  padding: 7px 26px;
  background: var(--pdi-blue);
  border: 0;
  box-shadow: none;
}

#nav li a {
  height: 34px;
  margin: 0 4px;
  padding: 0 14px 0 35px;
  color: #13364b;
  border-radius: 8px;
  font-weight: 700;
  line-height: 34px;
  opacity: .92;
}

#nav li a.active,
#nav li a:hover {
  color: #18394d;
  background-color: rgba(255,255,255,.84);
  box-shadow: 0 3px 10px rgba(28, 71, 99, .12);
}

#content {
  box-sizing: border-box;
  min-height: 460px;
  margin: 0;
  padding: 46px 54px 58px;
}

#landing_page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

#landing_page .main-content {
  width: auto;
  grid-column: 1;
  grid-row: 1;
  padding: 5px 0;
}

#landing_page h1 {
  margin: 0 0 18px;
  color: var(--pdi-ink);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.035em;
}

#landing_page h1:before {
  display: block;
  margin-bottom: 12px;
  color: var(--pdi-blue-dark);
  content: "PNEU-DART SUPPORT";
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

#landing_page .main-content p,
#landing_page .main-content {
  color: #50636f;
  font-size: 16px;
}

#landing_page .sidebar {
  width: auto;
  grid-column: 2;
  grid-row: 1;
}

#landing_page > .clear { display: none; }

.front-page-button {
  display: block;
  box-sizing: border-box;
  min-height: 116px;
  margin: 0 0 18px !important;
  padding: 24px 24px 20px 82px !important;
  background-color: #eef5fa !important;
  background-position: 24px 24px !important;
  border: 1px solid #d3e0e8;
  border-left: 6px solid var(--pdi-blue);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(48, 83, 104, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.front-page-button:nth-child(2) {
  background-color: #f7f6ed !important;
  border-left-color: var(--pdi-gold);
}

.front-page-button:hover {
  transform: translateY(-2px);
  border-color: #b9d3e3;
  box-shadow: 0 12px 26px rgba(48, 83, 104, .14);
}

.front-page-button h3,
.front-page-button a {
  color: var(--pdi-ink) !important;
  font-weight: 700;
}

#landing_page a.button { color: #fff !important; }

h1, h2, h3, h4 { color: var(--pdi-ink); }

input[type="text"], input[type="email"], input[type="password"],
select, textarea {
  border: 1px solid #cbd9e1 !important;
  border-radius: 7px !important;
  box-shadow: inset 0 1px 2px rgba(30, 60, 80, .04);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--pdi-blue) !important;
  outline: 3px solid rgba(91, 166, 230, .17);
}

/* Keep long subjects, filenames, addresses, and user content inside the viewport. */
#content, .thread-body, .ticket-thread, .faq-content, .article-content {
  overflow-wrap: anywhere;
  word-break: normal;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

#ticketTable,
.ticket_info,
.form_table,
.list,
.table {
  width: 100%;
}

.select2-container {
  max-width: 100%;
}

.redactor-box,
.redactor-editor,
.filedrop {
  box-sizing: border-box;
  max-width: 100%;
}

.button, button, input[type="submit"], input[type="button"] {
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--pdi-blue-dark) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(42, 104, 145, .18);
}

.button:hover, button:hover, input[type="submit"]:hover,
input[type="button"]:hover { background: #286d9a !important; }

.message, .info-banner, #msg_notice, #msg_warning, #msg_error {
  border-radius: 9px;
}

#footer {
  padding: 4px 20px 28px;
  color: #71818b;
}

#footer a { color: #71818b; }

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { background: #eef4f7; font-size: 16px; }
  #container {
    width: calc(100% - 20px);
    margin-top: 10px;
    border-radius: 10px;
  }
  #header { display: flex; height: auto; min-height: 88px; padding: 20px 18px 16px; flex-direction: column; align-items: flex-start; }
  #header #logo { width: min(240px, 68vw); height: 52px; background-position: center -33px; background-size: 240px auto; }
  #header .pull-right { order: 2; width: 100%; }
  #header #logo { order: 1; }
  #header p { position: static; float: none; width: auto; margin: 12px 0 0; padding: 0; text-align: left; }
  #header p a { min-height: 36px; padding: 7px 14px; }
  #nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; white-space: normal; }
  #nav li { float: none; flex: 1 1 auto; }
  #nav li a { box-sizing: border-box; width: 100%; min-height: 42px; margin: 0; padding: 4px 12px; background-image: none !important; line-height: 34px; text-align: center; }
  #content { padding: 30px 24px 42px; }
  #landing_page { display: flex; flex-direction: column; gap: 28px; }
  #landing_page .sidebar,
  #landing_page .main-content { box-sizing: border-box; float: none !important; width: 100% !important; }
  #landing_page .sidebar { order: 1; margin: 0 !important; }
  #landing_page .main-content { order: 2; }
  #landing_page h1 { font-size: clamp(30px, 9vw, 40px); }
  #landing_page .front-page-button { width: 100% !important; }
  .front-page-button { min-height: 104px; padding: 22px 20px 18px 74px !important; background-position: 20px 22px !important; }
  input[type="text"], input[type="email"], input[type="password"], select, textarea { box-sizing: border-box; max-width: 100%; min-height: 44px; font-size: 16px; }
  .button, button, input[type="submit"], input[type="button"] { min-height: 44px; padding: 10px 18px !important; }
  table { max-width: 100%; }
  #ticketTable, table.list {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .form_table th,
  .form_table td,
  .ticket_info th,
  .ticket_info td {
    box-sizing: border-box;
  }
  .select2-container { width: 100% !important; }
  .redactor-toolbar { display: flex; flex-wrap: wrap; }
  .redactor-toolbar li { float: none; }
  .thread-entry .header,
  .thread-entry .thread-body { box-sizing: border-box; max-width: 100%; }
  .dialog, .dialog.size-normal, .dialog.size-large {
    box-sizing: border-box;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    left: 12px !important;
    margin-left: 0 !important;
  }
  #content > div, #ticketForm, #clientLogin { box-sizing: border-box; max-width: 100%; }
  #clientLogin {
    width: 100%;
    padding: 20px;
    background-image: none;
  }
  #clientLogin .login-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .75fr); gap: 24px; }
  #clientLogin .login-box,
  #clientLogin .login-aside { box-sizing: border-box; min-width: 0; }
  #clientLogin .login-aside { padding: 4px 0 4px 20px; border-left: 1px solid var(--pdi-line); }
  #clientLogin input[type="text"],
  #clientLogin input[type="email"],
  #clientLogin input[type="password"] { box-sizing: border-box; width: 100% !important; margin: 0 0 12px; float: none; }
  #clientLogin p { text-align: left; }
}

@media (max-width: 480px) {
  #container { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  #header { padding: 18px 16px 14px; }
  #header #logo { width: min(220px, 72vw); height: 48px; background-position: center -30px; background-size: 220px auto; }
  #content { padding: 26px 18px 36px; }
  #nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #nav li { display: block; min-width: 0; }
  #nav li:first-child { grid-column: 1 / -1; }
  #nav li a {
    display: flex;
    min-height: 48px;
    padding: 6px 8px;
    align-items: center;
    justify-content: center;
    white-space: normal;
    line-height: 1.25;
  }
  #landing_page .main-content, #landing_page .main-content p { font-size: 15px; }
  #landing_page .sidebar { margin-top: 24px; }
  .front-page-button { min-height: 94px; margin-bottom: 12px !important; padding: 18px 16px 16px 66px !important; background-position: 16px 19px !important; border-radius: 10px; }
  .front-page-button h3 { margin-top: 0; font-size: 17px; }
  #footer { padding: 12px 16px 24px; }
  .responsive-div, .table-responsive, #ticketTable { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #header .pull-right { float: none; width: 100%; }
  #clientLogin .login-layout { display: block; }
  #clientLogin .login-aside { margin-top: 18px; padding: 18px 0 0; border-top: 1px solid var(--pdi-line); border-left: 0; }
  #clientLogin table,
  #clientLogin tbody,
  #clientLogin tr,
  #clientLogin th,
  #clientLogin td,
  .form_table tbody,
  .form_table tr,
  .form_table th,
  .form_table td {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
  }
  #clientLogin th,
  .form_table th { padding: 10px 0 4px !important; text-align: left; }
  #clientLogin td,
  .form_table td { padding: 4px 0 10px !important; }
  #ticketForm input[type="text"],
  #ticketForm input[type="email"],
  #ticketForm select,
  #ticketForm textarea,
  #clientLogin input[type="text"],
  #clientLogin input[type="email"],
  #clientLogin input[type="password"] { width: 100% !important; }
  .thread-entry { margin-left: 0 !important; margin-right: 0 !important; }
}

@media (max-width: 760px) {
  #landing_page .sidebar > .front-page-button {
    display: grid;
    min-height: 0;
    padding: 18px !important;
    gap: 12px;
    background-image: none !important;
  }
  #landing_page .sidebar > .front-page-button p { margin: 0; }
  #landing_page .sidebar > .front-page-button .button {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
  }
}
