/* OSTicket Dark Modern Theme */
/* Base Styles & Reset */
html {
  font-size: 100%;
  overflow-y: scroll;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  padding: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
}

/* Content Container for max-width control */
.content-wrapper {
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

body,
input,
select,
textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #c0c0c0;
}

/* Ensure all text elements use dark theme colors */
* {
  color: inherit;
}

p, span, div, li, td, th {
  color: #c0c0c0;
}

b, strong {
  font-weight: 600;
}

blockquote {
  margin: 1em 40px;
  padding-left: 15px;
  border-left: 3px solid #4a9eff;
  color: #b0b0b0;
}

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #3a3a4e;
  margin: 1em 0;
  padding: 0;
}

small {
  font-size: 85%;
}

ul, ol {
  margin: 1em 0;
  padding: 0 0 0 30px;
}

img {
  border: 0;
  vertical-align: middle;
}

form {
  margin: 0;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

label {
  cursor: pointer;
  color: #c0c0c0;
}

input,
select,
textarea {
  font-size: 100%;
  margin: 0;
  vertical-align: baseline;
  color: #e0e0e0;
  background: #252538;
  border: 1px solid #3a3a4e;
}

input {
  line-height: normal;
}

/* Dropdown/Select styling */
select {
  padding: 8px 12px;
  border-radius: 6px;
  background: #252538 !important;
  color: #e0e0e0 !important;
  border: 1px solid #3a3a4e;
  transition: all 0.3s ease;
  cursor: pointer;
}

select:hover {
  border-color: #4a9eff;
}

select:focus {
  border-color: #4a9eff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

select option {
  background: #252538 !important;
  background-color: #252538 !important;
  color: #e0e0e0 !important;
  padding: 8px;
}

select optgroup {
  background: #1e1e2e !important;
  background-color: #1e1e2e !important;
  color: #4a9eff !important;
  font-weight: 600;
  padding: 8px;
}

select optgroup option {
  background: #252538 !important;
  background-color: #252538 !important;
  color: #e0e0e0 !important;
  padding-left: 20px;
}

/* Force dark background on all select elements */
select,
select * {
  background: #252538 !important;
  color: #e0e0e0 !important;
}

/* Input fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"] {
  background: #252538;
  border: 1px solid #3a3a4e;
  color: #e0e0e0;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus {
  border-color: #4a9eff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: #888;
  opacity: 1;
}

textarea {
  background: #252538;
  border: 1px solid #3a3a4e;
  color: #e0e0e0;
  padding: 10px 12px;
  border-radius: 6px;
}

input[type="button"],
input[type="reset"],
input[type="submit"] {
  cursor: pointer;
  -webkit-appearance: button;
}

input[type="checkbox"],
input[type="radio"] {
  box-sizing: border-box;
}

textarea {
  overflow: auto;
  vertical-align: top;
  resize: vertical;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  color: #c0c0c0;
}

th, td {
  vertical-align: top;
  color: #c0c0c0;
}

th {
  text-align: left;
  font-weight: 600;
  color: #e0e0e0;
}

h1, h2, h3, h4, h5, h6, form, fieldset {
  margin: 0;
  padding: 0;
}

/* Typography */
a, .link {
  color: #4a9eff;
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover, .link:hover {
  color: #6bb3ff;
  text-decoration: underline;
  cursor: pointer;
}

h1 {
  color: #4a9eff;
  font-weight: 600;
  font-size: 24px;
  margin-bottom: 15px;
}

h2, .subject {
  font-size: 18px;
  color: #c0c0c0;
  font-weight: 500;
}

h3 {
  font-size: 16px;
  color: #b0b0b0;
}

h4, h5, h6 {
  color: #b0b0b0;
}

/* Helpers */
.centered {
  text-align: center;
}

.clear {
  clear: both;
  height: 1px;
  visibility: hidden;
}

.hidden {
  display: none;
}

.faded {
  color: #888;
}

/* Pagination */
#pagination {
  border: 0;
  margin: 0 0 40px 0;
  padding: 0;
}

#pagination li {
  border: 0;
  margin: 0;
  padding: 0;
  font-size: 11px;
  list-style: none;
  display: inline;
}

#pagination li a {
  margin-right: 2px;
  display: block;
  float: left;
  padding: 6px 12px;
  text-decoration: none;
  background: #2a2a3e;
  border: 1px solid #3a3a4e;
  border-radius: 4px;
  transition: all 0.3s ease;
}

#pagination li a:hover {
  background: #3a3a4e;
  color: #4a9eff;
  border-color: #4a9eff;
}

#pagination .previousOff,
#pagination .nextOff {
  color: #666;
  display: block;
  float: left;
  font-weight: bold;
  padding: 6px 12px;
  background: #1a1a2e;
  border: 1px solid #2a2a3e;
  border-radius: 4px;
}

#pagination .next a,
#pagination .previous a {
  font-weight: bold;
}

#pagination .active {
  color: #fff;
  font-weight: bold;
  margin-right: 2px;
  display: block;
  float: left;
  padding: 6px 12px;
  text-decoration: none;
  background: #4a9eff;
  border: 1px solid #4a9eff;
  border-radius: 4px;
}

/* Alerts & Notices */
#msg_notice {
  margin: 0 0 15px 0;
  padding: 12px 15px 12px 45px;
  border-radius: 6px;
  border: 1px solid #28a745;
  background: linear-gradient(135deg, #1e4d2b 0%, #2d5a3a 100%);
  color: #a8e6b8;
  position: relative;
}

#msg_notice::before {
  content: "✓";
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: bold;
  color: #28a745;
}

#msg_warning, .warning-banner {
  margin: 0 0 15px 0;
  padding: 12px 15px 12px 45px;
  border-radius: 6px;
  border: 1px solid #ffc107;
  background: linear-gradient(135deg, #4d3d1e 0%, #5a4a2d 100%);
  color: #ffe6a8;
  position: relative;
}

#msg_warning::before, .warning-banner::before {
  content: "⚠";
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: bold;
  color: #ffc107;
}

#msg_error {
  margin: 0 0 15px 0;
  padding: 12px 15px 12px 45px;
  border-radius: 6px;
  border: 1px solid #dc3545;
  background: linear-gradient(135deg, #4d1e1e 0%, #5a2d2d 100%);
  color: #ffa8a8;
  position: relative;
}

#msg_error::before {
  content: "✕";
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: bold;
  color: #dc3545;
}

#msg_info {
  margin: 0 0 15px 0;
  padding: 12px 15px 12px 45px;
  border-radius: 6px;
  border: 1px solid #17a2b8;
  background: linear-gradient(135deg, #1e3d4d 0%, #2d4a5a 100%);
  color: #a8d8e6;
  position: relative;
}

#msg_info::before {
  content: "ℹ";
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: bold;
  color: #17a2b8;
}

.warning {
  background: #4d3d1e;
  font-style: italic;
  padding: 8px;
  border-radius: 4px;
}

.warning strong {
  text-transform: uppercase;
  color: #ff6b6b;
  font-style: normal;
}

.error {
  color: #ff6b6b;
}

.error input {
  border: 1px solid #ff6b6b !important;
}

/* Buttons */
.button,
.button:visited {
  background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
  border: none;
  display: inline-block;
  font-size: 15px;
  padding: 10px 24px;
  max-width: 220px;
  text-align: center;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.button:hover {
  background: linear-gradient(135deg, #6bb3ff 0%, #4a9eff 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

.button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(74, 158, 255, 0.3);
}

.green.button,
.green.button:visited {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.green.button:hover {
  background: linear-gradient(135deg, #34ce57 0%, #28a745 100%);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.blue.button,
.blue.button:visited {
  background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
}

.blue.button:hover {
  background: linear-gradient(135deg, #6bb3ff 0%, #4a9eff 100%);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

/* Main Layout */
#container {
  background: #1e1e2e !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  border: none !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}

#header {
  position: relative;
  height: 90px;
  padding: 0 5%;
  background: linear-gradient(135deg, #2a2a3e 0%, #1e1e2e 100%);
  border-bottom: 3px solid #4a9eff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#header::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #4a9eff 0%, #357abd 50%, #4a9eff 100%);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

#logo {
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

#header #logo img {
  max-height: 70px;
  max-width: 400px;
  width: auto;
  height: auto;
  filter: brightness(1.3) drop-shadow(0 2px 10px rgba(74, 158, 255, 0.3));
  transition: all 0.3s ease;
}

#header #logo img:hover {
  filter: brightness(1.5) drop-shadow(0 4px 15px rgba(74, 158, 255, 0.5));
  transform: scale(1.02);
}

.valign-helper {
  height: 100%;
  display: inline-block;
  vertical-align: middle;
}

#header p {
  width: 400px;
  margin: 0;
  padding: 10px 0 0;
  color: #b0b0b0;
}

@media (max-width: 768px) {
  #header {
    height: auto;
    padding: 20px 5%;
  }
  
  #header #logo img {
    max-height: 50px;
  }
}

/* Navigation */
#nav {
  margin: 0;
  padding: 15px 5%;
  background: linear-gradient(135deg, #252538 0%, #1e1e2e 100%);
  border-bottom: 1px solid #2a2a3e;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  overflow-x: auto;
  overflow-y: hidden;
}

#nav li {
  margin: 0;
  padding: 0;
  list-style: none;
  display: inline;
}

#nav li a {
  display: inline-block;
  height: 36px;
  line-height: 36px;
  text-align: center;
  padding: 0 20px 0 45px;
  margin-right: 8px;
  color: #b0b0b0;
  border-radius: 8px;
  background-position: 15px 50%;
  background-repeat: no-repeat;
  transition: all 0.3s ease;
  font-weight: 500;
}

.rtl #nav li a {
  background-position: right center;
  background-position: calc(100% - 15px) center;
  padding-left: 20px;
  padding-right: 45px;
  margin-right: 0;
  margin-left: 8px;
}

#nav li a.active {
  background-color: #4a9eff;
  color: #fff;
  box-shadow: 0 2px 10px rgba(74, 158, 255, 0.3);
}

#nav li a:hover {
  background-color: #2a2a3e;
  color: #4a9eff;
  text-decoration: none;
}

#nav li a.active:hover {
  background-color: #357abd;
  color: #fff;
}

#nav li a.home {
  background-image: url('../images/icons/home.png');
}

#nav li a.kb {
  background-image: url('../images/icons/kb.png');
}

#nav li a.new {
  background-image: url('../images/icons/new.png');
}

#nav li a.status {
  background-image: url('../images/icons/status.png');
}

#nav li a.tickets {
  background-image: url('../images/icons/tix.png');
}

/* Content Area */
#content {
  padding: 30px 5%;
  margin: 0;
  min-height: 400px;
  background: #1e1e2e;
  flex: 1;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Footer */
#footer {
  text-align: center;
  font-size: 11px;
  color: #888;
  padding: 20px;
  background: #1a1a2e;
  border-top: 1px solid #2a2a3e;
}

#footer a {
  color: #4a9eff;
}

#footer p {
  margin: 10px 0 0 0;
}

#footer #poweredBy {
  display: block;
  width: 126px;
  height: 23px;
  outline: none;
  text-indent: -9999px;
  margin: 0 auto;
  background: url('../images/poweredby.png') top left no-repeat;
  background-size: auto 20px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

#footer #poweredBy:hover {
  opacity: 1;
}

/* Landing Page */
#landing_page {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: flex-start;
}

#landing_page .sidebar {
  order: 2;
  flex: 0 0 280px;
  max-width: 280px;
  margin-left: auto;
}

#landing_page .main-content {
  order: 1;
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 310px);
}

/* Center content when no sidebar */
#landing_page:not(:has(.sidebar)) .main-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* Hero Section */
.thread-body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: #b0b0b0 !important;
  background: linear-gradient(135deg, #252538 0%, #1e1e2e 100%) !important;
  background-color: #252538 !important;
  border: 1px solid #3a3a4e !important;
  border-radius: 12px !important;
  padding: 50px !important;
  margin: 0 !important;
  margin-bottom: 40px !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
  position: relative;
  overflow: hidden;
  word-wrap: break-word;
  overflow-x: auto;
  text-align: center;
}

.thread-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4a9eff 0%, #357abd 50%, #4a9eff 100%);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.thread-body h1 {
  font-size: 36px !important;
  margin-bottom: 20px !important;
  color: #e0e0e0 !important;
  font-weight: 600 !important;
  text-shadow: 0 2px 10px rgba(74, 158, 255, 0.3) !important;
}

.thread-body p {
  font-size: 16px !important;
  line-height: 1.8 !important;
  color: #b0b0b0 !important;
  margin-bottom: 15px !important;
  max-width: 800px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.thread-body * {
  color: #b0b0b0 !important;
}

.thread-body h1,
.thread-body h2,
.thread-body h3 {
  color: #e0e0e0 !important;
}

.thread-body a {
  color: #4a9eff !important;
}

.thread-body strong,
.thread-body b {
  color: #e0e0e0 !important;
}

/* Search Form Enhancement */
.search-form {
  margin-bottom: 40px;
  padding: 35px;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.1) 0%, rgba(53, 122, 189, 0.05) 100%);
  border-radius: 12px;
  border: 1px solid rgba(74, 158, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.search-form form {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.search-form input.search {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
  padding: 16px 24px;
  font-size: 16px;
  border: 2px solid #3a3a4e;
  background: #1e1e2e;
  color: #e0e0e0;
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.search-form input.search:focus {
  border-color: #4a9eff;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(74, 158, 255, 0.15);
  outline: none;
}

.search-form input.search::placeholder {
  color: #888;
}

.search-form button {
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

/* Front Page Buttons */
.front-page-button {
  margin-bottom: 20px;
}

.front-page-button p {
  margin: 0 0 15px 0;
}

.front-page-button a.button {
  width: 100%;
  max-width: 100%;
  display: block;
  text-align: center;
  padding: 18px 24px;
  font-size: 16px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.front-page-button a.button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.front-page-button a.button:hover::before {
  width: 300px;
  height: 300px;
}

.front-page-button a.blue.button {
  background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
  position: relative;
}

.front-page-button a.green.button {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

/* Main Content Wrapper */
.main-content {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  flex: 1;
}

/* Featured Categories Enhancement */
.featured-category {
  margin-top: 0;
  margin-bottom: 20px;
  width: calc(50% - 10px);
  display: inline-block;
  box-sizing: border-box;
  vertical-align: top;
  padding: 25px;
  background: linear-gradient(135deg, #252538 0%, #1e1e2e 100%);
  border-radius: 12px;
  border: 1px solid #3a3a4e;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-right: 20px;
  position: relative;
  overflow: hidden;
}

.featured-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(74, 158, 255, 0.1), transparent);
  transition: left 0.5s;
}

.featured-category:hover::before {
  left: 100%;
}

.featured-category:nth-child(2n) {
  margin-right: 0;
}

.featured-category:hover {
  border-color: #4a9eff;
  box-shadow: 0 8px 30px rgba(74, 158, 255, 0.3);
  transform: translateY(-5px);
}

/* Three columns on very wide screens */
@media (min-width: 1800px) {
  .featured-category {
    width: calc(33.333% - 14px);
    margin-right: 20px;
  }
  
  .featured-category:nth-child(2n) {
    margin-right: 20px;
  }
  
  .featured-category:nth-child(3n) {
    margin-right: 0;
  }
}

/* Single column on medium screens */
@media (max-width: 1200px) {
  .featured-category {
    width: 100%;
    margin-right: 0;
  }
}

.featured-category i {
  font-size: 32px;
  color: #4a9eff;
  text-shadow: 0 2px 10px rgba(74, 158, 255, 0.5);
  display: inline-block;
  vertical-align: middle;
  margin-right: 15px;
  transition: transform 0.3s ease;
}

.featured-category:hover i {
  transform: scale(1.1) rotate(5deg);
}

.category-name {
  display: inline-block;
  font-weight: 600;
  font-size: 20px;
  color: #e0e0e0;
  margin-bottom: 15px;
}

.article-headline {
  margin-left: 0;
  padding: 15px 0;
  border-top: 1px solid rgba(58, 58, 78, 0.5);
  transition: all 0.3s ease;
}

.article-headline:first-of-type {
  border-top: none;
  padding-top: 20px;
}

.article-headline:hover {
  padding-left: 10px;
  background: rgba(74, 158, 255, 0.05);
  border-radius: 6px;
}

.article-title {
  font-weight: 500;
  font-size: 15px;
  color: #c0c0c0;
  margin-bottom: 8px;
}

.article-title a {
  color: #4a9eff;
  transition: all 0.3s ease;
  text-decoration: none;
}

.article-title a:hover {
  color: #6bb3ff;
  text-decoration: none;
  padding-left: 5px;
}

.article-teaser {
  font-size: 13px;
  line-height: 1.6em;
  height: auto;
  max-height: 3em;
  overflow: hidden;
  color: #999;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Section Headers */
#landing_page > div > h1 {
  font-size: 28px;
  color: #e0e0e0;
  margin-bottom: 30px;
  margin-top: 40px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(74, 158, 255, 0.3);
  position: relative;
  font-weight: 600;
  text-align: center;
}

#landing_page > div > h1::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #4a9eff 50%, transparent 100%);
}

#landing_page h1, #landing_page h2, #landing_page h3 {
  margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .featured-category {
    width: 100%;
    margin-right: 0;
  }
  
  .search-form form {
    flex-direction: column;
  }
  
  .search-form input.search {
    width: 100%;
    min-width: 100%;
  }
  
  .search-form button {
    width: 100%;
  }
  
  .thread-body {
    padding: 25px;
  }
  
  .thread-body h1 {
    font-size: 24px;
  }
  
  #landing_page {
    flex-direction: column;
  }
  
  #landing_page .sidebar {
    flex: 1;
    max-width: 100%;
    order: -1;
  }
  
  #content {
    padding: 20px 3%;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  #landing_page .sidebar {
    flex: 0 0 280px;
    max-width: 280px;
  }
}

/* Global text color fixes */
.text, .content, .body, .description {
  color: #b0b0b0;
}

/* Ensure all white text is converted to appropriate dark theme colors */
[style*="color: white"],
[style*="color: #fff"],
[style*="color: #ffffff"],
[style*="color: rgb(255, 255, 255)"] {
  color: #c0c0c0 !important;
}

/* List items */
ul li, ol li {
  color: #b0b0b0;
}

/* Form labels */
label, .label {
  color: #b0b0b0;
}

/* Paragraphs */
p {
  color: #b0b0b0;
}

/* Divs */
div {
  color: inherit;
}

/* Spans */
span {
  color: inherit;
}

/* Strong and bold */
strong, b {
  color: #c0c0c0;
}

/* Emphasis */
em, i {
  color: inherit;
}

/* Links in various contexts */
a {
  color: #4a9eff;
}

a:visited {
  color: #6bb3ff;
}

/* Buttons text */
button, .button, input[type="submit"], input[type="button"] {
  color: #fff;
}

/* Dropdown options - Force dark theme */
option {
  background: #252538 !important;
  background-color: #252538 !important;
  color: #e0e0e0 !important;
}

optgroup {
  background: #1e1e2e !important;
  background-color: #1e1e2e !important;
  color: #4a9eff !important;
  font-weight: 600;
}

/* Additional select fixes */
select[multiple] {
  background: #252538 !important;
  color: #e0e0e0 !important;
}

select[multiple] option {
  background: #252538 !important;
  color: #e0e0e0 !important;
}

select[multiple] option:checked {
  background: #4a9eff !important;
  color: #fff !important;
}

/* Datalist options */
datalist {
  background: #252538 !important;
  color: #e0e0e0 !important;
}

datalist option {
  background: #252538 !important;
  color: #e0e0e0 !important;
}

/* Placeholder text */
::-webkit-input-placeholder {
  color: #888;
}

::-moz-placeholder {
  color: #888;
}

:-ms-input-placeholder {
  color: #888;
}

:-moz-placeholder {
  color: #888;
}

/* Disabled elements */
input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  color: #666;
  opacity: 0.6;
}

/* Code blocks */
code, pre {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #3a3a4e;
}

pre {
  padding: 12px;
  overflow-x: auto;
}

/* Blockquote */
blockquote {
  color: #b0b0b0;
  border-left-color: #4a9eff;
}

/* Small text */
small {
  color: #999;
}

/* Caption */
caption {
  color: #c0c0c0;
}

/* Legend */
legend {
  color: #c0c0c0;
}

/* Fieldset */
fieldset {
  border-color: #3a3a4e;
}

/* HR */
hr {
  border-top-color: #3a3a4e;
}

/* ========================================
   AGGRESSIVE DARK THEME ENFORCEMENT
   ======================================== */

/* Force all white/light backgrounds to dark */
*[style*="background: white"],
*[style*="background: #fff"],
*[style*="background: #ffffff"],
*[style*="background-color: white"],
*[style*="background-color: #fff"],
*[style*="background-color: #ffffff"],
*[style*="background-color: rgb(255, 255, 255)"] {
  background: #252538 !important;
  background-color: #252538 !important;
}

/* Force all light gray backgrounds to dark */
*[style*="background: #ccc"],
*[style*="background: #ddd"],
*[style*="background: #eee"],
*[style*="background: #f0f0f0"],
*[style*="background-color: #ccc"],
*[style*="background-color: #ddd"],
*[style*="background-color: #eee"],
*[style*="background-color: #f0f0f0"] {
  background: #252538 !important;
  background-color: #252538 !important;
}

/* Force all black text on light backgrounds to light text */
*[style*="color: black"],
*[style*="color: #000"],
*[style*="color: #000000"],
*[style*="color: rgb(0, 0, 0)"] {
  color: #c0c0c0 !important;
}

/* Force all dark gray text to light gray */
*[style*="color: #333"],
*[style*="color: #444"],
*[style*="color: #555"],
*[style*="color: #666"] {
  color: #b0b0b0 !important;
}

/* Ensure all form elements have dark backgrounds */
input:not([type="submit"]):not([type="button"]):not([type="reset"]),
textarea,
select {
  background: #252538 !important;
  background-color: #252538 !important;
  color: #e0e0e0 !important;
  border-color: #3a3a4e !important;
}

/* All divs, spans, and containers */
div:not(.button):not([class*="icon"]),
span:not(.button):not([class*="icon"]) {
  background-color: transparent;
}

/* Specific fixes for common white areas */
.content-area,
.main-area,
.form-area,
.input-area,
.select-area,
.dropdown-area {
  background: #1e1e2e !important;
  color: #c0c0c0 !important;
}

/* Modal and popup backgrounds */
.modal,
.popup,
.dialog,
.overlay-content {
  background: #1e1e2e !important;
  color: #c0c0c0 !important;
}

/* Card and panel backgrounds */
.card,
.panel,
.box,
.container {
  background: #252538 !important;
  color: #c0c0c0 !important;
}

/* Ensure dropdown menus are dark */
.dropdown-menu,
.select-menu,
.context-menu {
  background: #252538 !important;
  color: #e0e0e0 !important;
  border: 1px solid #3a3a4e !important;
}

.dropdown-menu li,
.select-menu li,
.context-menu li {
  background: #252538 !important;
  color: #e0e0e0 !important;
}

.dropdown-menu li:hover,
.select-menu li:hover,
.context-menu li:hover {
  background: #2a2a3e !important;
  color: #4a9eff !important;
}

/* Autocomplete and suggestions */
.autocomplete,
.suggestions,
.typeahead {
  background: #252538 !important;
  color: #e0e0e0 !important;
  border: 1px solid #3a3a4e !important;
}

.autocomplete li,
.suggestions li,
.typeahead li {
  background: #252538 !important;
  color: #e0e0e0 !important;
}

.autocomplete li:hover,
.suggestions li:hover,
.typeahead li:hover {
  background: #2a2a3e !important;
  color: #4a9eff !important;
}

/* Tooltips */
.tooltip,
[data-tooltip] {
  background: #2a2a3e !important;
  color: #e0e0e0 !important;
  border: 1px solid #3a3a4e !important;
}

/* Ensure all text is visible */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fix for any remaining light backgrounds */
body * {
  background-color: inherit;
}

body *:not(input):not(select):not(textarea):not(button):not(.button):not(a) {
  color: inherit;
}

/* FAQ */
#faq {
  clear: both;
  margin: 0;
  padding: 5px;
}

#faq ol {
  font-size: 15px;
  margin-left: 0;
  padding-left: 0;
  border-top: 1px solid #2a2a3e;
}

#faq ol li {
  list-style: none;
  margin: 0;
  padding: 0;
  color: #888;
}

#faq ol li a {
  display: block;
  padding: 12px 0 12px 35px;
  margin: 0;
  border-bottom: 1px solid #2a2a3e;
  line-height: 20px;
  background: url('../images/icons/page.png') 5px 50% no-repeat;
  transition: all 0.3s ease;
  border-radius: 4px;
}

#faq ol li a:hover {
  background-color: rgba(74, 158, 255, 0.1);
  padding-left: 40px;
  text-decoration: none;
}

#faq .article-meta {
  padding: 10px;
  background: #252538;
  border-radius: 6px;
  margin-top: 10px;
}

/* Knowledge Base */
#kb {
  margin: 2px 0;
  padding: 5px;
  overflow: hidden;
}

#kb > li {
  padding: 15px;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #252538 0%, #1e1e2e 100%);
  border: 1px solid #2a2a3e;
  border-radius: 8px;
  display: block;
  transition: all 0.3s ease;
}

#kb > li:hover {
  border-color: #4a9eff;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.2);
}

#kb > li h4 span {
  color: #888;
}

#kb > li h4 a {
  font-size: 16px;
  color: #c0c0c0;
}

#kb > li h4 a:hover {
  color: #4a9eff;
}

#kb > li > i {
  display: block;
  width: 32px;
  height: 32px;
  float: left;
  margin-right: 10px;
  background: url(../images/kb_large_folder.png) top left no-repeat;
  filter: brightness(1.2);
}

.featured-category {
  margin-top: 15px;
  width: calc(50% - 10px);
  display: inline-block;
  box-sizing: border-box;
  vertical-align: top;
  padding: 15px;
  background: #252538;
  border-radius: 8px;
  border: 1px solid #2a2a3e;
  transition: all 0.3s ease;
  margin-right: 10px;
}

.featured-category:nth-child(even) {
  margin-right: 0;
}

.featured-category:hover {
  border-color: #4a9eff;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.2);
}

.category-name {
  display: inline-block;
  font-weight: 500;
  font-size: 120%;
  color: #e0e0e0;
}

.featured-category i {
  color: #4a9eff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  display: inline-block;
  vertical-align: middle;
}

.article-headline {
  margin-left: 34px;
}

.rtl .article-headline {
  margin-left: 0;
  margin-right: 34px;
}

.article-teaser {
  font-size: 90%;
  line-height: 1.5em;
  height: 3em;
  overflow: hidden;
  color: #b0b0b0;
}

.article-title {
  font-weight: 500;
  color: #e0e0e0;
}

.faq-content .article-title {
  font-size: 17pt;
  margin-top: 15px;
  color: #4a9eff;
}

/* KB Search */
#kb-search {
  padding: 15px 0;
  overflow: hidden;
}

#kb-search div {
  clear: both;
  overflow: hidden;
  padding-top: 5px;
}

#kb-search #query {
  margin: 0;
  display: inline-block;
  float: left;
  width: 200px;
  margin-right: 10px;
  padding: 8px 12px;
  background: #252538;
  border: 1px solid #3a3a4e;
  border-radius: 6px;
  color: #e0e0e0;
}

#kb-search #cid {
  margin: 0;
  display: inline-block;
  float: left;
  width: 200px;
  margin-right: 10px;
  padding: 8px 12px;
  background: #252538;
  border: 1px solid #3a3a4e;
  border-radius: 6px;
  color: #e0e0e0;
}

#kb-search #topic-id {
  margin: 0;
  display: inline-block;
  float: left;
  width: 410px;
  padding: 8px 12px;
  background: #252538;
  border: 1px solid #3a3a4e;
  border-radius: 6px;
  color: #e0e0e0;
}

#kb-search #searchSubmit {
  margin: 0;
  display: inline-block;
  float: left;
}

#kb-search #breadcrumbs {
  color: #b0b0b0;
  margin-bottom: 15px;
}

#kb-search #breadcrumbs a {
  color: #4a9eff;
}

/* Forms */
#ticketForm div.clear,
#clientLogin div.clear {
  clear: both;
  padding: 8px 0;
  overflow: hidden;
}

#ticketForm div label,
#clientLogin div label {
  display: block;
  color: #c0c0c0;
  font-weight: 500;
  margin-bottom: 5px;
}

label.required, span.required {
  font-weight: bold;
  color: #4a9eff;
}

label.required::after, span.required::after {
  content: " *";
  color: #ff6b6b;
}

#ticketForm div label.required,
#clientLogin div label.required {
  text-align: left;
}

#ticketForm div input,
#clientLogin div input,
#ticketForm div textarea,
#clientLogin div textarea {
  width: auto;
  border: 1px solid #3a3a4e;
  background: #252538;
  color: #e0e0e0;
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

#ticketForm div input:focus,
#clientLogin div input:focus,
#ticketForm div textarea:focus,
#clientLogin div textarea:focus {
  border-color: #4a9eff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

#ticketForm div input[type=file],
#clientLogin div input[type=file] {
  border: 0;
  background: transparent;
  padding: 5px 0;
}

#ticketForm div select,
#clientLogin div select {
  display: block;
  float: left;
  padding: 10px 12px;
  background: #252538 !important;
  border: 1px solid #3a3a4e;
  border-radius: 6px;
  color: #e0e0e0 !important;
  transition: all 0.3s ease;
}

#ticketForm div select:focus,
#clientLogin div select:focus {
  border-color: #4a9eff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

#ticketForm div select option,
#clientLogin div select option {
  background: #252538 !important;
  color: #e0e0e0 !important;
}

#ticketForm div select optgroup,
#clientLogin div select optgroup {
  background: #1e1e2e !important;
  color: #4a9eff !important;
  font-weight: 600;
}

#ticketForm div div.captchaRow,
#clientLogin div div.captchaRow {
  line-height: 31px;
}

#ticketForm div div.captchaRow input,
#clientLogin div div.captchaRow input {
  position: relative;
  top: 6px;
}

#ticketForm > table {
  table-layout: fixed;
}

#ticketForm > table td {
  width: 160px;
  color: #c0c0c0;
}

#ticketForm > table td + td {
  width: auto;
}

#ticketForm td textarea,
#clientLogin td textarea,
#ticketForm div textarea,
#clientLogin div textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#ticketForm td em,
#clientLogin td em,
#ticketForm div em,
#clientLogin div em {
  color: #888;
  font-size: 0.9em;
}

#ticketForm td .captcha,
#clientLogin td .captcha,
#ticketForm div .captcha,
#clientLogin div .captcha {
  width: 88px;
  height: 31px;
  background: #000;
  display: block;
  float: left;
  margin-right: 20px;
  border-radius: 4px;
}

#ticketForm td label.inline,
#clientLogin td label.inline,
#ticketForm div label.inline,
#clientLogin div label.inline {
  width: auto;
  padding: 0 10px;
  display: inline;
}

#ticketForm div.error input,
#clientLogin div.error input {
  border: 1px solid #ff6b6b !important;
  background: rgba(255, 107, 107, 0.1);
}

#ticketForm div.error label,
#clientLogin div.error label {
  color: #ff6b6b;
}

/* Client Login */
#clientLogin {
  display: block;
  margin-top: 20px;
  padding: 30px;
  border: 1px solid #3a3a4e;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #252538 0%, #1e1e2e 100%);
  position: relative;
}

#clientLogin::before {
  content: "🔒";
  position: absolute;
  right: 30px;
  top: 30px;
  font-size: 48px;
  opacity: 0.3;
}

.rtl #clientLogin::before {
  right: auto;
  left: 30px;
}

#clientLogin .instructions {
  display: table-cell;
  padding-left: 2em;
  padding-right: 90px;
  color: #b0b0b0;
}

.rtl #clientLogin .instructions {
  padding-left: 90px;
  padding-right: 2em;
}

#clientLogin p {
  clear: both;
  margin-bottom: 15px;
}

#clientLogin strong {
  font-size: 12px;
  color: #ff6b6b;
  display: block;
  margin-top: 5px;
}

#clientLogin #email,
#clientLogin #ticketno {
  margin-right: 0;
  width: 100%;
  max-width: 400px;
}

#clientLogin input[type=text],
#clientLogin input[type=password] {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 15px;
}

#clientLogin input[type=submit] {
  padding: 10px 24px;
  border-radius: 6px;
}

/* Ticket Tables */
#ticketTable th {
  padding-left: 3px;
  font-weight: 600;
  text-align: left;
  color: #c0c0c0;
}

#ticketTable th.required,
#ticketTable td.required {
  font-weight: bold;
  text-align: left;
  color: #c0c0c0;
}

#ticketTable {
  border: 1px solid #3a3a4e;
  border-left: none;
  border-bottom: none;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

#ticketTable caption {
  padding: 12px;
  text-align: left;
  color: #c0c0c0;
  background: #252538;
  border: 1px solid #3a3a4e;
  border-bottom: none;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
}

#ticketTable th {
  height: 36px;
  line-height: 36px;
  background: linear-gradient(135deg, #2a2a3e 0%, #252538 100%);
  border: 1px solid #3a3a4e;
  border-right: none;
  border-top: none;
  padding: 0 12px;
}

#ticketTable th a {
  color: #4a9eff;
  font-weight: 600;
}

#ticketTable td {
  padding: 10px 12px;
  border: 1px solid #3a3a4e;
  border-right: none;
  border-top: none;
  color: #c0c0c0;
}

#ticketTable tr.alt td {
  background: rgba(255, 255, 255, 0.02);
}

#ticketTable tr:hover td {
  background: rgba(74, 158, 255, 0.1);
}

/* Reply Section */
#reply {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #252538 0%, #1e1e2e 100%);
  border: 1px solid #3a3a4e;
  border-radius: 10px;
}

#reply h2 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(74, 158, 255, 0.3);
  color: #4a9eff;
}

#reply > table {
  width: auto;
}

#reply table td {
  vertical-align: top;
  color: #c0c0c0;
}

#reply textarea {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  background: #1e1e2e;
  border: 1px solid #3a3a4e;
  color: #e0e0e0;
  padding: 12px;
  border-radius: 6px;
}

#reply input[type=text],
#reply #response_options textarea {
  border: 1px solid #3a3a4e;
  background: #1e1e2e;
  color: #e0e0e0;
}

/* Ticket Icons */
.Icon {
  width: auto;
  padding-left: 24px;
  background-position: top left;
  background-repeat: no-repeat;
  color: #4a9eff;
  text-decoration: none;
}

.Icon.Ticket {
  background-image: url('../images/icons/ticket.gif');
}

.Icon.webTicket {
  background-image: url('../images/icons/ticket_source_web.gif');
}

.Icon.emailTicket {
  background-image: url('../images/icons/ticket_source_email.gif');
}

.Icon.phoneTicket {
  background-image: url('../images/icons/ticket_source_phone.gif');
}

.Icon.otherTicket, .Icon.apiTicket {
  background-image: url('../images/icons/ticket_source_other.gif');
}

.Icon.attachment {
  background-image: url('../images/icons/attachment.gif');
}

.Icon.file {
  background-image: url('../images/icons/attachment.gif');
}

.Icon.refresh {
  background-image: url('../images/icons/refresh.gif');
}

.Icon.thread {
  font-weight: bold;
  font-size: 1em;
  background-image: url('../images/icons/thread.gif');
}

i.refresh {
  color: #28a745;
  font-size: 80%;
  vertical-align: middle;
}

.states small {
  font-size: 70%;
  color: #888;
}

.active.state {
  font-weight: bold;
  color: #4a9eff;
}

.search.well {
  padding: 15px;
  background: rgba(74, 158, 255, 0.05);
  margin-bottom: 15px;
  margin-top: -15px;
  border-radius: 8px;
  border: 1px solid #3a3a4e;
}

.infoTable {
  background: #252538;
  border-radius: 8px;
  overflow: hidden;
}

.infoTable th {
  text-align: left;
  padding: 10px 12px;
  background: #2a2a3e;
  color: #c0c0c0;
  font-weight: 600;
}

.infoTable td {
  padding: 10px 12px;
  color: #b0b0b0;
}

/* Action Buttons */
.action-button {
  border-radius: 6px;
  color: #c0c0c0 !important;
  display: inline-block;
  border: 1px solid #3a3a4e;
  cursor: pointer;
  font-size: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #2a2a3e 0%, #252538 100%);
  padding: 6px 12px;
  text-decoration: none;
  line-height: 20px;
  margin-left: 5px;
  transition: all 0.3s ease;
}

.action-button:hover {
  background: linear-gradient(135deg, #3a3a4e 0%, #2a2a3e 100%);
  border-color: #4a9eff;
  color: #4a9eff !important;
}

.action-button span,
.action-button a {
  color: #c0c0c0 !important;
  display: inline-block;
  float: left;
}

.action-button:hover span,
.action-button:hover a {
  color: #4a9eff !important;
}

.action-button a {
  text-decoration: none;
}

table.padded tr > td,
table.padded tr > th {
  height: 20px;
  padding-bottom: 8px;
}

/* External Authentication */
.external-auth + .external-auth {
  margin-top: 8px;
}

a.external-sign-in {
  text-decoration: none;
}

.external-auth-box {
  vertical-align: middle;
  border-radius: 8px;
  border: 1px solid #3a3a4e;
  background: #252538;
  transition: all 0.3s ease;
}

.external-auth-box:hover {
  border-color: #4a9eff;
  box-shadow: 0 2px 10px rgba(74, 158, 255, 0.2);
}

.external-auth-icon {
  display: inline-block;
  color: #c0c0c0;
  width: 30px;
  padding: 8px 12px;
  border-right: 1px solid #3a3a4e;
}

.external-auth-name {
  color: #c0c0c0;
  width: 100px;
  padding: 8px 12px;
  line-height: 30px;
  font-size: 11pt;
}

img.sign-in-image {
  border: none;
  max-height: 40px;
  max-width: 200px;
  width: auto;
  height: auto;
}

.login-box {
  width: 40%;
  display: table-cell;
  box-shadow: 12px 0 15px -15px rgba(0, 0, 0, 0.4);
  padding: 15px;
}

.rtl .login-box {
  box-shadow: -12px 0 15px -15px rgba(0, 0, 0, 0.4);
}

.flush-right {
  text-align: right;
}

.flush-left {
  text-align: left;
}

/* Sidebar */
.sidebar {
  margin-bottom: 20px;
  margin-left: 0;
  width: 100%;
  max-width: 280px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.rtl .sidebar {
  margin-left: 0;
  margin-right: 0;
}

.sidebar.pull-right {
  float: none !important;
}

.sidebar .content {
  padding: 20px;
  border: 1px solid #3a3a4e;
  background: linear-gradient(135deg, #252538 0%, #1e1e2e 100%);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.sidebar .content:hover {
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.sidebar .content:empty {
  display: none;
}

.sidebar section .header {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 15px;
  color: #4a9eff;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(74, 158, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 13px;
}

.sidebar section + section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(58, 58, 78, 0.5);
}

.sidebar section div {
  margin-bottom: 12px;
}

.sidebar section div:last-child {
  margin-bottom: 0;
}

.sidebar section div a {
  color: #c0c0c0;
  text-decoration: none;
  transition: all 0.3s ease;
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  position: relative;
  padding-left: 30px;
}

.sidebar section div a::before {
  content: '→';
  position: absolute;
  left: 12px;
  color: #4a9eff;
  transition: all 0.3s ease;
}

.sidebar section div a:hover {
  background: rgba(74, 158, 255, 0.1);
  color: #4a9eff;
  padding-left: 35px;
  text-decoration: none;
}

.sidebar section div a:hover::before {
  left: 15px;
}

@media (max-width: 992px) {
  .sidebar {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    margin-bottom: 30px;
    order: 1 !important;
  }
  
  #landing_page .main-content {
    order: 2 !important;
    max-width: 100% !important;
  }
  
  .rtl .sidebar {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Search */
.search-form {
  padding-top: 12px;
}

.searchbar .search,
.search-form .search {
  display: inline-block;
  width: 100%;
  max-width: 600px;
  border-radius: 8px;
  border: 1px solid #3a3a4e;
  padding: 10px 15px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  background: #252538;
  color: #e0e0e0;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.searchbar .search:focus,
.search-form .search:focus {
  border-color: #4a9eff;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.searchbar .search {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.bleed {
  margin: 0 !important;
  padding: 0 !important;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
  width: 100%;
  box-sizing: border-box;
}

.span4 {
  flex: 1 1 calc(33.333% - 20px);
  min-width: 280px;
  margin: 10px;
  box-sizing: border-box;
}

.span8 {
  flex: 1 1 calc(66.666% - 20px);
  min-width: 280px;
  margin: 10px;
  box-sizing: border-box;
}

.truncate {
  display: inline-block;
  width: auto;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.image-hover a.action-button:hover,
.image-hover a.action-button {
  color: initial !important;
  text-decoration: none;
}

/* Custom Data Tables */
table.custom-data {
  margin-top: 15px;
  border-radius: 8px;
  overflow: hidden;
}

table.custom-data th {
  width: 25%;
  background: #2a2a3e;
  padding: 10px 12px;
  color: #e0e0e0;
  font-weight: 600;
}

table.custom-data td {
  padding: 10px 12px;
  color: #c0c0c0;
}

table .headline,
table.custom-data .headline {
  border-bottom: 2px solid #3a3a4e;
  font-weight: bold;
  background: #252538;
  color: #4a9eff;
}

/* Ticket Info */
#ticketInfo h1 {
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 2px solid rgba(74, 158, 255, 0.3);
  color: #4a9eff;
}

#ticketInfo h1 small {
  font-weight: normal;
  color: #888;
}

/* Thread Entries */
.thread-entry {
  margin-bottom: 20px;
}

.thread-entry.avatar {
  margin-left: 60px;
}

.thread-entry.response.avatar {
  margin-right: 60px;
  margin-left: 0;
}

.thread-entry > .avatar {
  margin-left: -60px;
  display: inline-block;
  width: 48px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.thread-entry.response > .avatar {
  margin-left: initial;
  margin-right: -60px;
}

img.avatar {
  border-radius: inherit;
}

.avatar > img.avatar {
  width: 100%;
  height: auto;
}

.thread-entry .header {
  padding: 12px 15px;
  border: 1px solid #3a3a4e;
  border-radius: 8px 8px 0 0;
  background: #252538;
}

.thread-entry.avatar .header:before {
  position: absolute;
  top: 12px;
  right: -8px;
  content: '';
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #3a3a4e;
  display: inline-block;
}

.thread-entry.avatar .header:after {
  position: absolute;
  top: 12px;
  right: -8px;
  content: '';
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  display: inline-block;
  margin-top: 1px;
}

.thread-entry.avatar .header {
  position: relative;
}

.thread-entry.response .header {
  background: linear-gradient(135deg, #2a2a3e 0%, #252538 100%);
}

.thread-entry.avatar.response .header:after {
  border-left: 7px solid #2a2a3e;
  margin-right: 1px;
}

.thread-entry.message .header {
  background: linear-gradient(135deg, #357abd 0%, #4a9eff 100%);
}

.thread-entry.avatar.message .header:before {
  top: 12px;
  left: -8px;
  right: initial;
  border-left: none;
  border-right: 8px solid #3a3a4e;
}

.thread-entry.avatar.message .header:after {
  top: 12px;
  left: -8px;
  right: initial;
  border-left: none;
  border-right: 7px solid #357abd;
  margin-left: 1px;
}

.thread-entry .header .title {
  max-width: 500px;
  vertical-align: bottom;
  display: inline-block;
  margin-left: 15px;
  color: #c0c0c0;
  font-weight: 500;
}

.thread-entry.message .header .title {
  color: #e0e0e0;
}

.thread-entry .thread-body {
  border: 1px solid #3a3a4e;
  border-top: none;
  border-bottom: 2px solid #3a3a4e;
  border-radius: 0 0 8px 8px;
  background: #1e1e2e;
  padding: 15px;
  color: #c0c0c0;
  line-height: 1.6;
}

.thread-body .attachments {
  background: #252538;
  margin: 15px -15px -15px;
  padding: 12px 15px;
  border-top: 1px solid #3a3a4e;
  border-radius: 0 0 8px 8px;
}

.thread-body .attachments .filesize {
  margin-left: 0.5em;
  color: #888;
}

.thread-body .attachments a,
.thread-body .attachments a:hover {
  text-decoration: none;
  color: #4a9eff;
}

.thread-body .attachment-info {
  margin-right: 10px;
  display: inline-block;
  width: 48%;
}

.thread-body .attachment-info .filename {
  max-width: 80%;
  max-width: calc(100% - 70px);
}

/* Labels */
.label {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  line-height: 16px;
  color: #ffffff;
  vertical-align: baseline;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
  display: inline-block;
}

.label-bare {
  background: transparent;
  border: 1px solid #4a9eff;
  color: #4a9eff;
  text-shadow: none;
}

/* Thread Events */
.thread-event {
  padding: 0px 2px 20px;
  margin-left: 60px;
  color: #888;
}

.type-icon {
  border-radius: 10px;
  background: #252538;
  padding: 6px 8px;
  margin-right: 8px;
  text-align: center;
  display: inline-block;
  font-size: 1.1em;
  border: 1px solid #3a3a4e;
  vertical-align: top;
  color: #4a9eff;
}

.type-icon.dark {
  border-color: #4a9eff;
  background: #2a2a3e;
  color: #6bb3ff;
}

.thread-event img.avatar {
  vertical-align: middle;
  border-radius: 4px;
  width: auto;
  max-height: 24px;
  margin: -3px 3px 0;
}

.thread-event .description {
  margin-left: -30px;
  padding-top: 6px;
  padding-left: 30px;
  display: inline-block;
  width: 642px;
  width: calc(100% - 95px);
  line-height: 1.6em;
  color: #b0b0b0;
}

.thread-event .type-icon {
  position: relative;
}

.thread-event .type-icon::after {
  content: "";
  border: 16px solid #1e1e2e;
  position: absolute;
  top: -3px;
  bottom: 0;
  left: -3px;
  right: 0;
  z-index: -1;
}

.thread-entry::after {
  content: "";
  border-bottom: 2px solid #1e1e2e;
  display: block;
}

.thread-entry::before {
  content: "";
  display: block;
  border-top: 2px solid #1e1e2e;
}

#ticketThread::before {
  border-left: 2px dotted #3a3a4e;
  position: absolute;
  margin-left: 74px;
  z-index: -1;
  content: "";
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
}

#ticketThread {
  z-index: 0;
  position: relative;
  border-bottom: 2px solid #3a3a4e;
}

/* Freetext Files */
.freetext-files {
  padding: 15px;
  margin-top: 15px;
  border: 1px solid #3a3a4e;
  border-radius: 8px;
  background: #252538;
}

.freetext-files .file {
  margin-right: 10px;
  display: inline-block;
  width: 48%;
  padding-top: 0.3em;
}

.freetext-files .title {
  font-weight: 600;
  margin-bottom: 0.5em;
  font-size: 1.1em;
  color: #4a9eff;
}

/* Scrollbar Styling (Webkit browsers) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: #3a3a4e;
  border-radius: 6px;
  border: 2px solid #1a1a2e;
}

::-webkit-scrollbar-thumb:hover {
  background: #4a9eff;
}

/* Selection */
::selection {
  background: rgba(74, 158, 255, 0.3);
  color: #fff;
}

::-moz-selection {
  background: rgba(74, 158, 255, 0.3);
  color: #fff;
}

/* Input Placeholders */
::-webkit-input-placeholder {
  color: #666;
}

::-moz-placeholder {
  color: #666;
}

:-ms-input-placeholder {
  color: #666;
}

::placeholder {
  color: #666;
}

/* Focus Visible */
*:focus-visible {
  outline: 2px solid #4a9eff;
  outline-offset: 2px;
}

/* Responsive adjustments */

/* Large Screens */
@media (min-width: 1600px) {
  #content {
    padding: 40px 8%;
  }
  
  #header,
  #nav {
    padding-left: 8%;
    padding-right: 8%;
  }
  
  h1 {
    font-size: 28px;
  }
  
  h2, .subject {
    font-size: 20px;
  }
}

@media (max-width: 1200px) {
  #content {
    padding: 25px 4%;
  }
  
  #header,
  #nav {
    padding-left: 4%;
    padding-right: 4%;
  }
}

@media (max-width: 960px) {
  #container {
    width: 100%;
  }
  
  #content {
    padding: 20px 3%;
  }
  
  #header,
  #nav {
    padding-left: 3%;
    padding-right: 3%;
  }
  
  #header {
    height: auto;
    min-height: 70px;
    padding-top: 15px;
    padding-bottom: 15px;
  }
  
  #nav {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  
  #nav li a {
    padding: 0 15px 0 40px;
    margin-right: 5px;
    font-size: 14px;
  }
  
  .featured-category {
    width: 100%;
    margin-bottom: 15px;
  }
  
  #ticketForm td textarea,
  #clientLogin td textarea,
  #ticketForm div textarea,
  #clientLogin div textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  #reply textarea {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .span4,
  .span8 {
    width: 100%;
    display: block;
    margin: 10px 0;
  }
  
  #ticketTable {
    font-size: 13px;
  }
  
  #ticketTable th,
  #ticketTable td {
    padding: 8px 6px;
  }
  
  .thread-entry.avatar {
    margin-left: 0;
  }
  
  .thread-entry.response.avatar {
    margin-right: 0;
  }
  
  .thread-entry > .avatar {
    display: none;
  }
  
  .thread-event {
    margin-left: 0;
  }
  
  #ticketThread::before {
    display: none;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 13px;
  }
  
  #content {
    padding: 15px 2%;
  }
  
  #header,
  #nav {
    padding-left: 2%;
    padding-right: 2%;
  }
  
  h1 {
    font-size: 20px;
  }
  
  h2, .subject {
    font-size: 16px;
  }
  
  h3 {
    font-size: 14px;
  }
  
  #nav li a {
    padding: 0 12px 0 35px;
    margin-right: 3px;
    font-size: 13px;
    height: 32px;
    line-height: 32px;
  }
  
  .button {
    font-size: 14px;
    padding: 8px 18px;
    max-width: 100%;
  }
  
  #clientLogin {
    padding: 20px;
  }
  
  #clientLogin::before {
    display: none;
  }
  
  #clientLogin .instructions {
    padding-left: 0;
    padding-right: 0;
    display: block;
  }
  
  .login-box {
    width: 100%;
    display: block;
    box-shadow: none;
    padding: 10px 0;
  }
  
  #kb-search #query,
  #kb-search #cid,
  #kb-search #topic-id {
    width: 100%;
    margin-bottom: 10px;
    float: none;
    display: block;
  }
  
  #kb-search #searchSubmit {
    float: none;
    display: block;
    width: 100%;
  }
  
  .searchbar .search,
  .search-form .search {
    width: 100%;
    box-sizing: border-box;
  }
  
  #ticketTable {
    font-size: 12px;
    display: block;
    overflow-x: auto;
  }
  
  .sidebar {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 20px;
  }
  
  .thread-body .attachment-info {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .thread-event .description {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
  }
  
  #pagination li a,
  #pagination .active,
  #pagination .previousOff,
  #pagination .nextOff {
    padding: 5px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  #content {
    padding: 10px 2%;
  }
  
  #header {
    padding: 10px 2%;
    min-height: 60px;
  }
  
  #nav {
    padding: 10px 2%;
  }
  
  #nav li a {
    padding: 0 10px 0 30px;
    margin-right: 2px;
    font-size: 12px;
    height: 28px;
    line-height: 28px;
    background-size: 16px;
    background-position: 8px 50%;
  }
  
  h1 {
    font-size: 18px;
  }
  
  h2, .subject {
    font-size: 15px;
  }
  
  .button {
    font-size: 13px;
    padding: 7px 15px;
  }
  
  #msg_notice,
  #msg_warning,
  #msg_error,
  #msg_info {
    padding: 10px 10px 10px 35px;
    font-size: 13px;
  }
  
  #msg_notice::before,
  #msg_warning::before,
  #msg_error::before,
  #msg_info::before {
    left: 10px;
    font-size: 16px;
  }
  
  .card {
    padding: 15px;
  }
  
  #ticketTable th,
  #ticketTable td {
    padding: 6px 4px;
    font-size: 11px;
  }
  
  .thread-entry .header {
    padding: 10px;
  }
  
  .thread-entry .thread-body {
    padding: 10px;
  }
  
  .action-button {
    font-size: 11px;
    padding: 5px 10px;
    margin-left: 3px;
  }
}

/* Print Styles */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  
  #container {
    box-shadow: none;
    border: none;
  }
  
  #nav, #footer {
    display: none;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.thread-entry {
  animation: fadeIn 0.3s ease;
}

/* Additional Modern Touches */
.card {
  background: #252538;
  border: 1px solid #3a3a4e;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.2);
  border-color: #4a9eff;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 12px;
  background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
}

.badge.success {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.badge.warning {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.badge.danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.badge.info {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

/* Status indicators */
.status-open {
  color: #28a745;
}

.status-closed {
  color: #6c757d;
}

.status-pending {
  color: #ffc107;
}

.status-resolved {
  color: #17a2b8;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #2a2a3e;
  color: #e0e0e0;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  border: 1px solid #3a3a4e;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}
