/* 共通スタイル */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* グラデーション背景 */
.bg-gradient {
    background: linear-gradient(135deg, #f3e7ff 0%, #fce7f3 100%);
    min-height: 100vh;
}

/* カード */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

/* ボタン */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(147, 51, 234, 0.3);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* フォーム */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* アラート */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* プランカード */
.plan-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.plan-card.current {
    border-color: #9333ea;
    box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.1);
}

.plan-badge {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-current {
    background: #9333ea;
    color: white;
}

.badge-recommended {
    background: #f97316;
    color: white;
}

/* Coming Soon オーバーレイ */
.coming-soon-overlay {
    position: relative;
}

.coming-soon-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    border-radius: 1rem;
    z-index: 1;
}

.coming-soon-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* プログレスバー */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #9333ea 0%, #ec4899 100%);
    transition: width 1s ease-in-out;
}

/* グリッド */
.grid {
    display: grid;
    gap: 1.5rem;
}

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

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

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ユーティリティ */
.text-center {
    text-align: center;
}

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

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

.mt-auto {
    margin-top: auto;
}

.mt-2 {
    margin-top: 0.5rem;
}

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

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

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

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

.text-gray-600 {
    color: #4b5563;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-800 {
    color: #1f2937;
}

/* モーダル */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 28rem;
    margin: 1rem;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
    .coming-soon-badge {
        font-size: 1.2rem;
        padding: 0.75rem 1.5rem;
    }
}

/* ダッシュボード専用スタイル */

/* ヘッダー */
.dashboard-header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.dashboard-header-container {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.dashboard-user-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.logout-btn {
    color: #9333ea;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.logout-btn:hover {
    text-decoration: underline;
}

/* メインコンテナ */
.dashboard-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 拡張機能バナー */
.extension-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
}

.extension-banner-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.extension-banner-icon {
    font-size: 3rem;
}

.extension-banner-text {
    flex: 1;
}

.extension-banner-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #92400e;
}

.extension-banner-description {
    color: #78350f;
    margin-bottom: 1rem;
}

/* ウェルカムセクション */
.welcome-grid {
    display: grid;
    gap: 2rem;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* 利用状況ボックス */
.usage-box {
    background: linear-gradient(135deg, #e9d5ff 0%, #fbcfe8 100%);
    padding: 1.5rem;
    border-radius: 0.75rem;
    position: relative;
}

.usage-stats {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.usage-count {
    font-size: 2.5rem;
    font-weight: 700;
    color: #9333ea;
}

.usage-limit {
    font-size: 1.5rem;
    color: #4b5563;
}

/* アップグレードボタン */
.upgrade-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    transition: all 0.2s;
}

.upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

/* アカウント情報 */
.account-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.account-grid {
    gap: 1.5rem;
}

.account-field {
    padding: 0.5rem 0;
}

.account-field-flex {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

/* バッジ */
.badge-unverified {
    background: #fef3c7;
    color: #92400e;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* リンクボタン */
.link-btn {
    color: #9333ea;
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.link-btn:hover {
    color: #7c3aed;
}

/* Chrome拡張機能セクション */
.extension-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 2rem;
    margin-top: 2rem;
}

.extension-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.extension-description {
    margin-bottom: 1rem;
}

.extension-email-display {
    background: #f3f4f6;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.extension-email {
    font-weight: 600;
    color: #667eea;
}

.connection-status {
    margin-top: 1rem;
    display: none;
}

.connection-status.show {
    display: block;
}

.connection-status.error {
    color: #dc2626;
}

/* トースト通知 */
#connectionToast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #10b981;
    max-width: 400px;
    transform: translateX(-120%);
    transition: transform 0.3s ease-in-out;
    z-index: 9999;
}

#connectionToast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 24px;
}

.toast-text {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: #666;
}

/* 編集アイコンボタン */
.edit-icon-btn {
    color: #9CA3AF;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.edit-icon-btn:hover {
    color: #3B82F6;
    transform: scale(1.1);
}

/* Create a wrapper so the logo and title align horizontally */
.logo-and-title {
    display: flex;
    align-items: center;
    /* vertically centers them */
    gap: 12px;
    /* adjustable spacing */
}


/* Square logo placeholder */
.kc-logo {
    width: 40px;
    height: 40px;
    overflow: hidden;
    /* はみ出し防止 */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Replace placeholder by setting background-image in project CSS */
.kc-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}