/* AI補助金マッチングアプリ - ミニマル白黒デザイン */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #000000;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
}

html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #ffffff;
}

body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', 'Hiragino Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: #ffffff;
  color: var(--black);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}

/* ローディングアニメーション */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  border: 3px solid var(--gray-200);
  border-top: 3px solid var(--black);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

/* AIローディングドット */
@keyframes bounce {
  0%, 80%, 100% { 
    transform: scale(0);
    opacity: 0.5;
  }
  40% { 
    transform: scale(1);
    opacity: 1;
  }
}

.loading-dot {
  width: 10px;
  height: 10px;
  background-color: var(--black);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

#loading-message {
  transition: opacity 0.3s ease;
  color: var(--black);
  font-weight: 500;
}

/* プログレスバー */
.progress-bar {
  height: 4px;
  background-color: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--black);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* カードスタイル */
.grant-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 0;
  transition: all 0.2s ease;
  position: relative;
  margin-bottom: 1rem;
  padding: 1.25rem;
}

.grant-card:hover {
  border-color: var(--black);
  box-shadow: 0 0 0 1px var(--black);
}

.grant-card::before {
  display: none;
}

/* グリッドレイアウト */
.grants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  gap: 1rem;
  width: 100%;
}

@media (max-width: 768px) {
  .grants-grid {
    grid-template-columns: 1fr;
  }
}

/* ボタンスタイル */
.btn-primary {
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--black);
  border-radius: 0;
  padding: 0.875rem 2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
}

.btn-primary:hover {
  background: var(--white);
  color: var(--black);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--black);
  border: 2px solid var(--black);
  border-radius: 0;
  padding: 0.875rem 2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
}

.btn-secondary:hover {
  background-color: var(--black);
  color: var(--white);
}

/* フェードインアニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* 質問カードのスタイル */
.question-card {
  background: var(--white);
  border: none;
  border-top: 2px solid var(--gray-200);
  border-radius: 0;
  padding: 1rem;
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.question-card::before {
  display: none;
}

.question-option {
  border: 2px solid var(--gray-300);
  border-radius: 0;
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--white);
}

.question-option:hover {
  background: var(--gray-50);
  border-color: var(--black);
}

.question-option.selected {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* 入力フィールド */
input[type="text"],
select,
textarea {
  border: 2px solid var(--gray-300);
  border-radius: 0;
  padding: 0.75rem;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: var(--white);
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--black);
  background: var(--gray-50);
}

/* ヘッダースタイル */
.app-header {
  background: var(--white);
  border-bottom: 2px solid var(--black);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* コンテナスタイル */
.app-container {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

/* 全画面レイアウト */
body > div {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
  width: 100%;
  flex: 1;
  overflow: hidden;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  width: 100%;
}

.app-container {
  width: 100%;
  max-width: none !important;
  height: 100%;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .question-card,
  .grant-card {
    border-radius: 0;
    padding: 1.25rem;
  }
  
  .btn-primary,
  .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }
  
  .grants-grid {
    grid-template-columns: 1fr;
  }
}

/* トースト通知 */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--black);
  color: var(--white);
  padding: 1rem 1.5rem;
  border: 2px solid var(--black);
  border-radius: 0;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

/* モーダル */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: var(--white);
  border: 2px solid var(--black);
  border-radius: 0;
  padding: 2rem;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
}

/* スクロールバーのスタイリング */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--black);
}

/* バッジスタイル */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--black);
}

.badge-primary {
  background: var(--black);
  color: var(--white);
}

.badge-success {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
}

.badge-warning {
  background: var(--gray-900);
  color: var(--white);
  border-color: var(--black);
}

/* アイコンスタイル - 白黒に統一 */
.icon-box {
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--black);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ヘッダーロゴエリア */
.logo-icon {
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--black);
  border-radius: 0;
}

/* 情報ボックス */
.info-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 0;
}

.info-box:hover {
  border-color: var(--black);
}

/* エラー表示 */
.error-box {
  background: var(--gray-50);
  border: 2px solid var(--black);
  border-radius: 0;
  padding: 1.25rem;
}

/* 成功表示 */
.success-box {
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 0;
  padding: 1.25rem;
}
