/* PDF文字数カウントツール - スタイル定義 */

/* コンテナ基本スタイル */
#pdf-char-counter-app {
  max-width: 48rem;
  margin: 2rem auto;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ファイルアップロード領域 */
#pdf-char-counter-app .block {
  display: block;
}

#pdf-char-counter-app label[for="pdfFile"] {
  display: block;
  border: 2px dashed #60a5fa;
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

#pdf-char-counter-app label[for="pdfFile"]:hover {
  background-color: #eff6ff;
}

#pdf-char-counter-app label[for="pdfFile"] span {
  display: block;
  font-size: 0.875rem;
  color: #4b5563;
}

/* ファイル情報表示 */
#fileInfo {
  margin-top: 0.75rem;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 0.375rem;
  padding: 0.75rem;
  font-size: 0.75rem;
}

#fileInfo.hidden {
  display: none;
}

#fileInfo div {
  color: #1f2937;
  margin-bottom: 0.25rem;
}

#fileInfo div:last-child {
  margin-bottom: 0;
}

#fileInfo strong {
  font-weight: 600;
}

/* 入力フィールド */
#pdf-char-counter-app input[type="number"] {
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}

#pdf-char-counter-app input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* エラーメッセージ */
#errorMessage {
  margin-bottom: 1rem;
  padding: 1rem;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 0.5rem;
  display: none;
}

#errorMessage.hidden {
  display: none;
}

#errorMessage:not(.hidden) {
  display: block;
}

/* ローディングスピナー */
#loadingSpinner {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

#loadingSpinner.hidden {
  display: none;
}

#loadingSpinner:not(.hidden) {
  display: flex;
}

#loadingSpinner .bg-white {
  background: white;
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#loadingSpinner svg {
  height: 3rem;
  width: 3rem;
  color: #2563eb;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#loadingText {
  color: #1f2937;
  font-weight: 500;
}

#loadingDetail {
  font-size: 0.75rem;
  color: #6b7280;
}

/* 結果表示コンテナ */
#resultsContainer {
  display: none;
}

#resultsContainer.hidden {
  display: none;
}

#resultsContainer:not(.hidden) {
  display: block;
}

/* 結果カードグリッド */
.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* カード基本スタイル */
.bg-gradient-to-br {
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid;
}

.from-blue-50 {
  background: linear-gradient(to right bottom, #eff6ff, #dbeafe);
  border-color: #93c5fd;
}

.from-green-50 {
  background: linear-gradient(to right bottom, #f0fdf4, #dcfce7);
  border-color: #86efac;
}

.from-purple-50 {
  background: linear-gradient(to right bottom, #faf5ff, #f3e8ff);
  border-color: #d8b4fe;
}

.from-orange-50 {
  background: linear-gradient(to right bottom, #fff7ed, #fed7aa);
  border-color: #fdba74;
}

/* カード内テキスト */
.text-xs {
  font-size: 0.75rem;
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.font-bold {
  font-weight: 700;
}

.font-medium {
  font-weight: 500;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.text-blue-700 {
  color: #1d4ed8;
}

.text-blue-900 {
  color: #1e3a8a;
}

.text-green-700 {
  color: #15803d;
}

.text-green-900 {
  color: #14532d;
}

.text-purple-700 {
  color: #7c3aed;
}

.text-purple-900 {
  color: #4c1d95;
}

.text-orange-700 {
  color: #b45309;
}

.text-orange-900 {
  color: #78350f;
}

.text-gray-600 {
  color: #4b5563;
}

/* グラフ領域 */
#charCountChart {
  max-height: 300px;
  margin-top: 1rem;
}

/* テーブルスタイル */
.overflow-x-auto {
  overflow-x: auto;
}

table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

thead {
  background: #f3f4f6;
  border-bottom: 1px solid #d1d5db;
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #374151;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

tr:hover {
  background: #f9fafb;
}

.text-right {
  text-align: right;
}

/* 注意情報 */
.bg-yellow-50 {
  background: #fffbeb;
}

.text-yellow-800 {
  color: #78350f;
}

.border-yellow-200 {
  border-color: #fef08a;
}

/* 関連ツール グリッド */
.grid.md\:grid-cols-3 {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .grid.md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .grid.md\:grid-cols-3 {
    grid-template-columns: 1fr;
  }
}

.bg-gradient-to-r {
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid;
  transition: all 0.2s;
}

.from-blue-50.to-indigo-50 {
  background: linear-gradient(to right, #eff6ff, #e0e7ff);
  border-color: #93c5fd;
}

.from-blue-50.to-indigo-50:hover {
  border-color: #60a5fa;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.bg-gradient-to-r h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 0.25rem;
}

.bg-gradient-to-r p {
  font-size: 0.75rem;
  color: #374151;
  margin-bottom: 0.5rem;
}

.bg-gradient-to-r a {
  display: inline-block;
  font-size: 0.75rem;
  background: #3b82f6;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: background-color 0.2s;
}

.bg-gradient-to-r a:hover {
  background: #2563eb;
}

/* ユーティリティ */
.hidden {
  display: none !important;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.my-6 {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.my-8 {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.my-12 {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.pt-6 {
  padding-top: 1.5rem;
}

.border-t {
  border-top: 1px solid #d1d5db;
}

.border-b {
  border-bottom: 1px solid #d1d5db;
}

.rounded {
  border-radius: 0.375rem;
}

.rounded-lg {
  border-radius: 0.5rem;
}

/* レスポンシブ対応 */
@media (max-width: 640px) {
  #pdf-char-counter-app {
    margin: 1rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.75rem;
  }

  th,
  td {
    padding: 0.5rem 0.75rem;
  }
}

/* アクセシビリティ */
*:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
