/* =============================================
   PC版メール作成モーダル スタイル
   ============================================= */

/* モーダルオーバーレイ */
.desktop-email-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

/* モーダルコンテンツ */
.desktop-email-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

/* ヘッダー */
.desktop-email-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.desktop-email-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.desktop-email-progress {
  font-size: 0.9rem;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
}

.desktop-email-header .modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.desktop-email-header .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Stepper Bar */
.desktop-stepper-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 40px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  gap: 0;
}

.desktop-stepper-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.desktop-stepper-step.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.desktop-stepper-step.completed {
  color: #10b981;
}

.desktop-stepper-step.completed .desktop-stepper-num {
  background: #10b981;
  color: white;
}

.desktop-stepper-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.desktop-stepper-step.active .desktop-stepper-num {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.desktop-stepper-label {
  font-weight: 500;
  font-size: 0.9rem;
}

.desktop-stepper-connector {
  width: 60px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 10px;
}

/* ボディ */
.desktop-email-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ステップヘッダー */
.desktop-step-header {
  margin-bottom: 24px;
  text-align: center;
}

.desktop-step-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.desktop-step-title {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 12px;
}

.desktop-step-subtitle {
  display: block;
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 4px;
}

/* Step 1: 宛先確認 */
.desktop-recipient-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
}

.desktop-card-preview {
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.desktop-card-preview-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-card-image {
  padding: 20px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
}

.desktop-card-image img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.desktop-email-no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
}

.desktop-email-no-image i {
  font-size: 3rem;
}

/* フォーム */
.desktop-recipient-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.desktop-form-row {
  display: flex;
  gap: 16px;
}

.desktop-form-row-2col > .desktop-form-group {
  flex: 1;
}

.desktop-form-row-name {
  display: flex;
  gap: 16px;
}

.desktop-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.desktop-form-group-flex {
  flex: 1;
}

.desktop-form-group-honorific {
  width: 100px;
}

.desktop-form-group-email {
  flex: 1;
}

.desktop-form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-form-input,
.desktop-form-select {
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.desktop-form-input:focus,
.desktop-form-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.desktop-form-input.valid {
  border-color: #10b981;
}

.desktop-form-input.invalid {
  border-color: #ef4444;
}

/* CC/BCC */
.desktop-ccbcc-accordion {
  margin-top: 8px;
}

.desktop-ccbcc-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #667eea;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.2s;
}

.desktop-ccbcc-toggle:hover {
  color: #764ba2;
}

.desktop-ccbcc-toggle i {
  transition: transform 0.2s;
}

.desktop-ccbcc-toggle.expanded i {
  transform: rotate(90deg);
}

.desktop-ccbcc-content {
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* メモセクション */
.desktop-memo-section {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}

.desktop-memo-section.no-memo {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.desktop-memo-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.desktop-memo-icon {
  width: 36px;
  height: 36px;
  background: rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d97706;
}

.desktop-memo-header-text {
  display: flex;
  flex-direction: column;
}

.desktop-memo-title {
  font-weight: 600;
  color: #92400e;
  font-size: 0.95rem;
}

.desktop-memo-hint {
  font-size: 0.8rem;
  color: #b45309;
}

.desktop-memo-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
  background: rgba(255, 255, 255, 0.7);
}

.desktop-memo-textarea:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.desktop-memo-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: #b45309;
}

/* Step 2: 用件選択 */
.desktop-context-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.desktop-section-label {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-section-label i {
  color: #667eea;
}

/* シチュエーションカード */
.desktop-situation-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.desktop-situation-cards .situation-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.desktop-situation-cards .situation-card:hover {
  border-color: #667eea;
  background: #f8fafc;
}

.desktop-situation-cards .situation-card.active {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.desktop-situation-cards .situation-card input[type="radio"] {
  display: none;
}

.desktop-situation-cards .situation-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.desktop-situation-cards .situation-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.desktop-situation-cards .situation-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
}

.desktop-situation-cards .situation-desc {
  font-size: 0.75rem;
  color: #64748b;
}

/* トーンオプション */
.desktop-tone-options {
  display: flex;
  gap: 16px;
}

.desktop-tone-options .tone-option {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 12px;
}

.desktop-tone-options .tone-option:hover {
  border-color: #667eea;
}

.desktop-tone-options .tone-option.active {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.desktop-tone-options .tone-option input[type="radio"] {
  display: none;
}

.desktop-tone-options .tone-icon {
  font-size: 1.5rem;
}

.desktop-tone-options .tone-label {
  font-weight: 600;
  color: #1e293b;
}

.desktop-tone-options .tone-desc {
  font-size: 0.8rem;
  color: #64748b;
}

/* Step2 メモ表示 */
.desktop-step2-memo-section {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 16px;
}

.desktop-step2-memo-content {
  background: white;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.6;
  margin-top: 8px;
}

.desktop-step2-memo-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #b45309;
  margin-top: 10px;
}

/* 日程調整セクション */
.desktop-schedule-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.desktop-schedule-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 16px;
}

.desktop-schedule-candidates {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.desktop-schedule-section .schedule-candidate {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
}

.desktop-schedule-section .candidate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.desktop-schedule-section .candidate-number {
  font-weight: 600;
  color: #374151;
}

.desktop-schedule-section .candidate-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.desktop-schedule-section .candidate-remove:hover {
  background: #fef2f2;
}

.desktop-schedule-section .candidate-inputs {
  display: flex;
  gap: 16px;
}

.desktop-schedule-section .candidate-inputs > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.desktop-schedule-section .candidate-inputs label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
}

.desktop-schedule-section .schedule-date-input,
.desktop-schedule-section .schedule-time-select,
.desktop-schedule-section .schedule-duration-select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
}

.desktop-schedule-section .add-candidate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: white;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  color: #667eea;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}

.desktop-schedule-section .add-candidate-btn:hover {
  border-color: #667eea;
  background: #f8fafc;
}

.desktop-schedule-section .add-candidate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 自由記述 */
.desktop-custom-message-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.desktop-custom-message-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 12px;
}

.desktop-custom-message-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  resize: vertical;
}

.desktop-custom-message-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* プレビュー */
.desktop-context-preview-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.desktop-context-preview {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
}

.desktop-context-preview .preview-subject {
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.desktop-context-preview .preview-body {
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.7;
}

/* AI生成ボタン */
.desktop-generate-section {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.desktop-generate-draft-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.desktop-generate-draft-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.desktop-generate-draft-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Step 3: 編集・送信 */
.desktop-edit-preview-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* エディタ */
.desktop-email-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.desktop-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.desktop-editor-label {
  font-weight: 600;
  color: #374151;
}

.desktop-editor-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.desktop-editor-field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

.desktop-editor-input {
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
}

.desktop-editor-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.desktop-editor-textarea {
  padding: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 300px;
  line-height: 1.7;
  font-family: inherit;
}

.desktop-editor-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.desktop-editor-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #64748b;
}

/* プレビュー */
.desktop-email-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.desktop-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.desktop-preview-label {
  font-weight: 600;
  color: #374151;
}

.desktop-device-toggle {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
}

.desktop-device-toggle .device-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.desktop-device-toggle .device-btn.active {
  background: white;
  color: #667eea;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.desktop-preview-frame {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  min-height: 360px;
  transition: max-width 0.3s ease;
}

.desktop-preview-frame.mobile-view {
  max-width: 375px;
  margin: 0 auto;
}

.desktop-preview-header-bar {
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
  color: #64748b;
}

.desktop-preview-subject-bar {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.desktop-preview-body-content {
  padding: 20px 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #374151;
  min-height: 250px;
}

/* Safety Check */
.desktop-send-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.desktop-safety-check {
  display: flex;
  gap: 16px;
}

.desktop-safety-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #64748b;
}

.desktop-safety-item.valid {
  color: #10b981;
}

.desktop-safety-item.valid i {
  color: #10b981;
}

.desktop-safety-item.invalid {
  color: #ef4444;
}

.desktop-safety-item.invalid i {
  color: #ef4444;
}

.desktop-send-buttons {
  display: flex;
  gap: 12px;
}

.desktop-email-send-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.desktop-email-send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.desktop-email-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* フッター */
.desktop-email-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.desktop-email-nav-info {
  font-size: 0.9rem;
  color: #64748b;
}

.desktop-email-nav-buttons {
  display: flex;
  gap: 12px;
}

.desktop-email-back-btn,
.desktop-email-skip-btn,
.desktop-email-next-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.desktop-email-back-btn {
  background: #e2e8f0;
  color: #475569;
}

.desktop-email-back-btn:hover {
  background: #cbd5e1;
}

.desktop-email-skip-btn {
  background: #f1f5f9;
  color: #64748b;
}

.desktop-email-skip-btn:hover {
  background: #e2e8f0;
}

.desktop-email-next-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.desktop-email-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* モバイルでは非表示 */
@media (max-width: 768px) {
  .desktop-email-modal {
    display: none !important;
  }
}

/* レスポンシブ調整 */
@media (max-width: 1100px) {
  .desktop-email-content {
    max-width: 95%;
  }
  
  .desktop-recipient-container {
    grid-template-columns: 1fr;
  }
  
  .desktop-card-preview {
    max-width: 400px;
    margin: 0 auto;
  }
  
  .desktop-situation-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .desktop-edit-preview-container {
    grid-template-columns: 1fr;
  }
}

