/* =========================================
   MODAL VARIABLES
   ========================================= */
:root {
  /* Inherits global colors (--neon-teal, etc) from main.css */
  --modal-overlay: rgba(5, 10, 16, 0.85);
  --modal-bg: rgba(15, 20, 25, 0.95);
  /* Use the global variable for the border so it matches the theme */
  --modal-border: 1px solid var(--neon-teal);
}

/* =========================================
   OVERLAY & ANIMATION
   ========================================= */
.modal-overlay {
  z-index: 2000;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background-color: var(--modal-overlay);
  backdrop-filter: blur(8px);

  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* =========================================
   MODAL WINDOW
   ========================================= */
.modal-content {
  width: 85%;
  height: 80vh;
  max-width: 1200px;
  background-color: var(--modal-bg);
  border: var(--modal-border);
  box-shadow: 0 0 40px rgba(29, 205, 159, 0.15);

  display: flex;
  flex-direction: column;
  position: relative;

  /* Sci-Fi Cut Corners (Bottom Right) */
  clip-path: polygon(0 0, 100% 0, 100% 95%, 98% 100%, 0 100%);
}

/* Header */
.modal-header {
  height: 50px;
  min-height: 50px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
  margin: 0;
  font-family: 'Fira Mono', monospace;
  font-size: 14px;
  color: var(--neon-teal);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Status Dot */
.modal-header h2::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: var(--neon-teal);
  border-radius: 50%;
  box-shadow: 0 0 5px var(--neon-teal);
}

/* Close Button */
.close-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-family: sans-serif;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.close-btn:hover {
  color: #ff4444;
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

/* TradingView Container */
#tv_popup_container {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #000;
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    /* Clean override, no !important needed */
    height: 70vh;
  }

  .modal-header h2 {
    font-size: 12px;
  }
}
