/* ==================== GLOBAL ====================*/

* {
  scroll-behavior: smooth;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
}

/* ==================== SCROLLBAR ====================*/

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #6b7280;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ==================== ANIMATIONS ====================*/

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

@keyframes slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

#toast-container > div {
  animation: slide-in 0.3s ease-out;
}

/* ==================== FORMS ====================*/

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="range"],
select,
textarea {
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: #374151;
  outline: none;
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ec4899;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.5);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ec4899;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.5);
}

/* ==================== BUTTONS ====================*/

button {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

/* ==================== TABLES ====================*/

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

th {
  font-weight: 600;
  text-align: left;
  background: #1f2937;
}

td {
  border-bottom: 1px solid #374151;
  vertical-align: middle;
}

tr:hover {
  background-color: rgba(236, 72, 153, 0.05);
}

/* ==================== CARDS ====================*/

.card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: #ec4899;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.2);
}

/* ==================== MODALS ====================*/

#confirm-modal {
  animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==================== AGENT CARDS ====================*/

#agents-container > div {
  transition: all 0.3s ease;
}

#agents-container > div:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(236, 72, 153, 0.3);
}

/* ==================== CHARTS ====================*/

canvas {
  max-height: 300px;
}

/* ==================== TABS ====================*/

.tab-btn {
  cursor: pointer;
  transition: all 0.3s ease;
  color: #9ca3af;
  position: relative;
}

.tab-btn:hover {
  color: #ffffff;
}

.tab-btn.active {
  color: #ffffff;
}

.tab-content {
  animation: fade-in 0.3s ease-out;
}

/* ==================== ACTIVITY LOG ====================*/

#activity-log > div {
  padding: 0.75rem;
  border-radius: 0.375rem;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

#activity-log > div:hover {
  background: rgba(236, 72, 153, 0.1);
}

/* ==================== PLATFORM STATUS ====================*/

#platform-status > div {
  padding: 1rem;
  border-radius: 0.5rem;
  background: #1f2937;
  border: 1px solid #374151;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#platform-status > div:hover {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.05);
}

.platform-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.platform-indicator.active {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.platform-indicator.ready {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.platform-indicator.reserved {
  background: #6b7280;
}

/* ==================== RESPONSIVE ====================*/

@media (max-width: 1024px) {
  #agents-container {
    grid-template-columns: 1fr !important;
  }
  
  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  nav {
    flex-direction: column;
    gap: 1rem;
  }
  
  .text-2xl {
    font-size: 1.5rem;
  }
  
  #toast-container {
    left: 1rem;
    right: 1rem;
  }
}

/* ==================== DARK MODE ====================*/

/* Already dark by default */

/* ==================== UTILITIES ====================*/

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.transition-fast {
  transition: all 0.15s ease;
}

.transition-base {
  transition: all 0.3s ease;
}

.transition-slow {
  transition: all 0.5s ease;
}

.shadow-glow {
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

/* ==================== PRINT ====================*/

@media print {
  nav,
  button,
  #toast-container,
  #confirm-modal {
    display: none;
  }
}
