/**
 * Gugenka Auth - Styles
 * @version 2.0.0
 */

/* CSS変数（カスタマイズ用） */
:root {
  --gugenka-auth-primary: #4285F4;
  --gugenka-auth-primary-hover: #3367D6;
  --gugenka-auth-bg: rgba(0, 0, 0, 0.85);
  --gugenka-auth-modal-bg: #ffffff;
  --gugenka-auth-text: #1f2937;
  --gugenka-auth-text-secondary: #6b7280;
  --gugenka-auth-error: #ef4444;
  --gugenka-auth-border: #e5e7eb;
  --gugenka-auth-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* オーバーレイ */
.gugenka-auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gugenka-auth-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: gugenkaAuthFadeIn 0.3s ease-out;
}

.gugenka-auth-overlay.gugenka-auth-fade-out {
  animation: gugenkaAuthFadeOut 0.3s ease-out forwards;
}

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

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

/* モーダル */
.gugenka-auth-modal {
  background: var(--gugenka-auth-modal-bg);
  padding: 3rem;
  border-radius: 1rem;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--gugenka-auth-shadow);
  animation: gugenkaAuthSlideUp 0.3s ease-out;
}

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

/* ロゴ */
.gugenka-auth-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 1rem;
  object-fit: contain;
}

/* タイトル */
.gugenka-auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gugenka-auth-text);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

/* メッセージ */
.gugenka-auth-message {
  color: var(--gugenka-auth-text-secondary);
  margin: 0 0 2rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Googleログインボタン */
.gugenka-auth-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1.75rem;
  background: #ffffff;
  border: 1px solid var(--gugenka-auth-border);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gugenka-auth-text);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 280px;
}

.gugenka-auth-google-btn:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.gugenka-auth-google-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.gugenka-auth-google-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.gugenka-auth-google-btn svg {
  flex-shrink: 0;
}

/* ヒント */
.gugenka-auth-hint {
  margin: 1.5rem 0 0;
  font-size: 0.75rem;
  color: var(--gugenka-auth-text-secondary);
}

/* エラー */
.gugenka-auth-error {
  margin: 1rem 0 0;
  padding: 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.375rem;
  color: var(--gugenka-auth-error);
  font-size: 0.875rem;
  display: none;
  white-space: pre-line;
  text-align: left;
}

.gugenka-auth-error:not(:empty) {
  display: block;
}

/* ユーザー情報表示用 */
.gugenka-auth-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gugenka-auth-user-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.gugenka-auth-user-name {
  font-size: 0.875rem;
  color: var(--gugenka-auth-text-secondary);
}

.gugenka-auth-logout-btn {
  font-size: 0.75rem;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.gugenka-auth-logout-btn:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* レスポンシブ */
@media (max-width: 480px) {
  .gugenka-auth-modal {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }
  
  .gugenka-auth-title {
    font-size: 1.25rem;
  }
  
  .gugenka-auth-google-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }
}

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
  .gugenka-auth-modal[data-theme="auto"] {
    background: #1f2937;
    --gugenka-auth-text: #f9fafb;
    --gugenka-auth-text-secondary: #9ca3af;
    --gugenka-auth-border: #374151;
  }
  
  .gugenka-auth-modal[data-theme="auto"] .gugenka-auth-google-btn {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .gugenka-auth-modal[data-theme="auto"] .gugenka-auth-google-btn:hover:not(:disabled) {
    background: #4b5563;
  }
}
