/* 法規制情報モニタリング支援システム カスタムCSS */

/* SaaS風の色彩設定 */
:root {
  --primary-color: #3B82F6;
  --primary-dark: #1D4ED8;
  --secondary-color: #6366F1;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --error-color: #EF4444;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
}

/* 基本設定 */
body {
  font-family: 'Inter', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  line-height: 1.6;
}

/* ログインフォーム */
.login-container {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-card {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

/* サイドバーのアクティブ状態 */
.nav-active {
  background-color: #EBF4FF;
  color: var(--primary-color);
  border-right: 3px solid var(--primary-color);
}

/* カード要素 */
.card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.card-body {
  padding: 1.5rem;
}

/* ボタンスタイル */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: 1px solid var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background-color: var(--gray-200);
}

.btn-success {
  background-color: var(--success-color);
  color: white;
  border: 1px solid var(--success-color);
}

.btn-danger {
  background-color: var(--error-color);
  color: white;
  border: 1px solid var(--error-color);
}

.btn-warning {
  background-color: var(--warning-color);
  color: white;
  border: 1px solid var(--warning-color);
}

.btn-warning:hover {
  background-color: #D97706;
  border-color: #D97706;
}

.btn-success:hover {
  background-color: #059669;
  border-color: #059669;
}

.btn-danger:hover {
  background-color: #DC2626;
  border-color: #DC2626;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:disabled:hover {
  background-color: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-700);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* フォーム要素 */
.form-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25;
  color: var(--gray-700);
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25;
  color: var(--gray-700);
  background-color: white;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  appearance: none;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25;
  color: var(--gray-700);
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
  color: var(--primary-color);
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: 0.25rem;
  cursor: pointer;
}

.form-checkbox:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.25rem;
}

/* テーブル */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.table th {
  font-weight: 600;
  color: var(--gray-700);
  background-color: var(--gray-50);
}

.table tbody tr:hover {
  background-color: var(--gray-50);
}

/* ステータスバッジ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
}

.badge-success {
  background-color: #D1FAE5;
  color: #065F46;
}

.badge-warning {
  background-color: #FEF3C7;
  color: #92400E;
}

.badge-error {
  background-color: #FEE2E2;
  color: #991B1B;
}

.badge-info {
  background-color: #DBEAFE;
  color: #1E40AF;
}

/* ローディング */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* レスポンシブ（PC専用だが、最小限の調整） */
@media (max-width: 1024px) {
  .container {
    padding: 0 1rem;
  }
}

/* クロール管理画面専用スタイル */
.tab-button {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-button:hover {
  color: var(--primary-color);
  border-bottom-color: #93C5FD;
}

.tab-button.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background-color: #EBF8FF;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 優先度バッジ */
.priority-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
}

.priority-1 {
  background-color: #FEE2E2;
  color: #991B1B;
}

.priority-2 {
  background-color: #FEF3C7;
  color: #92400E;
}

.priority-3 {
  background-color: #D1FAE5;
  color: #065F46;
}

/* ステータスバッジ */
.status-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
}

.status-active {
  background-color: #D1FAE5;
  color: #065F46;
}

.status-inactive {
  background-color: var(--gray-100);
  color: var(--gray-600);
}

.status-running {
  background-color: #DBEAFE;
  color: #1E40AF;
}

.status-success {
  background-color: #D1FAE5;
  color: #065F46;
}

.status-error {
  background-color: #FEE2E2;
  color: #991B1B;
}

/* ソースタイプバッジ */
.source-type-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
}

.source-site {
  background-color: #DBEAFE;
  color: #1E40AF;
}

.source-keyword {
  background-color: #EDE9FE;
  color: #6B21A8;
}

/* モーダルスタイル */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  overflow-y: auto;
  width: 90%;
  max-width: 500px;
  margin: 2rem;
}

.modal-content.max-w-2xl {
  max-width: 42rem;
}

.modal-content.max-w-xl {
  max-width: 36rem;
}

.modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1rem 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal-close {
  color: var(--gray-400);
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--gray-600);
}

/* アニメーション効果 */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { 
    opacity: 0;
    transform: translateY(-10px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* ダークモード対応（将来の拡張用） */
@media (prefers-color-scheme: dark) {
  /* ダークモード用のスタイルをここに追加 */
}

/* Tailwindユーティリティクラス補完 */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .md\:grid-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.space-x-3 > * + * {
  margin-left: 0.75rem;
}

.space-x-2 > * + * {
  margin-left: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.mr-4 {
  margin-right: 1rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.font-semibold {
  font-weight: 600;
}

.font-medium {
  font-weight: 500;
}

.font-bold {
  font-weight: 700;
}

.text-gray-800 {
  color: var(--gray-800);
}

.text-gray-600 {
  color: var(--gray-600);
}

.text-gray-500 {
  color: var(--gray-500);
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.uppercase {
  text-transform: uppercase;
}

.tracking-wider {
  letter-spacing: 0.05em;
}

.p-6 {
  padding: 1.5rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.bg-gray-50 {
  background-color: var(--gray-50);
}

.bg-white {
  background-color: white;
}

.border-b {
  border-bottom-width: 1px;
}

.border-gray-200 {
  border-color: var(--gray-200);
}

.divide-y > * + * {
  border-top-width: 1px;
}

.divide-gray-200 > * + * {
  border-top-color: var(--gray-200);
}

.min-w-full {
  min-width: 100%;
}

.overflow-x-auto {
  overflow-x: auto;
}

.text-left {
  text-align: left;
}

.hover\:bg-gray-50:hover {
  background-color: var(--gray-50);
}

.text-blue-600 {
  color: #2563EB;
}

.hover\:text-blue-800:hover {
  color: #1E40AF;
}

.text-green-600 {
  color: #16A34A;
}

.hover\:text-green-800:hover {
  color: #15803D;
}

.text-red-600 {
  color: #DC2626;
}

.hover\:text-red-800:hover {
  color: #991B1B;
}

.hidden {
  display: none;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.rounded-lg {
  border-radius: 0.5rem;
}

.bg-blue-50 {
  background-color: #EFF6FF;
}

.bg-green-50 {
  background-color: #F0FDF4;
}

.bg-yellow-50 {
  background-color: #FEFCE8;
}

.bg-red-50 {
  background-color: #FEF2F2;
}

.bg-purple-50 {
  background-color: #FAF5FF;
}

.border {
  border-width: 1px;
}

.border-yellow-200 {
  border-color: #FDE68A;
}

.rounded-md {
  border-radius: 0.375rem;
}

.text-yellow-800 {
  color: #92400E;
}

.fixed {
  position: fixed;
}

.top-4 {
  top: 1rem;
}

.right-4 {
  right: 1rem;
}

.z-50 {
  z-index: 50;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.rounded-lg {
  border-radius: 0.5rem;
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.text-white {
  color: white;
}

/* オートコンプリート用スタイル */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 50;
  max-height: 15rem;
  overflow-y: auto;
}

.autocomplete-item,
.autocomplete-create {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background-color 0.2s;
}

.autocomplete-item:hover,
.autocomplete-create:hover {
  background-color: var(--gray-50);
}

.autocomplete-create:hover {
  background-color: #EFF6FF;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-create {
  border-top: 2px solid #DBEAFE;
  border-bottom: none;
}

.autocomplete-item.active,
.autocomplete-create.active {
  background-color: var(--gray-100);
}

.autocomplete-create.active {
  background-color: #EFF6FF;
}

/* 印刷用スタイル */
@media print {
  .sidebar,
  .no-print {
    display: none !important;
  }
  
  .main-content {
    width: 100% !important;
    margin: 0 !important;
  }
}