/* ============================================
   MODAL SYSTEM - Universal Modal Styles
   Pixel Art Style for Trading App
   ============================================ */

/* --- OVERLAY (backdrop) --- */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* --- MODAL BOX (main container) --- */
.modal-box {
  background: #2e1f0f;
  border: 4px solid #000;
  box-shadow: 
    inset 0 0 0 2px #4a3520,
    8px 8px 0 0 #000;
  padding: 2%;
  width: 28%;
  max-width: 90%;
  max-height: 80%;
  overflow-y: auto;
  font-family: 'Press Start 2P', monospace;
  color: #fffbe0;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.2s ease;
  box-sizing: border-box;
}

.modal-overlay.active .modal-box {
  transform: scale(1.3);
}

/* Wariant mniejszy (dla warning) */
.modal-box--compact {
  width: 460px;
  padding: 32px;
}

/* Wariant szerszy (dla danger z inputem) */
.modal-box--wide {
  width: 32%;
}

/* --- TITLE --- */
.modal-title {
  font-size: 1em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}

.modal-title--success {
  color: #00ff66;
}

.modal-title--warning {
  color: #ffd27f;
}

.modal-title--danger {
  color: #ff6b6b;
  font-size: 1.1em;
}

.modal-title--info {
  color: #4da6ff;
}

/* --- MESSAGE / CONTENT --- */
.modal-message {
  font-size: 0.6em;
  line-height: 2;
  margin-bottom: 1em;
}

.modal-message--left {
  text-align: left;
}

.modal-message p {
  margin-bottom: 16px;
}

.modal-message p:last-child {
  margin-bottom: 0;
}

/* Highlighted text inside message */
.modal-text-danger {
  color: #ff6b6b;
}

.modal-text-warning {
  color: #ffd27f;
}

.modal-text-success {
  color: #00ff66;
}

/* --- INPUT (for danger confirmation) --- */
.modal-input {
  width: 100%;
  padding: 14px;
  background: #000;
  border: 2px solid #4a3520;
  color: #fffbe0;
  font-family: 'Press Start 2P', monospace;
  font-size: 15px;
  box-sizing: border-box;
  text-align: center;
  margin: 24px 0;
}

.modal-input::placeholder {
  color: #6b5a45;
}

.modal-input:focus {
  outline: none;
  border-color: #8b4513;
}

/* --- CHECKBOX (optional) --- */
.modal-checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 10px;
}

.modal-checkbox {
  width: 20px;
  height: 20px;
  accent-color: #8b4513;
}

/* --- BUTTONS CONTAINER --- */
.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 0.8em;
  margin-top: 1em;
  flex-wrap: wrap;
}

/* --- BUTTON BASE --- */
.modal-btn {
  border: 2px solid #000;
  box-shadow: 3px 3px 0 0 #000;
  color: #fffbe0;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55em;
  padding: 0.6em 1.2em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.modal-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 #000;
}

.modal-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 #000;
}

.modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-btn:disabled:hover {
  transform: none;
  box-shadow: 4px 4px 0 0 #000;
}

/* Button variants */
.modal-btn--primary {
  background: #8b4513;
  font-size: 14px;
  padding: 14px 40px;
}

.modal-btn--secondary {
  background: #4a3520;
}

.modal-btn--danger {
  background: #8b0000;
  font-size: 16px;
  padding: 16px 32px;
}

.modal-btn--cancel {
  background: #4a3520;
  font-size: 16px;
  padding: 16px 32px;
}

/* --- UTILITY: Line height for warning modals --- */
.modal-box--compact .modal-message {
  font-size: 14px;
  line-height: 1.8;
}

/* ============================================
   RESPONSIVE - Mobile & Small Screens
   ============================================ */

/* Tablet & small desktop */
@media (max-width: 768px) {
  .modal-box {
    width: 90vw;
    max-width: 90vw;
    padding: 24px;
    border-width: 4px;
    box-shadow: 
      inset 0 0 0 2px #4a3520,
      8px 8px 0 0 #000;
  }

  .modal-box--compact,
  .modal-box--wide {
    width: 90vw;
    padding: 24px;
  }

  .modal-title {
    font-size: 16px;
    margin-bottom: 16px;
  }

  .modal-title--danger {
    font-size: 18px;
  }

  .modal-message {
    font-size: 10px;
    line-height: 2;
    margin-bottom: 20px;
  }

  .modal-box--compact .modal-message {
    font-size: 11px;
    line-height: 1.7;
  }

  .modal-btn {
    font-size: 10px;
    padding: 10px 16px;
    border-width: 3px;
    box-shadow: 3px 3px 0 0 #000;
  }

  .modal-btn--primary {
    font-size: 11px;
    padding: 12px 24px;
  }

  .modal-btn--danger,
  .modal-btn--cancel {
    font-size: 12px;
    padding: 12px 20px;
  }

  .modal-buttons {
    gap: 12px;
  }

  .modal-input {
    font-size: 12px;
    padding: 12px;
    margin: 16px 0;
  }
}

/* Mobile - very small screens */
@media (max-width: 480px) {
  .modal-overlay {
    padding: 16px;
  }

  .modal-box {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 20px;
    border-width: 3px;
    box-shadow: 
      inset 0 0 0 2px #4a3520,
      6px 6px 0 0 #000;
  }

  .modal-box--compact,
  .modal-box--wide {
    width: calc(100vw - 32px);
    padding: 20px;
  }

  .modal-title {
    font-size: 14px;
    margin-bottom: 14px;
  }

  .modal-title--danger {
    font-size: 15px;
  }

  .modal-message {
    font-size: 9px;
    line-height: 1.9;
    margin-bottom: 16px;
  }

  .modal-box--compact .modal-message {
    font-size: 10px;
    line-height: 1.6;
  }

  .modal-btn {
    font-size: 9px;
    padding: 8px 12px;
    border-width: 2px;
    box-shadow: 2px 2px 0 0 #000;
  }

  .modal-btn--primary {
    font-size: 10px;
    padding: 10px 20px;
  }

  .modal-btn--danger,
  .modal-btn--cancel {
    font-size: 10px;
    padding: 10px 16px;
  }

  .modal-buttons {
    gap: 10px;
    flex-wrap: wrap;
  }

  .modal-input {
    font-size: 11px;
    padding: 10px;
    margin: 12px 0;
  }
}





/* Extra small - prevent any overflow */
@media (max-width: 360px) {
  .modal-box {
    padding: 16px;
  }

  .modal-title {
    font-size: 12px;
  }

  .modal-message {
    font-size: 8px;
  }

  .modal-btn {
    font-size: 8px;
    padding: 8px 10px;
  }

  .modal-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .modal-btn--danger,
  .modal-btn--cancel,
  .modal-btn--primary {
    width: 100%;
  }
}


