/* Token Explorer Styles */

.token-explorer-content {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Hero Section */
.explorer-hero {
  text-align: center;
  margin-bottom: 48px;
}

.hero-title {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero-description {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  max-width: 600px;
  margin: 0 auto;
}

/* Search and Controls */
.explorer-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 20px;
  flex-wrap: wrap;
}

.search-container {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  opacity: 0.5;
}

.token-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px 12px 48px;
  font-size: 14px;
  color: #fff;
  transition: all 0.3s ease;
}

.token-search:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.token-search::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Filter Controls */
.filter-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 8px 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.filter-btn.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #888;
}

.filter-btn.active .filter-dot {
  background: #4ade80;
}

.filter-dot.trending {
  background: #f97316;
}

/* Sort Dropdown */
.sort-dropdown {
  position: relative;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.sort-btn img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.chevron {
  transition: transform 0.3s ease;
}

.sort-dropdown.open .chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.sort-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Token Table */
.token-table-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
}

.token-table {
  width: 100%;
  border-collapse: collapse;
}

.token-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px 20px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.token-table th.sortable {
  cursor: pointer;
  transition: color 0.2s ease;
}

.token-table th.sortable:hover {
  color: rgba(255, 255, 255, 0.7);
}

.sort-icon {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  opacity: 0.3;
  vertical-align: middle;
}

.token-table th.sorted .sort-icon {
  opacity: 0.7;
}

.token-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.token-table tr:last-child td {
  border-bottom: none;
}

.token-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Token Info Cell */
.token-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
}

.token-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.token-details {
  display: flex;
  flex-direction: column;
}

.token-name {
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.token-symbol {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Time Display */
.time-ago {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.time-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f97316;
}

.time-indicator.old {
  background: #888;
}

.time-indicator.new {
  background: #4ade80;
  animation: pulse 1.5s ease-in-out infinite;
}

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

.launch-platform {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.filter-dot.hot {
  background: #ef4444;
}

/* Price Changes */
.price-change {
  font-weight: 600;
}

.price-change.positive {
  color: #4ade80;
}

.price-change.negative {
  color: #ef4444;
}

/* View Button */
.view-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

/* Loading and Empty States */
.loading-state,
.empty-state {
  padding: 80px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #4ade80;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.pagination-btn img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.page-numbers {
  display: flex;
  gap: 4px;
}

.page-number {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-number:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.page-number.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  font-weight: 600;
}

/* AI Chat Widget */
.token-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 500px;
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.token-chat-widget.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chat-widget-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-ai-icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
}

.chat-widget-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.chat-widget-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.chat-widget-close:hover {
  opacity: 1;
}

.chat-widget-close img {
  width: 20px;
  height: 20px;
}

.chat-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.chat-message p {
  margin: 0;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

.ai-message {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
}

.user-message {
  align-self: flex-end;
  background: rgba(74, 222, 128, 0.1);
  color: #fff;
  margin-left: auto;
}

.chat-widget-input-container {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-widget-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  color: #fff;
  transition: all 0.3s ease;
}

.chat-widget-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.chat-widget-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-widget-send {
  background: rgba(74, 222, 128, 0.2);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chat-widget-send:hover {
  background: rgba(74, 222, 128, 0.3);
  transform: scale(1.05);
}

.chat-widget-send img {
  width: 20px;
  height: 20px;
}

/* Typing Indicator */
.typing-indicator {
  padding: 12px 16px;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  30% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Chat Widget Styles */
.chat-widget {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  margin: 8px 16px;
}

/* Chat Toggle Button */
.chat-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(74, 222, 128, 0.2);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.chat-toggle-btn:hover {
  background: rgba(74, 222, 128, 0.3);
  transform: scale(1.05);
}

.chat-toggle-btn.hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
}

.chat-toggle-btn img {
  width: 28px;
  height: 28px;
}

/* Token Modal */
.token-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.token-modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.modal-close:hover {
  opacity: 1;
}

.modal-close img {
  width: 24px;
  height: 24px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .token-explorer-content {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .explorer-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-container {
    max-width: 100%;
  }
  
  .filter-controls {
    justify-content: space-between;
  }
  
  .token-table-container {
    overflow-x: auto;
  }
  
  .token-table {
    min-width: 800px;
  }
  
  .token-chat-widget {
    width: calc(100vw - 48px);
    height: calc(100vh - 100px);
    bottom: 16px;
    right: 16px;
  }
  
  .chat-toggle-btn {
    bottom: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px;
  }
  
  .hero-description {
    font-size: 14px;
  }
  
  .filter-btn {
    padding: 6px 16px;
    font-size: 13px;
  }
  
  .token-table th,
  .token-table td {
    padding: 12px 16px;
    font-size: 13px;
  }
  
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
}