/**
 * YouTube タイムスタンプツール - メインスタイルシート
 * カラースキーム: 明るく、モダンなデザイン
 */

:root {
  --yt-primary: #FF6B6B;
  --yt-secondary: #4ECDC4;
  --yt-accent: #FFE66D;
  --yt-bg: #F8F9FA;
  --yt-card-bg: #FFFFFF;
  --yt-text: #2D3436;
  --yt-border: #E9ECEF;
  --yt-shadow: rgba(0, 0, 0, 0.1);
  --yt-shadow-hover: rgba(0, 0, 0, 0.15);
}

/* 汎用SVGサイズ制限 */
.my-yt-tool-wrapper svg {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* ツールラッパー */
.my-yt-tool-wrapper {
  width: 100%;
  margin: 20px 0;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ツールコンテンツ */
.my-yt-tool-content {
  background: var(--yt-card-bg);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  border: 1px solid var(--yt-border);
}

/* ヘッダー */
.my-yt-tool-header {
  background: linear-gradient(135deg, var(--yt-primary) 0%, #FF8E8E 100%);
  color: white;
  padding: 20px 30px;
  box-shadow: 0 2px 10px var(--yt-shadow);
}

.my-yt-tool-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.my-yt-tool-title svg {
  width: 28px !important;
  height: 28px !important;
  flex-shrink: 0;
  stroke: white;
}

/* タブメニュー */
.my-yt-tab-menu {
  display: flex;
  background: var(--yt-bg);
  padding: 15px 20px 0 20px;
  gap: 8px;
  overflow-x: auto;
  flex-shrink: 0;
}

.my-yt-tab-btn {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--yt-text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px 10px 0 0;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.my-yt-tab-btn svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
  stroke: var(--yt-text);
  opacity: 0.6;
}

.my-yt-tab-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.my-yt-tab-btn.active {
  background: var(--yt-card-bg);
  color: var(--yt-primary);
  box-shadow: 0 -2px 10px var(--yt-shadow);
}

.my-yt-tab-btn.active svg {
  stroke: var(--yt-primary);
  opacity: 1;
}

/* タブコンテンツ */
.my-yt-tab-content-wrapper {
  background: var(--yt-card-bg);
  padding: 30px;
}

.my-yt-tab-content {
  display: none;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.my-yt-tab-content.active {
  display: block;
}

/* セクション */
.my-yt-section {
  background: var(--yt-bg);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
  border: 1px solid var(--yt-border);
  transition: all 0.3s ease;
}

.my-yt-section:hover {
  box-shadow: 0 4px 15px var(--yt-shadow);
}

.my-yt-section h2 {
  margin: 0 0 20px 0;
  font-size: 20px;
  color: var(--yt-text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.my-yt-section h2 svg {
  width: 24px !important;
  height: 24px !important;
  flex-shrink: 0;
  stroke: var(--yt-primary);
}

/* 2カラムレイアウト */
.my-yt-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ラベル */
.my-yt-label {
  display: block;
  font-weight: 600;
  margin: 15px 0 8px 0;
  color: var(--yt-text);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.my-yt-label svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
  stroke: var(--yt-secondary);
}

/* 入力フィールド */
.my-yt-textarea,
.my-yt-input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--yt-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
  color: var(--yt-text);
}

.my-yt-textarea {
  min-height: 100px;
  resize: vertical;
}

.my-yt-textarea:focus,
.my-yt-input:focus {
  outline: none;
  border-color: var(--yt-secondary);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.my-yt-input[type="number"] {
  max-width: 150px;
}

/* セレクトボックス */
.my-yt-select {
  width: 100%;
  max-width: 250px;
  padding: 12px 15px;
  border: 2px solid var(--yt-border);
  border-radius: 10px;
  font-size: 14px;
  background: white;
  color: var(--yt-text);
  cursor: pointer;
  transition: all 0.3s ease;
}

.my-yt-select:focus {
  outline: none;
  border-color: var(--yt-secondary);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

/* ラジオボタン */
.my-yt-radio-group {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.my-yt-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--yt-text);
}

.my-yt-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--yt-primary);cursor: pointer;
}

/* スライダー */
.my-yt-slider-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.my-yt-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--yt-border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.my-yt-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--yt-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.my-yt-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.my-yt-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--yt-primary);
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.my-yt-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* ボタン */
.my-yt-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.my-yt-btn svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
}

.my-yt-btn-primary {
  background: linear-gradient(135deg, var(--yt-primary) 0%, #FF8E8E 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.my-yt-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.my-yt-btn-secondary {
  background: white;
  color: var(--yt-text);
  border: 2px solid var(--yt-border);
}

.my-yt-btn-secondary:hover {
  border-color: var(--yt-primary);
  color: var(--yt-primary);
}

.my-yt-btn-accent {
  background: linear-gradient(135deg, var(--yt-secondary) 0%, #6EDDD5 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.my-yt-btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.my-yt-btn-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

/* タイムスタンプテーブル */
.timestamp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 15px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--yt-shadow);
}

.timestamp-table thead {
  background: linear-gradient(135deg, var(--yt-secondary) 0%, #6EDDD5 100%);
  color: white;
}

.timestamp-table th {
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.timestamp-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--yt-border);
  background: white;
}

.timestamp-table tr:last-child td {
  border-bottom: none;
}

.timestamp-table tr:hover td {
  background: var(--yt-bg);
}

.timestamp-table input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--yt-border);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.timestamp-table input[type="text"]:focus {
  outline: none;
  border-color: var(--yt-secondary);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

/* 装飾ライブラリ */
.separator-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.separator-item {
  background: white;
  padding: 15px;
  border-radius: 10px;
  border: 2px solid var(--yt-border);
  cursor: pointer;
  font-family: monospace;
  font-size: 14px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.separator-item:hover {
  border-color: var(--yt-primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--yt-shadow-hover);
}

.separator-item:active {
  transform: translateY(-1px);
}

.separator-item::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="rgba(255,107,107,0.5)" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>') no-repeat center;
  background-size: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.separator-item:hover::after {
  opacity: 1;
}

/* プレビューエリア */
#outputArea {
  min-height: 400px !important;
  font-family: 'Courier New', monospace;
  background: var(--yt-bg);
  line-height: 1.6;
}

.my-yt-preview-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  padding: 15px;
  background: var(--yt-bg);
  border-radius: 10px;
}

.my-yt-char-count {
  font-size: 14px;
  color: var(--yt-text);
  opacity: 0.7;
}

/* テンプレート機能 */
.my-yt-template-section {
  background: linear-gradient(135deg, rgba(255, 230, 109, 0.1) 0%, rgba(255, 230, 109, 0.05) 100%);
  border: 2px dashed var(--yt-accent);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 20px;
}

.my-yt-template-section h2 {
  font-size: 16px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.my-yt-template-section h2 svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
}

.my-yt-template-section p {
  font-size: 13px;
}

.my-yt-template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.my-yt-template-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  background: white;
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.my-yt-template-item:hover {
  border-color: var(--yt-accent);
  box-shadow: 0 2px 10px rgba(255, 230, 109, 0.3);
}

.my-yt-template-item svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
  stroke: var(--yt-accent);
}

.my-yt-template-delete {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 5px;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.my-yt-template-delete:hover {
  opacity: 1;
}

.my-yt-template-delete svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0;
  stroke: var(--yt-primary);
}

/* Toast通知 */
#yt-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #2D3436 0%, #414a4f 100%);
  color: white;
  padding: 15px 25px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  display: none;
  z-index: 10000000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: toastSlideIn 0.3s ease;
}

@keyframes toastSlideIn {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#yt-toast.show {
  display: flex;
  align-items: center;
  gap: 10px;
}

#yt-toast svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
  stroke: var(--yt-accent);
}

/* レスポンシブ対応 */
@media (max-width: 1023px) {
  .my-yt-two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .my-yt-tool-content {
    border-radius: 10px;
  }
  
  .my-yt-tool-header {
    padding: 15px 20px;
  }
  
  .my-yt-tool-title {
    font-size: 18px;
  }
  
  .my-yt-tab-menu {
    padding: 10px 15px 0 15px;
    gap: 5px;
  }
  
  .my-yt-tab-btn {
    min-width: 100px;
    padding: 10px 12px;
    font-size: 12px;
  }
  
  .my-yt-tab-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .my-yt-tab-content-wrapper {
    padding: 20px 15px;
  }
  
  .my-yt-section {
    padding: 20px 15px;
  }
  
  .separator-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }
  
  .my-yt-btn-group {
    flex-direction: column;
  }
  
  .my-yt-btn {
    width: 100%;
    justify-content: center;
  }
}
