/* Discord Bot Panel - Hauptcontainer */
#wdb-panel {
  background: #0d0d0d;
  padding: 25px;
  border-radius: 8px;
  margin: 20px 0;
  color: #e0e0e0;
}

#wdb-panel h3 {
  margin-top: 0;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid #337ab7;
  color: #fff;
  font-size: 24px;
}

/* Filter Leiste - Horizontal wie beim Ticket-System */
.wdb-filters {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #1a1a1a;
  border-radius: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.wdb-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wdb-filter-group label {
  font-weight: 600;
  font-size: 14px;
  margin: 0;
  color: #e0e0e0;
}

.wdb-filter-group select,
.wdb-filter-group input {
  padding: 8px 12px;
  border: 1px solid #444;
  border-radius: 5px;
  font-size: 14px;
  background: #2a2a2a;
  color: #e0e0e0;
  min-width: 150px;
}

.wdb-filter-group select:focus,
.wdb-filter-group input:focus {
  outline: none;
  border-color: #337ab7;
  background: #333;
}

.wdb-filter-stats {
  margin-left: auto;
  font-size: 14px;
  color: #aaa;
  white-space: nowrap;
}

.wdb-filter-stats strong {
  color: #fff;
  font-weight: 700;
}

/* Nachrichten Container */
#wdb-messages {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 10px;
}

/* Scrollbar Styling */
#wdb-messages::-webkit-scrollbar {
  width: 8px;
}

#wdb-messages::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 4px;
}

#wdb-messages::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

#wdb-messages::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.wdb-no-messages {
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-style: italic;
  font-size: 16px;
}

/* Einzelne Nachricht - Card Style */
.wdb-message {
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
}

.wdb-message.wdb-unread {
  background: #1f1a15;
  border-left: 4px solid #ff9800;
}

.wdb-message.wdb-read {
  background: #171717;
  border-left: 4px solid #5cb85c;
  opacity: 0.90;
}

/* NEU: Gesendete Nachrichten - Visuelle Unterscheidung */
.wdb-message.wdb-sent {
  background: #0d1a1f;
  border-left: 4px solid #337ab7;
  opacity: 0.95;
}

.wdb-message.wdb-sent.wdb-failed {
  background: #1f0d0d;
  border-left: 4px solid #d9534f;
  opacity: 0.90;
}

.wdb-message:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

/* Message Header */
.wdb-message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a2a2a;
}

.wdb-message-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wdb-channel {
  font-weight: 700;
  color: #337ab7;
  font-size: 14px;
  background: #0d2438;
  padding: 4px 10px;
  border-radius: 4px;
}

.wdb-author {
  font-weight: 600;
  font-size: 14px;
  color: #e0e0e0;
}

.wdb-author a {
  color: #5865f2;
  text-decoration: none;
  transition: color 0.2s;
}

.wdb-author a:hover {
  color: #7289da;
  text-decoration: underline;
}

/* NEU: Gesendete Nachricht Badge */
.wdb-sent-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  background: #1e3a5f;
  color: #5b9bd5;
}

.wdb-sent-badge.wdb-failed-badge {
  background: #4a1f1f;
  color: #e57373;
}

.wdb-timestamp {
  font-size: 12px;
  color: #888;
}

/* Status Toggle */
.wdb-message-status {
  display: flex;
  align-items: center;
}

.wdb-status-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding: 6px 12px;
  background: #2a2a2a;
  border-radius: 4px;
  transition: background 0.2s;
}

.wdb-status-toggle:hover {
  background: #333;
}

.wdb-status-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #5cb85c;
}

.wdb-status-label {
  font-size: 13px;
  font-weight: 600;
}

.wdb-unread .wdb-status-label {
  color: #ff9800;
}

.wdb-read .wdb-status-label {
  color: #5cb85c;
}

/* NEU: Gesendete Nachrichten - Status nicht änderbar */
.wdb-sent .wdb-status-toggle {
  pointer-events: none;
  opacity: 0.7;
}

/* Message Content */
.wdb-content {
  margin-top: 12px;
  padding: 12px;
  background: #0d0d0d;
  border-radius: 4px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #e0e0e0;
  border-left: 3px solid #2a2a2a;
}

/* NEU: Content für gesendete Nachrichten */
.wdb-sent .wdb-content {
  border-left: 3px solid #337ab7;
}

.wdb-sent.wdb-failed .wdb-content {
  border-left: 3px solid #d9534f;
}

/* Message Actions */
.wdb-message-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

/* NEU: Actions für gesendete Nachrichten ausblenden */
.wdb-sent .wdb-message-actions {
  display: none;
}

/* Button Styles - vom Ticket-System */
.btn,
.wdb-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary,
.wdb-btn-primary {
  background: #337ab7;
  color: #fff;
}

.btn-primary:hover,
.wdb-btn-primary:hover {
  background: #286090;
  box-shadow: 0 2px 8px rgba(51, 122, 183, 0.4);
}

.btn-success,
.wdb-btn-success {
  background: #5cb85c;
  color: #fff;
}

.btn-success:hover,
.wdb-btn-success:hover {
  background: #4cae4c;
  box-shadow: 0 2px 8px rgba(92, 184, 92, 0.4);
}

.btn-danger,
.wdb-btn-danger {
  background: #d9534f;
  color: #fff;
}

.btn-danger:hover,
.wdb-btn-danger:hover {
  background: #c9302c;
  box-shadow: 0 2px 8px rgba(217, 83, 79, 0.4);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Message Footer */
.wdb-message-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #2a2a2a;
}

.wdb-message-footer small {
  color: #888;
  font-size: 12px;
}

.wdb-message-footer strong {
  color: #5cb85c;
}

/* NEU: Footer für gesendete Nachrichten */
.wdb-sent .wdb-message-footer strong {
  color: #337ab7;
}

.wdb-sent.wdb-failed .wdb-message-footer strong {
  color: #d9534f;
}

/* Reply Modal/Form */
.wdb-reply-form {
  margin-top: 15px;
  padding: 15px;
  background: #0d0d0d;
  border-radius: 6px;
  border: 2px solid #337ab7;
  display: none;
}

.wdb-reply-form.active {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wdb-reply-quote {
  margin-bottom: 12px;
  padding: 10px;
  background: #1a1a1a;
  border-left: 3px solid #888;
  border-radius: 4px;
  color: #aaa;
  font-size: 13px;
  font-style: italic;
}

.wdb-reply-quote strong {
  color: #5865f2;
  font-style: normal;
}

.wdb-reply-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #e0e0e0;
}

.wdb-reply-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 14px;
  background: #2a2a2a;
  color: #e0e0e0;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  box-sizing: border-box;
}

.wdb-reply-form textarea:focus {
  outline: none;
  border-color: #337ab7;
  background: #333;
}

.wdb-reply-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

/* Send Form - Unten im Panel */
#wdb-send-form {
  margin-top: 30px;
  padding: 20px;
  background: #1a1a1a;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
}

#wdb-send-form h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #fff;
  font-size: 18px;
}

#wdb-send-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #e0e0e0;
}

#wdb-send-form select,
#wdb-send-form input[type="text"],
#wdb-send-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 15px;
  box-sizing: border-box;
  background: #2a2a2a;
  color: #e0e0e0;
}

#wdb-send-form select:focus,
#wdb-send-form input[type="text"]:focus,
#wdb-send-form textarea:focus {
  outline: none;
  border-color: #337ab7;
  background: #333;
}

#wdb-send-form textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

#wdb-send-form button {
  background: #337ab7;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

#wdb-send-form button:hover {
  background: #286090;
  box-shadow: 0 2px 8px rgba(51, 122, 183, 0.4);
}

#wdb-send-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading State */
.wdb-loading {
  text-align: center;
  padding: 40px;
  color: #888;
}

.wdb-loading::after {
  content: '...';
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Loading Indicator (beim Auto-Refresh) */
#wdb-loading-indicator {
  display: inline-block;
  margin-left: 15px;
  font-size: 14px;
  color: #888;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Pause Indicator (Timer pausiert) */
#wdb-pause-indicator {
  display: inline-block;
  margin-left: 15px;
  font-size: 14px;
  color: #ff9800;
  opacity: 0.7;
  cursor: help;
  transition: opacity 0.3s;
}

#wdb-pause-indicator:hover {
  opacity: 1;
}

/* Error Message */
.wdb-error {
  background: #1a0d0d;
  border: 1px solid #d9534f;
  color: #d9534f;
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
}

/* Success Message */
.wdb-success {
  background: #0d1a0d;
  border: 1px solid #5cb85c;
  color: #5cb85c;
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  #wdb-panel {
    padding: 15px;
  }
  
  .wdb-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .wdb-filter-group {
    width: 100%;
  }
  
  .wdb-filter-group select,
  .wdb-filter-group input {
    width: 100%;
  }
  
  .wdb-filter-stats {
    margin-left: 0;
    text-align: center;
    margin-top: 10px;
  }
  
  .wdb-message-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .wdb-message-info {
    width: 100%;
  }
  
  .wdb-message-actions {
    flex-direction: column;
  }
  
  .wdb-message-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #wdb-panel h3 {
    font-size: 20px;
  }
  
  .wdb-channel {
    font-size: 12px;
    padding: 3px 8px;
  }
  
  .wdb-author,
  .wdb-timestamp {
    font-size: 12px;
  }
  
  .btn,
  .wdb-btn {
    font-size: 13px;
    padding: 7px 14px;
  }
}