/**
 * 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;
  }
}
