/* 変わったフォントの適用 */
body {
  font-family: 'Zen Maru Gothic', 'Noto Sans JP', sans-serif;
}

/* 広告コンテナの中央配置 */
.ad-container {
  text-align: center;
  margin: 20px auto;
  padding: 10px 0;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 検索ボックスのスタイル（PC・モバイル共通） */
.companies-search {
  display: flex;
  flex-direction: row;
  gap: 0;
  align-items: stretch;
  margin: 20px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

#companies-search-input {
  flex: 1;
  font-size: 16px;
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 5px 0 0 5px;
  border-right: none;
  outline: none;
  transition: border-color 0.3s;
}

#companies-search-input:focus {
  border-color: #4CAF50;
  border-right: none;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

#companies-search-button {
  padding: 10px 20px;
  font-size: 14px;
  background-color: #4CAF50;
  color: white;
  border: 2px solid #4CAF50;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background-color 0.3s, border-color 0.3s;
}

#companies-search-button:hover {
  background-color: #45a049;
  border-color: #45a049;
}

#companies-search-button i {
  font-size: 14px;
}

#companies-search-button span {
  display: inline;
}

/* 非同期検索時のスタイル */
.companies-search.async-mode #companies-search-input {
  border-radius: 5px;
  border-right: 2px solid #ddd;
}

.companies-search.async-mode #companies-search-input:focus {
  border-right: 2px solid #4CAF50;
}

/* 検索中のインジケーター */
.companies-search.searching::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #4CAF50;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* タイトルや見出しにインパクトのあるフォント */
h1, h2, .companies-header h1 {
  font-family: 'Dela Gothic One', 'Zen Maru Gothic', sans-serif;
}

/* 企業名にレトロゲーム風フォント */
.company-name {
  font-family: 'DotGothic16', 'Zen Maru Gothic', monospace;
  font-weight: bold;
}

/* PC表示での企業名改行防止 */
@media (min-width: 769px) {
  .company-name {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;  /* フォントサイズを少し小さくしてより多くの文字が収まるように */
  }
  
  /* テーブルの列幅調整 */
  .company-table {
    table-layout: fixed;
  }
  
  .company-table th:nth-child(1),
  .company-table td:nth-child(1) {
    width: 25%;
  }
  
  .company-table th:nth-child(2),
  .company-table td:nth-child(2) {
    width: 35%;
  }
  
  .company-table th:nth-child(3),
  .company-table td:nth-child(3) {
    width: 40%;
  }
}

@media (max-width: 768px) {
  /* テーブルのモバイル最適化 */
  .company-table {
    font-size: 14px;
  }
  
  .company-table td,
  .company-table th {
    padding: 10px 5px;
    width: auto !important;
  }
  
  /* 企業名の折り返し問題を解決 */
  .company-name {
    word-break: normal !important;
    white-space: normal !important;
    font-size: 16px;
    width: 100% !important; /* 固定幅を解除 */
  }
  
  /* モデル名をコンパクトに */
  .model-name {
    font-size: 13px;
    color: #666;
    width: 100% !important; /* 固定幅を解除 */
    margin-bottom: 5px;
  }
  
  /* 注目ポイントをシンプルに */
  .highlight-point {
    font-size: 12px;
    line-height: 1.5;
    color: #666;
    width: 100% !important; /* 固定幅を解除 */
  }
  
  /* 国旗を小さく */
  .country-flag {
    font-size: 20px;
  }
  
  /* 検索ボックスのモバイル最適化 */
  .companies-search {
    margin: 15px 0;
  }
  
  #companies-search-input {
    font-size: 14px;
    padding: 8px 12px;
  }
  
  #companies-search-button {
    padding: 8px 15px;
    font-size: 13px;
  }
  
  #companies-search-button span {
    display: none; /* モバイルではアイコンのみ表示 */
  }
  
  /* 地域フィルターをスクロール可能に */
  .region-filter {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
    gap: 10px;
  }
  
  .region-filter button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 14px;
  }
  
  /* フッターのモバイル対応 */
  .site-footer .footer-links {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    line-height: 2.5 !important;
  }
  
  .site-footer .footer-links a {
    margin: 0 !important;
    padding: 8px 16px !important;
    display: block !important;
    font-size: 16px !important;
  }
  
  .site-footer .separator,
  .footer-links .separator {
    display: none !important;
  }
}