/**
 * Shopify Order Dev - Phase 1 Styles
 * ダミーJWT認証システムのスタイル
 */

/* リセット・基本設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  animation: pageLoad 0.1s ease-in forwards;
}

@keyframes pageLoad {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.fade-out {
  animation: pageFadeOut 0.1s ease-out forwards !important;
}

@keyframes pageFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* アプリケーション全体のレイアウト */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ヘッダー */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* メインコンテンツ */
#main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 400px;
}

/* 認証セクション */
.auth-section {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 600px;
  width: 100%;
}

.auth-section.hidden {
  display: none;
}

/* ボタンスタイル */
.auth-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  min-width: 150px;
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-button.disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ユーザー情報表示 */
.user-info {
  text-align: left;
  margin-bottom: 2rem;
}

.user-info h3 {
  color: #333;
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  text-align: center;
}

.user-details {
  background: #f8f9fa;
  border-radius: 5px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.user-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
}

.user-field:last-child {
  border-bottom: none;
}

.user-field label {
  font-weight: 600;
  color: #495057;
  flex: 0 0 120px;
}

.user-value {
  color: #333;
  flex: 1;
  text-align: right;
  word-break: break-all;
}

/* JWT詳細情報 */
.jwt-details {
  margin-top: 1rem;
}

.jwt-details summary {
  cursor: pointer;
  padding: 0.5rem;
  background: #e9ecef;
  border-radius: 3px;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.jwt-details summary:hover {
  background: #dee2e6;
}

.jwt-content {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 5px;
  border: 1px solid #dee2e6;
}

.jwt-data {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #495057;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* エラー表示 */
.user-error {
  text-align: center;
  color: #dc3545;
}

.user-error h3 {
  color: #dc3545;
  margin-bottom: 1rem;
}

.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 5px;
  border: 1px solid #f5c6cb;
}

/* ローディング表示 */
.user-loading {
  text-align: center;
  color: #6c757d;
}

.user-loading h3 {
  color: #6c757d;
  margin-bottom: 1rem;
}

/* フッター */
footer {
  background: #343a40;
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

footer p {
  opacity: 0.8;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  header p {
    font-size: 1rem;
  }
  
  .auth-section {
    margin: 0 1rem;
    padding: 1.5rem;
  }
  
  .user-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .user-field label {
    flex: none;
  }
  
  .user-value {
    text-align: left;
  }
  
  .jwt-data {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  #main-content {
    padding: 1rem;
  }
  
  .auth-button {
    width: 100%;
    padding: 1rem;
  }
  
  header {
    padding: 1.5rem 1rem;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
}

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

.auth-section {
  animation: fadeIn 0.5s ease-out;
}

/* フォーカス状態のアクセシビリティ */
.auth-button:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.jwt-details summary:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* 印刷用スタイル */
@media print {
  body {
    background: white;
  }
  
  header {
    background: #333 !important;
    -webkit-print-color-adjust: exact;
  }
  
  .auth-button {
    display: none;
  }
  
  .jwt-details summary {
    display: none;
  }
  
  .jwt-content {
    border: 1px solid #333;
  }
}