/**
 * Unified Modal Styles
 * @description Harmonized styles for tip and swap modals with consistent button styling and night mode support
 * @author Venice DIEM Dashboard
 */

/* ========================================
   Modal Base Styles
   ======================================== */

.tip-modal,
.swap-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.tip-modal-content,
.swap-modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease-out;
}

/* Night mode modal content */
:root[data-theme="night"] .tip-modal-content,
:root[data-theme="night"] .swap-modal-content {
  background: rgb(45, 55, 72);
  color: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========================================
   Modal Headers
   ======================================== */

.tip-modal-header,
.swap-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid #e5e5e5;
}

/* Night mode modal headers */
:root[data-theme="night"] .tip-modal-header,
:root[data-theme="night"] .swap-modal-header {
  border-bottom: 1px solid #4a5568;
}

.tip-modal-header h3,
.swap-modal-header h3 {
  margin: 0;
  font-size: 1.3em;
  font-weight: 700;
  color: #000;
}

/* Night mode header text */
:root[data-theme="night"] .tip-modal-header h3,
:root[data-theme="night"] .swap-modal-header h3 {
  color: #ffffff;
}

.tip-modal-close,
.swap-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.tip-modal-close:hover,
.swap-modal-close:hover {
  background: #f0f0f0;
  color: #000;
}

/* Night mode close buttons */
:root[data-theme="night"] .tip-modal-close,
:root[data-theme="night"] .swap-modal-close {
  color: #a0aec0;
}

:root[data-theme="night"] .tip-modal-close:hover,
:root[data-theme="night"]
  .swap-modal-close:hover {
  background: #4a5568;
  color: #ffffff;
}

/* ========================================
   Modal Bodies
   ======================================== */

.tip-modal-body,
.swap-modal-body {
  padding: 24px;
}

.tip-modal-description,
#swap-modal-description {
  margin: 0 0 20px 0;
  color: #666;
  font-size: 1em;
  line-height: 1.5;
}

/* Night mode modal body text */
:root[data-theme="night"] .tip-modal-description,
:root[data-theme="night"]
  #swap-modal-description {
  color: #a0aec0;
}

/* ========================================
   Tip Interface Specific Styles
   ======================================== */

.tip-section {
  margin: 16px 0 20px 0;
}

.tip-section-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

/* Night mode tip section */
:root[data-theme="night"] .tip-section-title {
  color: #ffffff;
}

.tip-actions {
  margin-bottom: 16px;
}

.tip-address-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tip-address-row code {
  font-size: 0.85em;
  padding: 8px 12px;
  background: #f1f3f5;
  border-radius: 8px;
  word-break: break-all;
  flex: 1;
}

/* Night mode address code */
:root[data-theme="night"] .tip-address-row code {
  background: #4a5568;
  color: #ffffff;
}

/* ========================================
   Swap Interface Specific Styles
   ======================================== */

.swap-platform-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.swap-platform-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  font-weight: 500;
}

.platform-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.platform-icon {
  font-size: 24px;
}

.platform-name {
  font-weight: 600;
  font-size: 1em;
}

.platform-desc {
  font-size: 0.85em;
  opacity: 0.7;
  margin-top: 2px;
}

/* Night mode platform elements */
:root[data-theme="night"] .swap-platform-btn {
  color: #ffffff;
}

:root[data-theme="night"] .platform-name {
  color: #ffffff;
}

:root[data-theme="night"] .platform-desc {
  color: #a0aec0;
  opacity: 1;
}

.platform-arrow {
  font-size: 18px;
  font-weight: bold;
}

.swap-info {
  border-top: 1px solid #e5e5e5;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Night mode swap info */
:root[data-theme="night"] .swap-info {
  border-top: 1px solid #4a5568;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  color: #666;
}

/* Night mode info items */
:root[data-theme="night"] .info-item {
  color: #a0aec0;
}

.info-icon {
  font-size: 16px;
}

/* ========================================
   Unified Button Styles
   ======================================== */

/* Primary buttons (main actions) */
.coinbase-tip-btn,
.swap-platform-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #000;
  color: white;
  border: 2px solid #000;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.coinbase-tip-btn:hover,
.swap-platform-primary:hover {
  background: #333;
  border-color: #333;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Night mode primary buttons */
:root[data-theme="night"] .coinbase-tip-btn,
:root[data-theme="night"] .swap-platform-primary {
  background: #4a90e2;
  color: white;
  border-color: #4a90e2;
}

:root[data-theme="night"] .coinbase-tip-btn:hover,
:root[data-theme="night"]
  .swap-platform-primary:hover {
  background: #3a7bd5;
  border-color: #3a7bd5;
  color: white;
}

/* Secondary buttons */
.swap-platform-secondary {
  background: #f8f9fa;
  color: #333;
  border-color: #e9ecef;
}

.swap-platform-secondary:hover {
  background: white;
  border-color: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Night mode secondary buttons */
:root[data-theme="night"]
  .swap-platform-secondary {
  background: rgba(45, 55, 72, 0.8);
  color: #ffffff;
  border-color: #4a5568;
}

:root[data-theme="night"]
  .swap-platform-secondary:hover {
  background: #4a90e2;
  border-color: #4a90e2;
  color: white;
}

/* Tertiary buttons */
.swap-platform-tertiary {
  background: #f1f3f5;
  color: #495057;
  border-color: #dee2e6;
}

.swap-platform-tertiary:hover {
  background: #e9ecef;
  border-color: #6c757d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Night mode tertiary buttons */
:root[data-theme="night"]
  .swap-platform-tertiary {
  background: rgba(45, 55, 72, 0.6);
  color: #a0aec0;
  border-color: #4a5568;
}

:root[data-theme="night"]
  .swap-platform-tertiary:hover {
  background: rgba(45, 55, 72, 0.9);
  border-color: #a0aec0;
  color: #ffffff;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  .tip-modal-content,
  .swap-modal-content {
    width: 95%;
    margin: 20px;
    max-width: none;
  }

  .tip-modal-header,
  .tip-modal-body,
  .swap-modal-header,
  .swap-modal-body {
    padding: 20px;
  }

  .tip-modal-header,
  .swap-modal-header {
    padding-bottom: 16px;
  }

  .swap-platform-btn,
  .coinbase-tip-btn {
    padding: 14px 16px;
  }

  .platform-name {
    font-size: 0.95em;
  }

  .platform-desc {
    font-size: 0.8em;
  }

  .tip-actions {
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .tip-modal-content,
  .swap-modal-content {
    width: 98%;
    margin: 10px;
  }

  .tip-modal-header h3,
  .swap-modal-header h3 {
    font-size: 1.1em;
  }

  .platform-icon {
    font-size: 20px;
  }
}
