/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #1a1a1a;
  color: #e0e0e0;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 2px solid #333;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2rem;
  color: #4CAF50;
}

.auth-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.status-badge.authenticated {
  background: #2e7d32;
  color: white;
}

.status-badge.unauthenticated {
  background: #d32f2f;
  color: white;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #2a2a2a;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
}

.modal-content h2 {
  margin-bottom: 15px;
  color: #4CAF50;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  margin: 15px 0;
  background: #333;
  border: 1px solid #555;
  color: #e0e0e0;
  border-radius: 4px;
  font-size: 1rem;
}

.modal-content button {
  width: 100%;
  padding: 12px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

.modal-content button:hover {
  background: #45a049;
}

.help-text {
  margin-top: 15px;
  font-size: 0.9rem;
  color: #999;
}

/* Main Content */
main {
  display: grid;
  gap: 20px;
}

/* Panel */
.panel {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 25px;
  border: 1px solid #333;
}

.panel h2 {
  color: #4CAF50;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.panel h3 {
  color: #e0e0e0;
  margin: 20px 0 10px 0;
  font-size: 1.1rem;
}

.panel-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

/* Status Grid */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 15px;
  background: #333;
  border-radius: 4px;
}

.status-item .label {
  font-weight: 500;
  color: #999;
}

.status-item .value {
  font-weight: 600;
  color: #e0e0e0;
}

.status-item .value.online {
  color: #4CAF50;
}

.status-item .value.offline {
  color: #f44336;
}

/* Buttons */
.button-group {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

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

.btn-primary {
  background: #2196F3;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #1976D2;
}

.btn-success {
  background: #4CAF50;
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #45a049;
}

.btn-danger {
  background: #f44336;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #d32f2f;
}

.btn-warning {
  background: #ff9800;
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background: #f57c00;
}

.btn-secondary {
  background: #555;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #666;
}

/* Lists */
.list {
  background: #333;
  border-radius: 4px;
  padding: 15px;
  max-height: 300px;
  overflow-y: auto;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
  background: #2a2a2a;
  border-radius: 4px;
  border: 1px solid #444;
}

.list-item:last-child {
  margin-bottom: 0;
}

.list-item-info {
  flex: 1;
}

.list-item-name {
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 5px;
}

.list-item-details {
  font-size: 0.9rem;
  color: #999;
}

.list-item-actions {
  display: flex;
  gap: 5px;
}

.list-item-actions .btn {
  padding: 5px 15px;
  font-size: 0.9rem;
}

.loading {
  text-align: center;
  color: #999;
  padding: 20px;
}

/* Connection Info */
.connection-details {
  background: #333;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
}

.connection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #444;
}

.connection-item:last-child {
  border-bottom: none;
}

.connection-item.connection-full {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.connection-item .label {
  font-weight: 500;
  color: #999;
  min-width: 150px;
}

.connection-item .value {
  color: #4CAF50;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.value-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.copy-input {
  flex: 1;
  padding: 8px 12px;
  background: #2a2a2a;
  border: 1px solid #555;
  color: #4CAF50;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  font-weight: 600;
}

.copy-input:focus {
  outline: none;
  border-color: #4CAF50;
}

.btn-copy {
  padding: 8px 16px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: #45a049;
}

.connection-instructions {
  background: #333;
  border-radius: 4px;
  padding: 20px;
}

.connection-instructions h3 {
  color: #4CAF50;
  margin-top: 0;
  margin-bottom: 15px;
}

.connection-instructions ol {
  margin-left: 20px;
  margin-bottom: 20px;
}

.connection-instructions ol li {
  margin-bottom: 10px;
  color: #e0e0e0;
  line-height: 1.6;
}

.connection-notes {
  background: #2a2a2a;
  padding: 15px;
  border-radius: 4px;
  border-left: 4px solid #ff9800;
}

.connection-notes strong {
  color: #ff9800;
  display: block;
  margin-bottom: 10px;
}

.connection-notes ul {
  margin-left: 20px;
}

.connection-notes ul li {
  margin-bottom: 8px;
  color: #e0e0e0;
  line-height: 1.5;
}

/* Upload Area */
.upload-area {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: #333;
  border-radius: 4px;
  margin-bottom: 20px;
}

.upload-area input[type="file"] {
  flex: 1;
  padding: 8px;
  background: #2a2a2a;
  border: 1px solid #555;
  color: #e0e0e0;
  border-radius: 4px;
}

/* Log Viewer */
.log-viewer {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 15px;
  height: 500px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.log-line {
  margin-bottom: 2px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.log-line.error {
  color: #f44336;
}

.log-line.warn {
  color: #ff9800;
}

.log-line.info {
  color: #4CAF50;
}

.log-line.debug {
  color: #999;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #e0e0e0;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 15px 20px;
  border-radius: 4px;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
  min-width: 300px;
}

.toast.success {
  background: #4CAF50;
}

.toast.error {
  background: #f44336;
}

.toast.warning {
  background: #ff9800;
}

.toast.info {
  background: #2196F3;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Footer */
footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 2px solid #333;
  text-align: center;
  color: #999;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .upload-area {
    flex-direction: column;
  }

  .log-viewer {
    height: 300px;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #666;
}
