/* ============================================================================
   TIPSTER DASHBOARD STYLES
   Custom styles that complement Tailwind CSS
   ============================================================================ */

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 14px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #fafafa;
  color: #171717;
}

/* Card Component */
.card {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: all 0.2s;
}

.card:hover {
  border-color: #d4d4d4;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Navigation Tabs */
.nav-tab {
  color: #737373;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.75rem 0;
}

.nav-tab:hover {
  color: #404040;
}

.nav-tab.active {
  color: #171717;
  border-bottom-color: #171717;
}

/* Badge Components */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-family: ui-monospace, monospace;
  letter-spacing: -0.025em;
  min-width: 2.5rem;
}

.badge-outline {
  background: transparent;
  color: #525252;
  border: 1px solid #e5e5e5;
}

.badge-soft {
  background: #f5f5f5;
  color: #525252;
}

.badge-success {
  background: #262626;
  color: #ffffff;
}

.badge-warning {
  background: #525252;
  color: #ffffff;
}

.badge-error {
  background: #f5f5f5;
  color: #404040;
  border: 1px solid #d4d4d4;
}

/* Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
  cursor: pointer;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px white, 0 0 0 4px #171717;
}

.btn-primary {
  background: #171717;
  color: white;
  border: none;
}

.btn-primary:hover {
  background: #262626;
}

.btn-secondary {
  background: white;
  color: #404040;
  border: 1px solid #e5e5e5;
}

.btn-secondary:hover {
  background: #fafafa;
  border-color: #d4d4d4;
}

.btn-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: #737373;
  transition: all 0.2s;
  background: transparent;
  border: none;
  cursor: pointer;
}

.btn-icon:hover {
  background: #f5f5f5;
  color: #404040;
}

/* Stat Card */
.stat-card {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #171717;
  font-family: ui-monospace, monospace;
}

.stat-label {
  font-size: 0.75rem;
  color: #737373;
  margin-top: 0.25rem;
}

/* Table Styles - shadcn inspired */
.table-container {
  overflow-x: auto;
}

.table-container table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.table-container th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: #737373;
  text-transform: none;
  letter-spacing: normal;
  padding: 0.75rem 1rem;
  background: transparent;
  border-bottom: 1px solid #e5e5e5;
  white-space: nowrap;
}

.table-container th:hover {
  color: #404040;
}

.table-container td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}

.table-container tr:hover td {
  background: #fafafa;
}

/* Live Indicator */
.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #525252;
  animation: pulse 2s infinite;
}

/* System OK - único elemento verde permitido */
.system-ok-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #22c55e;
  animation: pulse 2s infinite;
}

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

/* Progress Bar */
.progress-bar {
  height: 0.375rem;
  background: #e5e5e5;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #404040;
  transition: all 0.3s;
}

/* Section Content */
.section-content h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #171717;
  margin-bottom: 0.5rem;
}

.section-content p {
  font-size: 0.875rem;
  color: #525252;
  line-height: 1.625;
}

.section-content ul {
  font-size: 0.875rem;
  color: #525252;
  margin-top: 0.5rem;
  list-style: none;
  padding: 0;
}

.section-content li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.section-content li::before {
  content: "•";
  color: #a3a3a3;
}

.formula-box {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  background: #f5f5f5;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: #404040;
  margin: 0.5rem 0;
}

/* Alert Button */
.alert-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  background: #171717;
  color: white;
  border-radius: 9999px;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.alert-btn:hover {
  background: #262626;
  transform: scale(1.05);
}

.alert-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px white, 0 0 0 4px #171717;
}

/* Odds value styling */
.odds-value {
  font-family: ui-monospace, monospace;
  font-weight: 600;
}

.odds-over {
  color: #171717;
}

.odds-under {
  color: #737373;
}

/* Match row */
.match-row {
  transition: background 0.15s;
}

.match-row:hover {
  background: #fafafa;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 3px;
}

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

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #737373;
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* Loading spinner */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #e5e5e5;
  border-top-color: #171717;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================================
   UX COHERENCE - Additional styles for visual consistency
   ============================================================================ */

/* Active state for date buttons */
.btn.active {
  background: #171717;
  color: white;
  border-color: #171717;
}

/* Subtle card hover states */
.stat-card:hover {
  border-color: #d4d4d4;
}

/* Improve table row interaction */
.table-container tr {
  cursor: default;
}

/* Badge hierarchy - make differences clearer */
.badge-success {
  font-weight: 600;
}

/* Focus states for accessibility */
button:focus-visible,
select:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 2px;
}

/* Consistent text selection color */
::selection {
  background: #e5e5e5;
  color: #171717;
}

/* Subtle transition for all interactive elements */
button, a, .card, .badge {
  transition: all 0.15s ease;
}

/* Improve select dropdown styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2.25rem;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  min-width: 200px;
  max-width: 320px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-success {
  background: #262626;
  color: #ffffff;
  border: 1px solid #404040;
}

.toast-error {
  background: #fafafa;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.toast-warning {
  background: #fafafa;
  color: #d97706;
  border: 1px solid #fcd34d;
}

.toast-info {
  background: #f5f5f5;
  color: #525252;
  border: 1px solid #d4d4d4;
}

/* ============================================================================
   SECTION TRANSITIONS
   ============================================================================ */

section[id^="section-"] {
  transition: opacity 0.15s ease;
}

/* ============================================================================
   TABLE SORTING
   ============================================================================ */

th[data-sort] {
  cursor: pointer;
  user-select: none;
}

th[data-sort]:hover {
  background: #f5f5f5;
}

.sort-icon {
  opacity: 0.6;
}

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

.btn-icon {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: #f5f5f5;
  color: #525252;
  border: 1px solid #e5e5e5;
  transition: all 0.15s ease;
}

.btn-icon:hover:not(:disabled) {
  background: #e5e5e5;
  color: #171717;
}

.btn-icon:disabled {
  cursor: not-allowed;
}

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

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

.animate-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}
