/* ===============================================
   responsive.css - レスポンシブ・アクションボタン
   =============================================== */

/* スマホ対応のアクションボタン */
.icon-button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  border-radius: 6px;
  padding: 6px 8px;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  font-size: 0.9em;
  min-width: 40px;
  justify-content: center;
}

/* ホバー・アクティブ効果 */
.icon-button:hover {
  background-color: rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: translateY(0) scale(0.95);
  background-color: rgba(0,0,0,0.1);
}

/* アイコンと数字のスタイル */
.icon-button i {
  font-size: 1em;
  min-width: 14px;
}

.icon-button span {
  font-size: 0.9em;
  font-weight: 500;
}

/* ハートボタン専用のスタイル */
.icon-button.like:hover {
  color: #e25555 !important;
}

.icon-button.like:hover .fa-heart {
  color: #e25555 !important;
  transform: scale(1.1);
}

.icon-button.like:active .fa-heart {
  transform: scale(1.2);
}

/* リップル効果 */
.icon-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.icon-button:active::before {
  width: 100px;
  height: 100px;
}

.icon-button.like::before {
  background: rgba(226, 85, 85, 0.2);
}

/* 他のボタンの色設定 */
.like-btn:hover {
  color: #e25555 !important;
}

.dislike-btn:hover {
  color: #6c757d !important;
}

.reply-btn:hover {
  color: #007bff !important;
}

.share-btn:hover {
  color: #17a2b8 !important;
}

.menu-btn:hover {
  color: #6c757d !important;
}

.icon-button.delete:hover { 
  color: #f33; 
}

/* ボタンが無効化されている時 */
.icon-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.icon-button:disabled:hover {
  background-color: transparent;
  transform: none;
}

/* スマホ専用の調整 */
@media (max-width: 768px) {
  .post-actions form {
    gap: 4px;
    justify-content: space-between;
    max-width: 100%;
  }
  
  .icon-button {
    flex: 1;
    min-height: 36px;
    min-width: 36px;
    padding: 6px 4px;
    margin: 0;
    border-radius: 8px;
    font-size: 0.85em;
    flex-direction: column;
    gap: 2px;
  }
  
  .icon-button i {
    font-size: 1.1em;
    margin-bottom: 1px;
  }
  
  .icon-button span {
    font-size: 0.8em;
    line-height: 1;
  }
  
  /* スマホでは5つのボタンを均等配置 */
  .post-actions form {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    width: 100%;
  }
}

/* 極小画面用（320px以下） */
@media (max-width: 320px) {
  .icon-button {
    padding: 4px 2px;
    font-size: 0.8em;
  }
  
  .icon-button i {
    font-size: 1em;
  }
  
  .icon-button span {
    font-size: 0.75em;
  }
}

/* テーブルの小画面対応 */
@media (max-width: 768px) {
  .content table {
    font-size: 0.9em;
  }
  
  .content table th,
  .content table td {
    padding: 8px 10px;
  }

  /* 横スクロール可能なテーブルコンテナ */
  .content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .content table thead,
  .content table tbody,
  .content table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
}