/* ========================================
   販促資料送付ページ専用スタイル
   ======================================== */

/* ========================================
   Layout Override
   ======================================== */
.promotion-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ========================================
   Category Filter
   ======================================== */
.category-filter {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.375rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.filter-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

/* ========================================
   Materials List
   ======================================== */
.materials-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.material-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.2s;
  cursor: pointer;
}

.material-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.material-card.selected {
  border-color: var(--accent-green);
  background: rgba(34, 197, 94, 0.1);
}

.material-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.material-checkbox {
  width: 22px;
  height: 22px;
  min-width: 22px;
  appearance: none;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.material-checkbox:checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.material-checkbox:checked::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.material-info {
  flex: 1;
  min-width: 0;
}

.material-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.material-category {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-purple);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.material-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-left: 2rem;
}

.action-btn {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* プレビューボタン - 青系 */
.action-btn.preview-btn {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.action-btn.preview-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #3b82f6;
}

/* YouTubeボタン - 赤系 */
.action-btn.youtube {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.action-btn.youtube:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ef4444;
}

/* リンクボタン - 緑系 */
.action-btn.link-btn {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.action-btn.link-btn:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: #22c55e;
  color: #22c55e;
}

/* ========================================
   Selected Materials Summary
   ======================================== */
.selected-materials-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  min-height: 60px;
}

.no-selection {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.selected-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.selected-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.selected-item::before {
  content: '✓';
  color: var(--accent-green);
  font-weight: 700;
}

/* ========================================
   Modal
   ======================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  padding: 1rem;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: var(--bg-secondary);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--accent-red);
  color: white;
}

.modal-body {
  flex: 1;
  min-height: 400px;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

/* ========================================
   Desktop Adjustments
   ======================================== */
@media (min-width: 768px) {
  .promotion-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .category-filter {
    gap: 0.5rem;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }

  .material-card {
    padding: 1.25rem;
  }

  .material-title {
    font-size: 1rem;
  }

  .material-actions {
    padding-left: 2.25rem;
  }

  .action-btn {
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
  }

  .modal-body {
    min-height: 500px;
  }

  .modal-body iframe {
    min-height: 500px;
  }
}

/* ========================================
   Send Button State
   ======================================== */
#sendEmailBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#sendEmailBtn:not(:disabled) {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}
