/* Custom Styles for Crypto Trading Dashboard */

/* Smooth transitions */
* {
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

/* Chart containers */
.chart-container,
.rsi-chart-container,
.macd-chart-container {
  width: 100%;
  min-height: 400px;
  position: relative;
  background: #0f172a;
  border-radius: 0.5rem;
}

.rsi-chart-container,
.macd-chart-container {
  min-height: 150px;
  margin-top: 1rem;
}

/* Timeframe buttons */
.timeframe-btn {
  padding: 0.5rem 1rem;
  background: #1e293b;
  color: #94a3b8;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  min-width: 60px;
}

.timeframe-btn:hover {
  background: #334155;
  color: #e2e8f0;
  transform: translateY(-1px);
}

.timeframe-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #60a5fa;
}

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

/* Indicator buttons */
.indicator-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  color: #94a3b8;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  text-align: left;
}

.indicator-btn:hover {
  background: #334155;
  color: #e2e8f0;
  transform: translateY(-1px);
}

.indicator-btn.active {
  background: #1e293b;
  color: white;
  border-color: #475569;
}

.indicator-btn.active .indicator-dot {
  opacity: 1;
  transform: scale(1.2);
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}

/* Price change animations */
.change-value {
  font-weight: 600;
  animation: pulse 0.5s ease-in-out;
}

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

/* Responsive adjustments */
@media (max-width: 1280px) {
  .chart-container {
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .chart-container {
    min-height: 250px;
  }

  .rsi-chart-container,
  .macd-chart-container {
    min-height: 120px;
  }

  .timeframe-btn,
  .indicator-btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
}

/* Loading animation improvements */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Error notification slide-in */
#error-notification {
  animation: slideIn 0.3s ease-out;
}

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

/* Hover effects for interactive elements */
button:not(:disabled):active {
  transform: translateY(0) scale(0.98);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

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

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

/* Focus styles for accessibility */
button:focus-visible,
.timeframe-btn:focus-visible,
.indicator-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Price display animations */
#btc-price, #eth-price {
  font-variant-numeric: tabular-nums;
}

/* Gradient overlays for sections */
.crypto-section .bg-slate-800 {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.crypto-section:hover .bg-slate-800 {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Loading overlay backdrop blur */
#loading-overlay {
  backdrop-filter: blur(4px);
}

/* Ensure charts are visible */
.chart-container > div,
.rsi-chart-container > div,
.macd-chart-container > div {
  width: 100% !important;
}

/* Stats grid hover effect */
.bg-slate-700\/50:hover {
  background-color: rgba(51, 65, 85, 0.6);
}

/* Footer link styling */
footer a {
  color: #60a5fa;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Print styles */
@media print {
  header, footer, button, .indicator-btn, .timeframe-btn {
    display: none;
  }

  .chart-container {
    page-break-inside: avoid;
  }
}
