/**
 * Softinator Ticket Tracker - Frontend Styles
 */

/* Status badges */
.stt-status-open {
  background-color: #0073aa;
  color: #fff;
}
.stt-status-in-progress {
  background-color: #ffb900;
  color: #23282d;
}
.stt-status-resolved {
  background-color: #46b450;
  color: #fff;
}
.stt-status-closed {
  background-color: #666;
  color: #fff;
}

/* Priority badges */
.stt-priority-low {
  background-color: #82878c;
  color: #fff;
}
.stt-priority-medium {
  background-color: #0073aa;
  color: #fff;
}
.stt-priority-high {
  background-color: #dc3232;
  color: #fff;
}
.stt-priority-urgent {
  background-color: #8b0000;
  color: #fff;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Tickets container */
.stt-tickets-container {
  margin: 0 auto;
  padding: 20px;
}

.stt-tickets-header h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #23282d;
}

/* Tickets table */
.stt-tickets-table {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stt-tickets-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.stt-tickets-table td {
  vertical-align: middle;
}

.stt-tickets-table .badge {
  font-size: 0.75em;
  padding: 0.4em 0.6em;
  border-radius: 4px;
}

/* Create ticket button */
.stt-create-ticket-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stt-create-ticket-btn .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

/* Modal styling - Hidden by default, shown when triggered */
#sttTicketModal {
  display: none !important;
  z-index: 100050 !important;
}

#sttTicketModal.show {
  display: block !important;
}

#sttTicketModal .modal-dialog {
  margin: auto;
}

/* Ensure backdrop is also above dashboard content */
.modal-backdrop {
  z-index: 100040 !important;
}

/* Offcanvas styling - High z-index */
.offcanvas {
  z-index: 100050 !important;
}
.offcanvas-backdrop {
  z-index: 100040 !important;
}

#sttTicketModal .modal-header {
  border-bottom: none;
}

#sttTicketModal .form-label {
  margin-bottom: 5px;
}

#sttTicketModal .modal-footer {
  border-top: 1px solid #e5e5e5;
}

/* Disabled department field styling */
#sttTicketModal select[name="department"]:disabled {
  background-color: #e9ecef;
  opacity: 0.8;
}

/* Ticket single view */
.stt-ticket-single .card {
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stt-ticket-single .card-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e5e5e5;
  font-weight: 600;
}

/* Nav pills for status filter */
.stt-tickets-container .nav-pills .nav-link {
  color: #23282d;
  border-radius: 4px;
  margin-right: 5px;
}

.stt-tickets-container .nav-pills .nav-link.active {
  background-color: #0073aa;
}

.stt-tickets-container .nav-pills .nav-link .badge {
  background: rgba(0, 0, 0, 0.1);
}

.stt-tickets-container .nav-pills .nav-link.active .badge {
  background: rgba(255, 255, 255, 0.2);
}

/* WordPress Style Tabs */
.stt-nav-tab-wrapper {
  border-bottom: 1px solid #c3c4c7;
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 0 !important;
}

html body .stt-nav-tab {
  background: #e4e6eb;
  border: 1px solid transparent;
  border-bottom: none;
  margin-right: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 12px;
  font-weight: 400;
  display: flex;
  min-width: 120px;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  color: #50575e;
  cursor: pointer;
  text-decoration: none;
  border-radius: 4px 4px 0 0;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.subheading {
  font-size: 14px;
  font-weight: 700;
}

.stt-nav-tab:hover {
  background: #f0f0f1;
  color: #1d2327;
}

.stt-nav-tab.active {
  background: #fff;
  border: 1px solid #c3c4c7;
  border-bottom: 1px solid #fff;
  color: #000;
  font-weight: 600;
  z-index: 1;
}

.stt-nav-tab .count {
  font-weight: 400;
  color: #8c8f94;
}

.stt-nav-tab.active .count {
  color: #646970;
}

/* Responsive */
@media (max-width: 768px) {
  .stt-tickets-table {
    font-size: 0.875rem;
  }

  .stt-tickets-container .nav-pills {
    flex-wrap: wrap;
  }

  .stt-tickets-container .nav-pills .nav-link {
    margin-bottom: 5px;
  }
}

/* Dark Mode Support (Ohio Theme Integration) */
body.dark-scheme {
  --stt-bg-dark: #1a191d;
  --stt-card-dark: #252429;
  --stt-border-dark: #3a393f;
  --stt-text-dark: #ffffff;
  --stt-text-muted: #a0a0a5;
}

body.dark-scheme .stt-tickets-container,
body.dark-scheme .stt-public-form-container,
body.dark-scheme .stt-dashboard-container,
body.dark-scheme .stt-dashboard-col,
body.dark-scheme .modal-content,
body.dark-scheme .modal-header,
body.dark-scheme .modal-footer,
body.dark-scheme .stt-form,
body.dark-scheme #sttPublicTicketForm,
body.dark-scheme .stt-form-footer,
body.dark-scheme .offcanvas,
body.dark-scheme .offcanvas-header,
body.dark-scheme .offcanvas-body,
body.dark-scheme .stt-carousel-wrapper {
  background-color: var(--stt-bg-dark) !important;
  background: var(--stt-bg-dark) !important;
  color: var(--stt-text-dark) !important;
}

body.dark-scheme #sttPublicTicketForm,
body.dark-scheme .stt-public-form-container,
body.dark-scheme .stt-form-footer {
  background-color: #252429 !important;
}

body.dark-scheme .stt-tickets-table,
body.dark-scheme .stt-ticket-single .card,
body.dark-scheme .card,
body.dark-scheme .modal-body,
body.dark-scheme .stt-ticket-item,
body.dark-scheme .stt-ticket-card {
  background: var(--stt-card-dark) !important;
  background-color: var(--stt-card-dark) !important;
  border-color: var(--stt-border-dark) !important;
  color: var(--stt-text-dark) !important;
}

body.dark-scheme .stt-tickets-table th,
body.dark-scheme .stt-tickets-table td {
  border-color: var(--stt-border-dark) !important;
  color: var(--stt-text-dark) !important;
  background-color: transparent !important;
}

body.dark-scheme .stt-tickets-header h4,
body.dark-scheme .stt-dashboard-header h2,
body.dark-scheme .stt-col-header h3,
body.dark-scheme .stt-item-title,
body.dark-scheme .stt-card-ticket-title,
body.dark-scheme .stt-form-header h3,
body.dark-scheme .modal-title,
body.dark-scheme .modal-title *,
body.dark-scheme h2,
body.dark-scheme h3,
body.dark-scheme h4,
body.dark-scheme h5 {
  color: var(--stt-text-dark) !important;
}

body.dark-scheme .text-muted,
body.dark-scheme .subheading,
body.dark-scheme p,
body.dark-scheme .count,
body.dark-scheme .stt-dashboard-header p,
body.dark-scheme .stt-item-meta,
body.dark-scheme .stt-card-article-title,
body.dark-scheme .stt-card-excerpt,
body.dark-scheme .stt-card-footer {
  color: var(--stt-text-muted) !important;
}

body.dark-scheme .stt-dashboard-header,
body.dark-scheme .stt-card-footer,
body.dark-scheme .stt-nav-tab-wrapper {
  border-color: var(--stt-border-dark) !important;
}

body.dark-scheme .stt-nav-tab {
  background: var(--stt-card-dark) !important;
  color: var(--stt-text-muted) !important;
  border-color: transparent !important;
}

body.dark-scheme .stt-nav-tab:hover {
  background: #2a292f !important;
  color: var(--stt-text-dark) !important;
}

body.dark-scheme .stt-nav-tab.active {
  background: var(--stt-bg-dark) !important;
  border: 1px solid var(--stt-border-dark) !important;
  border-bottom-color: var(--stt-bg-dark) !important;
  color: var(--stt-text-dark) !important;
}

body.dark-scheme .form-label,
body.dark-scheme .stt-form-group label {
  color: var(--stt-text-dark) !important;
}

body.dark-scheme .form-control,
body.dark-scheme .form-select,
body.dark-scheme .stt-form-group input,
body.dark-scheme .stt-form-group select,
body.dark-scheme .stt-form-group textarea {
  background-color: #1f1e24 !important;
  border-color: var(--stt-border-dark) !important;
  color: var(--stt-text-dark) !important;
}

body.dark-scheme .form-control:focus,
body.dark-scheme .form-select:focus,
body.dark-scheme .stt-form-group input:focus {
  background-color: #2a292f !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05) !important;
}

body.dark-scheme .modal-header,
body.dark-scheme .modal-footer {
  border-color: var(--stt-border-dark) !important;
}

body.dark-scheme .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%) !important;
}

body.dark-scheme hr {
  border-color: var(--stt-border-dark) !important;
  opacity: 0.3;
}

/* Button overrides for dark mode contrast */
body.dark-scheme .stt-submit-btn,
body.dark-scheme .sad-dashboard-submit-btn.primary,
body.dark-scheme .stt-create-ticket-btn {
  background-color: #252429 !important;
  color: #ffffff !important;
  border: 1px solid #3a393f !important;
}

body.dark-scheme .stt-submit-btn:hover,
body.dark-scheme .sad-dashboard-submit-btn.primary:hover,
body.dark-scheme .stt-create-ticket-btn:hover {
  background-color: #2a292f !important;
  border-color: #4a494f !important;
  color: #ffffff !important;
}
