/* Demo Modal Styles - Matching Feedback Modal Design */

/* ===== DEMO MODAL OVERLAY ===== */

.demo-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 16px;
}

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

/* ===== DEMO MODAL CONTENT ===== */

.demo-modal-content {
  background: var(--brokerly-background);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-modal-overlay.active .demo-modal-content {
  transform: scale(1) translateY(0);
}

/* ===== DEMO MODAL HEADER ===== */

.demo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--brokerly-border-light);
  background: var(--brokerly-secondary-background);
}

.demo-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--brokerly-text-primary);
}

.demo-modal-title svg {
  color: var(--brokerly-primary);
  flex-shrink: 0;
}

.demo-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--brokerly-text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-modal-close:hover {
  background: var(--brokerly-tertiary-background);
  color: var(--brokerly-text-primary);
}

.demo-modal-close:active {
  transform: scale(0.95);
}

/* ===== DEMO MODAL BODY ===== */

.demo-modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 60vh;
}

.demo-description {
  color: var(--brokerly-text-secondary);
  line-height: 1.6;
}

.demo-description p {
  margin: 0 0 16px 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--brokerly-text-primary);
}

.demo-features {
  margin: 0;
  padding-left: 20px;
  list-style: none;
}

.demo-features li {
  position: relative;
  margin: 8px 0;
  font-size: var(--font-size-sm);
  color: var(--brokerly-text-secondary);
  line-height: 1.5;
}

.demo-features li::before {
  content: '•';
  position: absolute;
  left: -16px;
  color: var(--brokerly-primary);
  font-weight: bold;
}

/* ===== DEMO MODAL FOOTER ===== */

.demo-modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--brokerly-border-light);
  background: var(--brokerly-secondary-background);
}

.demo-reset-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: #FF3B30;
  color: white;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-reset-button:hover {
  background: #D70015;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.demo-reset-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.2);
}

.demo-reset-button svg {
  flex-shrink: 0;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 640px) {
  .demo-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  
  .demo-modal-content {
    max-width: none;
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 85vh;
    transform: translateY(100%);
  }
  
  .demo-modal-overlay.active .demo-modal-content {
    transform: translateY(0);
  }
  
  .demo-modal-header,
  .demo-modal-body,
  .demo-modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ===== ACCESSIBILITY ===== */

.demo-modal-overlay[aria-hidden="true"] {
  display: none;
}

/* Focus trap styles */
.demo-modal-content:focus {
  outline: none;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== DARK MODE SUPPORT ===== */

@media (prefers-color-scheme: dark) {
  .demo-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
  }
  
  .demo-reset-button:hover {
    background: #FF453A;
  }
}

/* ===== ANIMATION PERFORMANCE ===== */

.demo-modal-overlay,
.demo-modal-content,
.demo-modal-close,
.demo-reset-button {
  will-change: transform, opacity;
}

.demo-modal-overlay.active {
  will-change: auto;
}
