/* modal.css */

/* Overlay — full viewport */
#pdf-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(58, 12, 163, 0.6);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
  }
  
  #pdf-modal.is-open {
    display: flex;
  }
  
  /* Modal box — full width, full height, scrollable */
  .pdf-modal-box {
    background: #e8e8e8;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  /* Header */
  .pdf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid #e0d8f0;
    background: #f5f0ff;
    flex-shrink: 0;
    z-index: 2;
  }
  
  .pdf-modal-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--indigo);
    font-weight: 700;
    border: none;
    padding: 0;
  }
  
  .pdf-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--purple);
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
    transition: color 0.2s;
    flex-shrink: 0;
    margin-left: 1rem;
  }
  
  .pdf-modal-close:hover {
    color: var(--pink-text);
  }
  
  /* Scrollable canvas area — takes all remaining height */
  .pdf-canvas-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #e8e8e8;
    padding: 1.5rem 1rem;
    gap: 1.5rem;         /* space between pages */
    box-sizing: border-box;
  }
  
  /* Each page canvas */
  .pdf-canvas-wrap canvas {
    display: block;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
    background: #fff;
    /* Fill available width */
    width: 100% !important;
    height: auto !important;
  }
  
  /* Footer controls */
  .pdf-modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.7rem 1.5rem;
    border-top: 1px solid #e0d8f0;
    background: #f5f0ff;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--indigo);
  }
  
  .pdf-modal-footer button {
    background: var(--purple);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 1.2rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
  }
  
  .pdf-modal-footer button:hover:not(:disabled) {
    background: var(--hover-purple);
  }
  
  .pdf-modal-footer button:disabled {
    background: #c0b8e8;
    cursor: default;
  }