/* frontend-src/css/project-share-context-menu.css */
/* 專案分享右鍵選單樣式 - 獨立模組 */

/* 右鍵選單 */
.share-context-menu {
  background: white;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 200px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  z-index: 10000;
  overflow: hidden;
}

.share-context-menu .menu-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f8f9fa;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
}

.share-context-menu .menu-item:last-child {
  border-bottom: none;
}

.share-context-menu .menu-item:hover {
  background-color: #f8f9fa;
}

/* 網頁瀏覽選項特殊樣式 */
.share-context-menu .menu-item.web-view-option {
  color: #0066cc;
  font-weight: 500;
  background: linear-gradient(45deg, #f0f8ff, #ffffff);
}

.share-context-menu .menu-item.web-view-option:hover {
  background: linear-gradient(45deg, #e3f2fd, #f0f8ff);
  transform: translateX(2px);
}

/* 危險操作樣式 */
.share-context-menu .menu-item.danger {
  color: #dc3545;
}

.share-context-menu .menu-item.danger:hover {
  background-color: #fff5f5;
}

/* 分享成功對話框 */
.share-success-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.3s ease;
}

.share-success-dialog .dialog-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
}

.share-success-dialog .dialog-header {
  padding: 20px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 20px;
}

.share-success-dialog .dialog-header h3 {
  margin: 0;
  color: #28a745;
  font-size: 18px;
}

.share-success-dialog .close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
  padding: 5px;
  border-radius: 4px;
}

.share-success-dialog .close-btn:hover {
  background: #f0f0f0;
}

.share-success-dialog .dialog-body {
  padding: 0 20px 20px;
}

.share-success-dialog .dialog-body p {
  margin: 8px 0;
  font-size: 14px;
}

.share-success-dialog .share-url-group {
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.share-success-dialog .share-url-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #495057;
}

.share-success-dialog .url-copy-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-success-dialog .url-copy-group input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  background: white;
}

.share-success-dialog .url-copy-group button {
  padding: 10px 16px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s;
}

.share-success-dialog .url-copy-group button:hover {
  background: #0056b3;
}

.share-success-dialog .dialog-actions {
  padding: 0 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.share-success-dialog .btn-primary {
  padding: 10px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.share-success-dialog .btn-primary:hover {
  background: #218838;
}

.share-success-dialog .btn-secondary {
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.share-success-dialog .btn-secondary:hover {
  background: #545b62;
}

/* 通知樣式 */
.share-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 10002;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 350px;
  word-wrap: break-word;
}

.share-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.share-notification.success { 
  background: linear-gradient(135deg, #28a745, #20c997); 
}

.share-notification.error { 
  background: linear-gradient(135deg, #dc3545, #fd7e14); 
}

.share-notification.info { 
  background: linear-gradient(135deg, #17a2b8, #6f42c1); 
}

.share-notification.warning { 
  background: linear-gradient(135deg, #ffc107, #fd7e14); 
  color: #212529;
}

/* 動畫效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    transform: translateY(50px); 
    opacity: 0; 
  }
  to { 
    transform: translateY(0); 
    opacity: 1; 
  }
}

/* 響應式設計 */
@media (max-width: 768px) {
  .share-success-dialog .dialog-content {
    width: 95%;
    margin: 10px;
  }
  
  .share-context-menu {
    min-width: 160px;
    font-size: 13px;
  }
  
  .share-notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* 深色模式支援 */
@media (prefers-color-scheme: dark) {
  .share-context-menu {
    background: #2d3748;
    border-color: #4a5568;
    color: white;
  }
  
  .share-context-menu .menu-item {
    border-color: #4a5568;
  }
  
  .share-context-menu .menu-item:hover {
    background-color: #4a5568;
  }
  
  .share-success-dialog .dialog-content {
    background: #2d3748;
    color: white;
  }
  
  .share-success-dialog .dialog-header {
    border-color: #4a5568;
  }
  
  .share-success-dialog .share-url-group {
    background: #1a202c;
    border-color: #4a5568;
  }
  
  .share-success-dialog .url-copy-group input {
    background: #2d3748;
    border-color: #4a5568;
    color: white;
  }
}