/* Premium Glassmorphism & Custom Styling System */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* Always display SweetAlert2 on top of all modals */
.swal2-container {
  z-index: 999999 !important;
}

:root {
  --bg-primary: #060814;
  --bg-secondary: rgba(13, 17, 39, 0.7);
  --glass-bg: rgba(20, 26, 60, 0.4);
  --glass-border: rgba(255, 255, 255, 0.07);
  --color-accent-blue: #3b82f6;
  --color-accent-cyan: #06b6d4;
  --color-accent-green: #10b981;
  --color-accent-red: #ef4444;
  --color-accent-purple: #8b5cf6;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --neon-glow-green: 0 0 15px rgba(16, 185, 129, 0.3);
  --neon-glow-red: 0 0 15px rgba(239, 68, 68, 0.3);
  --neon-glow-blue: 0 0 15px rgba(59, 130, 246, 0.3);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 10% 20%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 90% 10%, rgba(6, 182, 212, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 80%, rgba(59, 130, 246, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  border-radius: 1rem;
}

.glass-panel-hover:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dynamic Glowing Animations */
@keyframes pulse-cyan {
  0%, 100% { box-shadow: 0 0 5px rgba(6, 182, 212, 0.2); }
  50% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.6); }
}

@keyframes pulse-emerald {
  0%, 100% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.6); }
}

@keyframes pulse-rose {
  0%, 100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.6); }
}

.glow-active-bot {
  animation: pulse-emerald 3s infinite;
}

.glow-inactive-bot {
  animation: pulse-rose 3s infinite;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(6, 8, 20, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Flash alerts for fresh ticker signals */
@keyframes flash-green {
  0% { background-color: rgba(16, 185, 129, 0.2); }
  100% { background-color: transparent; }
}

@keyframes flash-red {
  0% { background-color: rgba(239, 68, 68, 0.2); }
  100% { background-color: transparent; }
}

.flash-up {
  animation: flash-green 0.8s ease-out;
}

.flash-down {
  animation: flash-red 0.8s ease-out;
}

/* Slide in animation for new logs/trades */
@keyframes slide-in {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.animate-slide-in {
  animation: slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Custom Switch for Bot activation */
.switch-input:checked ~ .switch-dot {
  transform: translateX(100%);
  background-color: var(--color-accent-green);
}

/* Responsive Viewport & Tablet Layout Enhancements */
@media (min-width: 640px) and (max-width: 1024px) {
  html {
    font-size: 14.5px;
  }

  .glass-panel {
    border-radius: 0.85rem;
  }
}

@media (max-width: 639px) {
  html {
    font-size: 14px;
  }
}

/* Modal Responsive Scrollers & Clipping Prevention */
.modal-content-scroll {
  max-height: calc(88vh - 110px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prevent text wrapping issues on small tablet boxes */
.truncate-card-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile & Tablet Modal Scaling */
@media (max-width: 1024px) {
  .modal-container {
    max-width: 95vw !important;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Explicit Image & Logo Protection */
.login-logo-img {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  object-fit: cover !important;
}

.header-logo-img {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: cover !important;
}
