/* 出水高校 DXプラットフォーム - カスタムCSS */

/* ===== Base ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== サイドバーアニメーション ===== */
#sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== スクロールバー非表示ユーティリティ ===== */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ===== モバイル: タッチ操作最適化 ===== */
@media (max-width: 1023px) {
  /* ボタン・リンクのタップ領域を広げる */
  button, a {
    -webkit-tap-highlight-color: transparent;
  }
  /* モーダルを画面下部から出るシート型に */
  .modal-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }
  /* テーブルを横スクロール可能に */
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* カードのテキストを少し小さく */
  .card-text-sm {
    font-size: 0.8rem;
  }
}

/* ===== モバイル底部ナビゲーション（将来拡張用） ===== */
@media (max-width: 639px) {
  /* メインの余白をさらに縮小 */
  main {
    padding-bottom: 1.5rem;
  }
  /* チャット入力欄をモバイルで全幅に */
  #chatInputArea {
    padding: 0.5rem;
  }
}

/* ===== スクロールバーカスタム ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== チャット ===== */
#chatMessages {
  scroll-behavior: smooth;
}
#chatInput {
  max-height: 120px;
  overflow-y: auto;
}

/* ===== ボタン・インタラクション ===== */
button, a {
  outline: none;
}
button:focus-visible, a:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ===== カード ===== */
.card-hover {
  transition: all 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* ===== プログレスバーアニメーション ===== */
@keyframes progressFill {
  from { width: 0%; }
  to { width: var(--progress); }
}
.progress-bar {
  animation: progressFill 1s ease-out forwards;
}

/* ===== バウンスアニメーション（タイピングインジケーター）===== */
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}
.animate-bounce {
  animation: bounce 1.4s infinite;
}

/* ===== フェードイン ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* ===== グラデーションテキスト ===== */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== line-clamp ===== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== モーダルアニメーション ===== */
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
#uploadModal > div,
#ticketModal > div {
  animation: modalFadeIn 0.2s ease-out;
}

/* ===== タブ ===== */
.tab-active {
  border-bottom: 2px solid #2563eb;
  color: #2563eb;
  font-weight: 600;
}

/* ===== テーブル ===== */
table th { font-weight: 600; }
table tr:hover td { background-color: #f8fafc; }

/* ===== ポートフォリオカードホバー ===== */
.portfolio-card:hover .portfolio-overlay {
  opacity: 1;
}
.portfolio-overlay {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* ===== バッジ ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ===== ステータスドット ===== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online { background-color: #22c55e; }
.status-dot.away { background-color: #f59e0b; }
.status-dot.offline { background-color: #9ca3af; }

/* ===== チャート レスポンシブ ===== */
canvas {
  max-width: 100%;
}

/* ===== 印刷スタイル ===== */
@media print {
  #sidebar, header { display: none !important; }
  .ml-64 { margin-left: 0 !important; }
  main { padding: 0 !important; }
}

/* ===== アクセシビリティ ===== */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
