/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* 基本スタイル */
body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 20px;
  background-color: #f8f9fa;
}

h1 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 30px;
}

h2 {
  color: #34495e;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

/* ページヘッダー */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-header h1 {
  margin: 0;
  text-align: left;
}

.nav-links {
  display: flex;
  gap: 12px;
}

.nav-links .btn {
  padding: 8px 16px;
  font-size: 14px;
}

/* タブヘッダー */
.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tab-header h2 {
  margin: 0;
  border: none;
  padding: 0;
}

.quick-nav {
  display: flex;
  gap: 8px;
}

/* ナビゲーション */
.navigation {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 30px;
  text-align: center;
}

.user-actions, .auth-actions {
  margin-top: 15px;
}

.user-actions form {
  display: inline-block;
  margin: 0;
}

.auth-actions form {
  display: inline-block;
  margin: 0;
}

/* ボタンスタイル */
.btn {
  display: inline-block;
  padding: 10px 20px;
  margin: 5px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-success {
  background-color: #27ae60;
  color: white;
}

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

.btn-info {
  background-color: #17a2b8;
  color: white;
}

.btn-info:hover {
  background-color: #138496;
}

/* ユーザー一覧 */
.users-list {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 検索セクション */
.search-section {
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.search-form {
  margin-bottom: 0;
}

.search-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 15px;
  align-items: end;
}

@media (max-width: 768px) {
  .search-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.search-field, .filter-field, .sort-field {
  display: flex;
  flex-direction: column;
}

.search-input, .skill-filter, .sort-select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

.search-input:focus, .skill-filter:focus, .sort-select:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.search-buttons {
  display: flex;
  gap: 10px;
  align-items: end;
}

.search-btn, .clear-btn {
  padding: 10px 20px;
  font-size: 14px;
  white-space: nowrap;
}

/* 検索結果情報 */
.search-results-info {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #dee2e6;
}

.search-info, .total-info {
  margin: 0;
  color: #6c757d;
  font-size: 14px;
}

.search-info strong, .total-info strong {
  color: #2c3e50;
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.user-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: visible;
}

.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.user-card h3 {
  margin-top: 0;
  color: #2c3e50;
}

.user-card .skill {
  color: #3498db;
  font-size: 1.1em;
}

.user-card .skill.no-skill {
  color: #95a5a6;
  font-style: italic;
}

.user-card .description {
  color: #6c757d;
  font-style: italic;
}

.user-card .description.no-description {
  color: #95a5a6;
  font-size: 0.9em;
}

.user-card .created-at {
  color: #6c757d;
  font-size: 0.9em;
  margin-bottom: 0;
}

.no-users {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 40px;
}

/* 検索結果なし */
.no-results {
  text-align: center;
  padding: 40px;
}

.no-results-message {
  color: #6c757d;
  font-size: 16px;
  margin-bottom: 10px;
}

.no-results-suggestion {
  color: #8e9aaf;
  font-size: 14px;
  font-style: italic;
  margin-bottom: 0;
}

/* フラッシュメッセージ */
.notice {
  background-color: #d4edda;
  color: #155724;
  padding: 12px 20px;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  margin-bottom: 20px;
}

.alert {
  background-color: #f8d7da;
  color: #721c24;
  padding: 12px 20px;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* Deviseフォームのスタイル */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #2c3e50;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="password"]:focus,
.field textarea:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.field textarea {
  resize: vertical;
}

.actions {
  margin-top: 30px;
  text-align: center;
}

/* Devise エラーメッセージ */
#error_explanation {
  background-color: #f8d7da;
  color: #721c24;
  padding: 15px;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin-bottom: 20px;
}

#error_explanation h2 {
  margin-top: 0;
  font-size: 16px;
}

#error_explanation ul {
  margin-bottom: 0;
}

/* チェックボックスのスタイル */
.field input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

/* 認証フォームのコンテナ */
.auth-container {
  max-width: 500px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

.auth-links {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.auth-links a {
  color: #3498db;
  text-decoration: none;
  margin: 0 10px;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* ゲストログインセクション */
.guest-login-section {
  text-align: center;
  margin: 20px 0;
  padding: 20px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.guest-login-section p {
  margin: 0 0 15px 0;
  color: #666;
  font-weight: bold;
}

.guest-login-section small {
  display: block;
  margin-top: 10px;
  color: #999;
  font-size: 12px;
}

/* マッチング機能のスタイル */
.match-actions {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  text-align: center;
}

.match-status {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 10px;
}

.match-status.matched {
  background-color: #d4edda;
  color: #155724;
}

.match-status.pending {
  background-color: #fff3cd;
  color: #856404;
}

.match-status.received {
  background-color: #cce7ff;
  color: #004085;
}

.btn-sm {
  padding: 5px 15px;
  font-size: 12px;
}

.btn-outline-secondary {
  border: 1px solid #6c757d;
  color: #6c757d;
  background: transparent;
}

.btn-outline-secondary:hover {
  background-color: #6c757d;
  color: white;
}

.btn-outline-danger {
  border: 1px solid #dc3545;
  color: #dc3545;
  background: transparent;
}

.btn-outline-danger:hover {
  background-color: #dc3545;
  color: white;
}

/* マッチング一覧ページ */
.matches-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

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

.match-tabs {
  display: flex;
  border-bottom: 2px solid #dee2e6;
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #6c757d;
  font-weight: bold;
}

.tab-btn.active {
  color: #3498db;
  border-bottom-color: #3498db;
}

.tab-btn:hover {
  color: #3498db;
}

.tab-content {
  display: none;
}

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

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.match-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.match-card:hover {
  transform: translateY(-2px);
}

.match-card.matched {
  border-left: 4px solid #28a745;
}

.match-card.received {
  border-left: 4px solid #007bff;
}

.match-card.sent {
  border-left: 4px solid #ffc107;
}

.match-card h3 {
  margin-top: 0;
  color: #2c3e50;
}

.match-card .description {
  color: #6c757d;
  font-style: italic;
  margin: 10px 0;
}

.match-card .match-actions {
  border-top: 1px solid #eee;
  padding-top: 15px;
  margin-top: 15px;
}

.match-card .match-actions .btn {
  margin: 0 5px;
}

.match-info {
  margin-top: 10px;
  text-align: center;
}

.match-info small {
  color: #8e9aaf;
}

.no-matches {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 40px;
  background: #f8f9fa;
  border-radius: 8px;
}

/* ユーザーカード追加スタイル */
.user-name-link {
  color: #2c3e50;
  text-decoration: none;
  transition: color 0.2s;
}

.user-name-link:hover {
  color: #4a90e2;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* マッチング統計セクション */
.stats-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.stats-header {
  text-align: center;
  margin-bottom: 30px;
}

.stats-header h2 {
  font-size: 2.5em;
  margin: 0 0 10px 0;
  color: white;
  border: none;
  padding: 0;
}

.stats-header p {
  font-size: 1.2em;
  opacity: 0.9;
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.stat-number {
  font-size: 3em;
  font-weight: bold;
  margin-bottom: 10px;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
  font-size: 1.1em;
  opacity: 0.9;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
}

.chart-item {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 25px;
  border: 1px solid rgba(255,255,255,0.2);
}

.chart-item h3 {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 1.4em;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chart-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .stats-section {
    padding: 20px;
    margin-bottom: 20px;
  }
  
  .stats-header h2 {
    font-size: 2em;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .stat-number {
    font-size: 2.2em;
  }
  
  .charts-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .chart-item {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-number {
    font-size: 2em;
  }
  
  .charts-container {
    grid-template-columns: 1fr;
  }
}

.title-description {
  text-align: center;
  margin-bottom: 30px;
}
.title-description p {
  font-size: 1.2em;
  color: #2c3e50;
  margin: 0;
}

/* マッチページ用アバタースタイル */
.match-user-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.match-avatar {
  flex-shrink: 0;
}

.avatar-match {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e1e5e9;
}

.match-user-info {
  flex: 1;
}

.match-user-info h3 {
  margin: 0 0 6px 0;
}

.match-user-info p {
  margin: 0;
}

/* AI相性診断スタイル */
.ai-compatibility-section {
  margin: 12px 0;
}

.btn-ai-diagnose {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-ai-diagnose:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn-ai-diagnose:active {
  transform: translateY(0);
}

.btn-ai-diagnose .ai-icon {
  font-size: 14px;
}

.compatibility-score {
  margin: 12px 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e1e5e9;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  position: relative;
  z-index: -1 !important;
}

.compatibility-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.ai-icon {
  font-size: 16px;
  margin-right: 6px;
}

.compatibility-label {
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.compatibility-details {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-percentage {
  font-size: 18px;
  font-weight: bold;
}

.score-text {
  font-size: 12px;
  opacity: 0.8;
}

.score-loading {
  font-size: 12px;
  color: #6c757d;
  font-style: italic;
}

.score-error {
  font-size: 12px;
  color: #dc3545;
  font-style: italic;
}

/* 相性レベル別の色分け */
.compatibility-excellent {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border-color: #28a745;
}

.compatibility-excellent .score-percentage {
  color: #155724;
}

.compatibility-good {
  background: linear-gradient(135deg, #cce5ff, #b3d9ff);
  border-color: #007bff;
}

.compatibility-good .score-percentage {
  color: #004085;
}

.compatibility-fair {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border-color: #ffc107;
}

.compatibility-fair .score-percentage {
  color: #856404;
}

.compatibility-low {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border-color: #dc3545;
}

.compatibility-low .score-percentage {
  color: #721c24;
}

.compatibility-unknown {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-color: #ced4da;
}

.compatibility-unknown .score-loading {
  color: #6c757d;
}
