/* ============================================================
   YBS Destek — Bootstrap 5 Tema
   Versiyon 2.0 — Mobil Uyumlu, Modern Tasarım
   ============================================================ */

/* ---- Değişkenler ---- */
:root {
  --ybs-primary:      #1a3c6b;
  --ybs-primary-dark: #122d52;
  --ybs-accent:       #0d6efd;
  --ybs-accent-hover: #0b5ed7;
  --ybs-success:      #198754;
  --ybs-warning:      #fd7e14;
  --ybs-danger:       #dc3545;
  --ybs-light:        #f8f9fa;
  --ybs-text:         #212529;
  --ybs-text-muted:   #6c757d;
  --ybs-border:       #dee2e6;
  --ybs-shadow:       0 2px 12px rgba(0,0,0,.08);
  --ybs-radius:       0.625rem;
  --ybs-font:         'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ybs-font);
  background: #eef2f7;
  color: var(--ybs-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 0.9375rem;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.ybs-navbar {
  background: linear-gradient(135deg, var(--ybs-primary) 0%, #1e4d8c 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  padding: .625rem 0;
  z-index: 1050;
}
.ybs-logo-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
}
.ybs-brand-name {
  font-size: 1.2rem; font-weight: 800;
  color: #fff; letter-spacing: .5px;
  display: block; line-height: 1.1;
}
.ybs-brand-sub {
  font-size: .7rem; font-weight: 400;
  color: rgba(255,255,255,.7);
  display: block; letter-spacing: 1px;
  text-transform: uppercase;
}
.navbar-brand:hover .ybs-brand-name,
.navbar-brand:hover .ybs-brand-sub { color: #fff; opacity: .85; }

.ybs-nav-link {
  color: rgba(255,255,255,.85) !important;
  padding: .45rem .8rem !important;
  border-radius: .4rem;
  font-size: .875rem;
  font-weight: 500;
  transition: all .2s;
}
.ybs-nav-link:hover, .ybs-nav-link.active {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
}
.ybs-btn-login {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff !important;
}
.ybs-btn-login:hover {
  background: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.6);
  color: #fff !important;
}
.navbar-toggler {
  border: 1px solid rgba(255,255,255,.3);
  padding: .3rem .55rem;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.ybs-main { flex: 1; padding: 1.5rem 0 2rem; }
.ybs-content-wrapper { position: relative; }

/* ============================================================
   SIDEBAR & LAYOUT
   ============================================================ */
.ybs-sidebar { position: sticky; top: 80px; }

.ybs-action-card {
  background: #fff;
  border-radius: var(--ybs-radius);
  box-shadow: var(--ybs-shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.ybs-action-card .btn { border-radius: .5rem; font-weight: 600; padding: .65rem 1rem; }
.ybs-action-card .btn + .btn { margin-top: .5rem; }

.ybs-sidebar-section {
  background: #fff;
  border-radius: var(--ybs-radius);
  box-shadow: var(--ybs-shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.ybs-sidebar-section-header {
  background: var(--ybs-primary);
  color: #fff;
  padding: .625rem 1rem;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.ybs-sidebar-section-body { padding: .75rem 1rem; }
.ybs-sidebar-link {
  display: block;
  padding: .45rem 0;
  color: var(--ybs-primary);
  font-size: .875rem;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  transition: color .15s;
}
.ybs-sidebar-link:last-child { border-bottom: none; }
.ybs-sidebar-link:hover { color: var(--ybs-accent); text-decoration: none; }
.ybs-sidebar-link i { width: 18px; text-align: center; }

/* ============================================================
   HERO / HOME PAGE
   ============================================================ */
.ybs-hero {
  background: linear-gradient(135deg, var(--ybs-primary) 0%, #1e4d8c 100%);
  border-radius: var(--ybs-radius);
  color: #fff;
  padding: 2.5rem 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.ybs-hero h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: .5rem; }
.ybs-hero p { opacity: .85; font-size: 1rem; margin-bottom: 0; }

/* ============================================================
   CARDS
   ============================================================ */
.ybs-card {
  background: #fff;
  border-radius: var(--ybs-radius);
  box-shadow: var(--ybs-shadow);
  border: none;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.ybs-card-header {
  background: #fff;
  border-bottom: 2px solid #eef2f7;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .625rem;
}
.ybs-card-header h1, .ybs-card-header h2, .ybs-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ybs-primary);
  margin: 0;
}
.ybs-card-header .ybs-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--ybs-primary), var(--ybs-accent));
  border-radius: .5rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem;
  flex-shrink: 0;
}
.ybs-card-body { padding: 1.25rem; }

/* ============================================================
   PAGE TITLE BAR
   ============================================================ */
.ybs-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.ybs-page-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ybs-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ============================================================
   FORMS
   ============================================================ */
.ybs-form-label {
  font-weight: 600;
  font-size: .875rem;
  color: var(--ybs-text);
  margin-bottom: .35rem;
}
.ybs-form-control {
  border: 1.5px solid var(--ybs-border);
  border-radius: .4rem;
  padding: .55rem .8rem;
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.ybs-form-control:focus {
  border-color: var(--ybs-accent);
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
  outline: none;
}
/* Bootstrap form overrides */
.form-control:focus { border-color: var(--ybs-accent); box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); }
.form-select:focus { border-color: var(--ybs-accent); box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); }

/* Legacy table form fix */
table.form-table { width: 100% !important; }
table.form-table td:first-child { width: 160px; vertical-align: top; padding-top: .6rem; font-weight: 600; font-size: .875rem; }
table.form-table td input[type="text"],
table.form-table td input[type="email"],
table.form-table td textarea,
table.form-table td select {
  border: 1.5px solid var(--ybs-border);
  border-radius: .4rem;
  padding: .5rem .75rem;
  font-size: .875rem;
  transition: border-color .2s;
  max-width: 100%;
}
table.form-table td input[type="text"]:focus,
table.form-table td input[type="email"]:focus,
table.form-table td textarea:focus,
table.form-table td select:focus {
  border-color: var(--ybs-accent);
  outline: none;
}

/* Fix dynamic form tables */
table[width="800"] { width: 100% !important; }
td[width], th[width] { width: auto !important; }

/* Select2 Overrides */
.select2-container .select2-selection--single {
  height: auto !important;
  border: 1.5px solid var(--ybs-border) !important;
  border-radius: .4rem !important;
  padding: .5rem .75rem !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.5 !important;
  padding-left: 0 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px !important;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-ybs-primary {
  background: linear-gradient(135deg, var(--ybs-primary) 0%, #1e4d8c 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: .6rem 1.5rem;
  border-radius: .45rem;
  transition: all .2s;
}
.btn-ybs-primary:hover { background: linear-gradient(135deg, var(--ybs-primary-dark) 0%, #163d72 100%); color: #fff; }

/* Legacy button compatibility */
.button, input[type="submit"], input[type="button"] {
  display: inline-block;
  padding: .5rem 1.25rem;
  border-radius: .4rem;
  border: none;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: all .2s;
  background: var(--ybs-primary);
  color: #fff !important;
}
.button:hover, input[type="submit"]:hover, input[type="button"]:hover {
  background: var(--ybs-primary-dark);
  color: #fff !important;
  text-decoration: none;
}
.green.button { background: var(--ybs-success) !important; }
.green.button:hover { background: #157347 !important; }
.blue.button { background: var(--ybs-accent) !important; }
.blue.button:hover { background: var(--ybs-accent-hover) !important; }
.btn { border-radius: .4rem; font-weight: 500; }
.btn-primary { background: var(--ybs-accent); border-color: var(--ybs-accent); }
.btn-primary:hover { background: var(--ybs-accent-hover); border-color: var(--ybs-accent-hover); }

/* ============================================================
   TICKET TABLE
   ============================================================ */
.ybs-ticket-table { width: 100%; border-collapse: collapse; }
.ybs-ticket-table th {
  background: #f0f4f8;
  color: var(--ybs-primary);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: .75rem 1rem;
  border-bottom: 2px solid var(--ybs-border);
  white-space: nowrap;
}
.ybs-ticket-table td {
  padding: .75rem 1rem;
  font-size: .875rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.ybs-ticket-table tr:last-child td { border-bottom: none; }
.ybs-ticket-table tr:hover td { background: #f8faff; }
.ybs-ticket-table a { color: var(--ybs-accent); text-decoration: none; font-weight: 600; }
.ybs-ticket-table a:hover { text-decoration: underline; }

/* Status badges */
.ybs-status {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.ybs-status-open { background: #d1fae5; color: #065f46; }
.ybs-status-closed { background: #f3f4f6; color: #6b7280; }
.ybs-status-answered { background: #dbeafe; color: #1e40af; }

/* Old #ticketTable compatibility */
#ticketTable { width: 100% !important; }
#ticketTable th {
  background: #f0f4f8;
  color: var(--ybs-primary);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: .75rem 1rem;
  border-bottom: 2px solid var(--ybs-border);
}
#ticketTable td {
  padding: .7rem 1rem;
  font-size: .875rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
#ticketTable tr:hover td { background: #f8faff; }
#ticketTable th a { color: var(--ybs-primary); text-decoration: none; }
#ticketTable th a:hover { color: var(--ybs-accent); }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.ybs-search-bar {
  background: #fff;
  border-radius: var(--ybs-radius);
  box-shadow: var(--ybs-shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.search.well {
  background: #fff;
  border-radius: var(--ybs-radius);
  box-shadow: var(--ybs-shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: none;
}
.search.well input[type="text"] {
  border: 1.5px solid var(--ybs-border);
  border-radius: .4rem;
  padding: .45rem .75rem;
  font-size: .875rem;
}
.search.well input[type="submit"] {
  padding: .45rem 1rem;
  font-size: .875rem;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.ybs-login-wrapper {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.ybs-login-card {
  background: #fff;
  border-radius: var(--ybs-radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}
.ybs-login-header {
  background: linear-gradient(135deg, var(--ybs-primary) 0%, #1e4d8c 100%);
  padding: 2rem;
  text-align: center;
  color: #fff;
}
.ybs-login-header .ybs-logo-icon { margin: 0 auto 1rem; width: 56px; height: 56px; font-size: 1.5rem; }
.ybs-login-header h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: .25rem; }
.ybs-login-header p { opacity: .8; font-size: .875rem; margin: 0; }
.ybs-login-body { padding: 1.75rem; }

/* Legacy login-box compatibility */
.login-box {
  background: #fff;
  border-radius: var(--ybs-radius);
  padding: 1.5rem;
  box-shadow: var(--ybs-shadow);
}
.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  border: 1.5px solid var(--ybs-border);
  border-radius: .4rem;
  padding: .6rem .8rem;
  font-size: .9rem;
  margin-bottom: .75rem;
  box-sizing: border-box;
}
.login-box input[type="text"]:focus,
.login-box input[type="password"]:focus {
  border-color: var(--ybs-accent);
  outline: none;
}
.login-box .btn, .login-box input[type="submit"] {
  width: 100%;
  padding: .65rem;
  font-size: .95rem;
  background: var(--ybs-primary);
  border-radius: .45rem;
}

/* ============================================================
   THREAD / TICKET DETAIL
   ============================================================ */
.ybs-thread { margin-top: 1rem; }
.ybs-thread-entry {
  background: #fff;
  border-radius: var(--ybs-radius);
  box-shadow: var(--ybs-shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}
.ybs-thread-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  background: #f8faff;
  border-bottom: 1px solid var(--ybs-border);
  font-size: .875rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.ybs-thread-entry-body { padding: 1rem 1.25rem; font-size: .9rem; line-height: 1.65; }

.ybs-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ybs-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 700;
  flex-shrink: 0;
}
.ybs-avatar.staff { background: var(--ybs-success); }

/* Thread from thread.css uyumu */
.thread-entry, .thread-entries .entry {
  background: #fff;
  border-radius: var(--ybs-radius);
  box-shadow: var(--ybs-shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

/* ============================================================
   TICKET INFO TABLE
   ============================================================ */
.ybs-info-table { width: 100%; font-size: .875rem; }
.ybs-info-table th {
  width: 140px;
  font-weight: 600;
  color: var(--ybs-text-muted);
  padding: .5rem .75rem;
  vertical-align: top;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ybs-info-table td { padding: .5rem .75rem; color: var(--ybs-text); }

/* ============================================================
   MESSAGES / ALERTS
   ============================================================ */
#msg_error, #msg_notice, #msg_warning {
  padding: .875rem 1rem;
  border-radius: .4rem;
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
#msg_error { background: #fee2e2; color: #b91c1c; border-left: 4px solid #dc2626; }
#msg_notice { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
#msg_warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }

.error { color: var(--ybs-danger) !important; font-size: .8rem; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagenate, .pagination-wrap { margin: 1rem 0; }
.pagenate a, .pagenate span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px;
  border: 1.5px solid var(--ybs-border);
  border-radius: .35rem;
  margin: 0 .15rem;
  font-size: .8rem;
  text-decoration: none;
  color: var(--ybs-accent);
  transition: all .15s;
}
.pagenate a:hover { background: var(--ybs-accent); color: #fff; border-color: var(--ybs-accent); }
.pagenate .active span { background: var(--ybs-accent); color: #fff; border-color: var(--ybs-accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.ybs-footer {
  background: var(--ybs-primary);
  color: rgba(255,255,255,.7);
  padding: 1.25rem 0;
  font-size: .8rem;
  margin-top: auto;
}
.ybs-footer-brand { color: #fff; font-weight: 700; font-size: .95rem; text-decoration: none; }
.ybs-footer-brand:hover { color: rgba(255,255,255,.85); }
.ybs-footer-copy { color: rgba(255,255,255,.6); }
.ybs-footer-power a { color: rgba(255,255,255,.7); text-decoration: none; }
.ybs-footer-power a:hover { color: #fff; }

/* ============================================================
   CAPTCHA
   ============================================================ */
.captcha { display: inline-block; }
.captcha img { border-radius: .35rem; border: 1px solid var(--ybs-border); }

/* ============================================================
   UTILITIES / COMPAT
   ============================================================ */
.flush-left { float: left; }
.flush-right { float: right; }
.pull-right { float: right; }
.pull-left { float: left; }
.clear { clear: both; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowarn { }

/* Redactor editor overrides */
.redactor-editor { border: 1.5px solid var(--ybs-border) !important; border-radius: .4rem !important; min-height: 150px; font-family: var(--ybs-font) !important; }
.redactor-toolbar { border: 1.5px solid var(--ybs-border) !important; border-bottom: none !important; border-radius: .4rem .4rem 0 0 !important; background: #f8f9fa !important; }

/* Font awesome compat for older icon-* classes */
[class^="icon-"], [class*=" icon-"] { font-style: normal; }
.icon-refresh::before { content: "\f021"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-sort::before { content: "\f0dc"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-file-alt::before { content: "\f15c"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-file-text::before { content: "\f15c"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-group::before { content: "\f0c0"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-remove-circle::before { content: "\f057"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.Icon::before { font-family: "Font Awesome 6 Free"; font-weight: 900; content: "\f15c"; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767.98px) {
  .ybs-main { padding: 1rem 0 1.5rem; }
  .ybs-hero { padding: 1.5rem 1rem; }
  .ybs-hero h2 { font-size: 1.35rem; }
  .ybs-card-body { padding: 1rem; }
  .ybs-sidebar { position: static; margin-top: 1.5rem; }
  #ticketTable th:nth-child(3),
  #ticketTable td:nth-child(3),
  #ticketTable th:nth-child(5),
  #ticketTable td:nth-child(5) { display: none; }
  table[width="800"] td:first-child { width: auto; display: block; }
  .search.well { padding: .75rem; }
  .ybs-page-title { flex-direction: column; align-items: flex-start; }
  .login-box { padding: 1rem; }
}

@media (max-width: 575.98px) {
  .ybs-navbar { padding: .4rem 0; }
  .ybs-brand-name { font-size: 1rem; }
  .container { padding-left: 1rem; padding-right: 1rem; }
  #ticketTable th:nth-child(4),
  #ticketTable td:nth-child(4) { max-width: 150px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .ybs-navbar, .ybs-footer, .ybs-sidebar, .ybs-action-card { display: none !important; }
  .ybs-main { padding: 0; }
  .container { max-width: 100%; }
}
