﻿/* ============================================================
   osTicket + Tabler Integration Theme
   ============================================================ */

:root {
  --tblr-primary: #4f46e5;
  --tblr-primary-rgb: 79, 70, 229;
  --ost-hero-from: #4f46e5;
  --ost-hero-to: #7c3aed;
}

/* ---------- Reset legacy osTicket layout ---------- */
#container, #content { max-width: 100% !important; width: 100%; padding: 0; }
#header, #nav { display: none !important; }
.clear { display: none; }
.sidebar.pull-right { display: none !important; }

/* ---------- Navbar ---------- */
.navbar-brand-image { height: 60px !important; width: auto; }
.navbar .nav-link.active { color: var(--tblr-primary) !important; font-weight: 600; }
.navbar .nav-link { font-size: 14px; }

/* ---------- Hero Section ---------- */
.ost-hero {
  background: linear-gradient(135deg, var(--ost-hero-from) 0%, var(--ost-hero-to) 100%);
  padding: 64px 0 80px;
  position: relative;
  overflow: hidden;
}
.ost-hero > * { position: relative; }

.ost-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,.25);
}
.ost-hero-title {
  color: #fff;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin: 14px 0 8px;
  line-height: 1.15;
}
.ost-hero-sub {
  color: rgba(255,255,255,.72);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

/* Search bar */
.ost-hero-search {
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  padding: 6px;
  backdrop-filter: blur(6px);
}
.ost-hero-search .input-group { border-radius: 8px; overflow: hidden; }
.ost-hero-search .input-group-text { background: #fff; border: none; color: #9ca3af; }
.ost-hero-search .form-control {
  background: #fff;
  border: none !important;
  border-radius: 0 !important;
  height: 46px;
  font-size: 14px;
  box-shadow: none !important;
}
.ost-hero-btn {
  background: var(--ost-hero-to);
  color: #fff !important;
  font-weight: 600;
  border: none;
  padding: 0 24px;
  border-radius: 0 8px 8px 0 !important;
  transition: background .2s;
}
.ost-hero-btn:hover { background: #6d28d9; }

/* ---------- Page body ---------- */
.page-wrapper { padding-top: 0; }
.page-body { padding: 2rem 0; }

/* ---------- Sidebar Card ---------- */
.ost-sidebar-card {
  border-radius: 8px;
  overflow: hidden;
  position: sticky;
  top: 70px;
}
.ost-sidebar-link {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--tblr-body-color);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.45;
  padding: 3px 0;
  transition: color .15s;
}
.ost-sidebar-link:hover { color: var(--tblr-primary); }

/* ---------- KB Cards ---------- */
.ost-kb-card { border-radius: 8px; overflow: hidden; transition: box-shadow .2s; }
.ost-kb-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,.1) !important; }
.ost-kb-card .card-header { background: var(--tblr-bg-surface-secondary, #f6f8fb); }

.ost-article-item {
  padding: 12px 20px;
  border-left: none !important;
  border-right: none !important;
  transition: background .12s;
}
.ost-article-item:hover { background: var(--tblr-bg-surface-secondary, #f6f8fb) !important; }
.ost-article-item:hover .fw-medium { color: var(--tblr-primary); }

/* ---------- Legacy osTicket button classes ---------- */
a.blue.button, a.green.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity .15s;
}
a.blue.button  { background: var(--tblr-primary); color: #fff !important; }
a.green.button { background: #2fb344; color: #fff !important; }
a.blue.button:hover, a.green.button:hover { opacity: .88; }

/* ---------- Thread / ticket view ---------- */
.thread-body { line-height: 1.75; }

/* ---------- Ticket table ---------- */
table.ticket_list, table.tickets_list { width: 100%; border-collapse: collapse; }
table.ticket_list th, table.tickets_list th {
  background: var(--tblr-bg-surface-secondary, #f6f8fb);
  color: var(--tblr-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 14px;
  border-bottom: 2px solid var(--tblr-border-color);
}
table.ticket_list td, table.tickets_list td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--tblr-border-color);
  vertical-align: middle;
}
table.ticket_list tr:hover td,
table.tickets_list tr:hover td { background: var(--tblr-bg-surface-secondary, #f6f8fb); }
table.ticket_list a, table.tickets_list a {
  color: var(--tblr-primary);
  font-weight: 500;
  text-decoration: none;
}

/* ---------- Loading overlay ---------- */
#overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9990; }
.modal-loading {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  background: #fff;
  border-radius: 12px;
  padding: 32px 44px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  z-index: 9999;
}

/* ---------- Dynamic form table (open.php) ---------- */
.ost-dynamic-form { width: 100%; border-collapse: collapse; }
.ost-dynamic-form td { padding: 4px 0 0; vertical-align: top; }
.ost-dynamic-form .form-header { margin: 8px 0 4px; }
.ost-dynamic-form .form-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--tblr-body-color);
  margin: 0 0 4px;
}
.ost-dynamic-form hr { margin: 6px 0; border-color: var(--tblr-border-color); }
.ost-dynamic-form label {
  font-size: 14px;
  font-weight: 500;
  color: var(--tblr-body-color);
  display: block;
  margin-bottom: 4px;
}
.ost-dynamic-form label em {
  font-size: 12px;
  color: var(--tblr-secondary);
  font-style: normal;
  display: block;
  margin-top: 2px;
}
.ost-dynamic-form span.required { color: var(--tblr-danger); }
.ost-dynamic-form input[type=text],
.ost-dynamic-form input[type=email],
.ost-dynamic-form input[type=tel],
.ost-dynamic-form input[type=number],
.ost-dynamic-form input[type=url],
.ost-dynamic-form select,
.ost-dynamic-form textarea {
  display: block;
  width: 100%;
  padding: 0.4375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4285714;
  color: var(--tblr-body-color);
  background-color: #fff;
  border: 1px solid var(--tblr-border-color);
  border-radius: var(--tblr-border-radius, 4px);
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  margin-bottom: 12px;
}
.ost-dynamic-form input:focus,
.ost-dynamic-form select:focus,
.ost-dynamic-form textarea:focus {
  outline: 0;
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, .1);
}
.ost-dynamic-form textarea { min-height: 120px; resize: vertical; }
.ost-dynamic-form div.error,
.ost-dynamic-form font.error {
  color: var(--tblr-danger);
  font-size: 12px;
  display: block;
  margin: -8px 0 8px;
}

/* ---------- Page header (breadcrumb pages) ---------- */
.page-header { padding-top: 1.5rem; }
.page-pretitle { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--tblr-secondary); margin-bottom: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .ost-hero { padding: 44px 0 60px; }
  .ost-hero-title { font-size: 1.6rem; }
  .ost-sidebar-card { position: static; }
  .ost-hero-search { border-radius: 10px; }
  .page-header { padding-top: 1rem; }
}
@media (max-width: 480px) {
  .ost-hero-search { border-radius: 10px; }
  .ost-hero-search .form-control { border-radius: 8px 0 0 8px !important; }
  .ost-hero-btn { border-radius: 0 8px 8px 0 !important; }
  .col-lg-5, .col-lg-8 { padding-left: 12px; padding-right: 12px; }
}