/* ジョナサン・アイブ風 モダンデザイン - 口コミ生成ツール */

:root {
    --primary-color: #000000;
    --secondary-color: #f8fafc;
    --accent-color: #3b82f6;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --spacing-unit: 0.25rem;
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* コンテナ */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 8) calc(var(--spacing-unit) * 6);
    position: relative;
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 16);
    position: relative;
}

.logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin: 0 auto calc(var(--spacing-unit) * 6) auto;
    filter: drop-shadow(var(--shadow-sm));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    object-fit: contain;
}

.logo:hover {
    filter: drop-shadow(var(--shadow-md));
    transform: translateY(-1px);
}

/* メインコンテンツ */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

/* ステップコンテナ */
.step {
    padding: calc(var(--spacing-unit) * 8) calc(var(--spacing-unit) * 8);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
}

.step:last-child {
    border-bottom: none;
}

.step:hover {
    background: rgba(248, 250, 252, 0.5);
}

.step-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 6);
    letter-spacing: -0.025em;
    position: relative;
    padding-left: calc(var(--spacing-unit) * 8);
}

.step-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-color), #60a5fa);
    border-radius: 2px;
}

/* 星評価 */
.star-rating {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    justify-content: center;
    margin: calc(var(--spacing-unit) * 6) 0;
}

.star {
    font-size: 2rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.star:hover,
.star.active {
    color: #fbbf24;
    transform: scale(1.1);
    text-shadow: 0 4px 8px rgba(251, 191, 36, 0.3);
}

.star:active {
    transform: scale(0.95);
}

/* タググリッド */
.tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin: calc(var(--spacing-unit) * 6) 0;
}

.tag-button {
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 4);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.tag-button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.tag-button:hover::before {
    left: 100%;
}

.tag-button.selected {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

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

.tag-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #9ca3af;
}

.tag-button.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ボタン共通スタイル */
.generate-button,
.submit-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #374151 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 8);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.025em;
    box-shadow: var(--shadow-md);
}

.generate-button::after,
.submit-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: width 0.6s, height 0.6s;
}

.generate-button:hover,
.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.generate-button:hover::after,
.submit-button:hover::after {
    width: 300px;
    height: 300px;
}

.generate-button:active,
.submit-button:active {
    transform: translateY(0);
}

.generate-button:disabled,
.submit-button:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generate-button.loading {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: wait;
}

/* テキストエリア */
.comment-textarea {
    width: 100%;
    min-height: 120px;
    padding: calc(var(--spacing-unit) * 4);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    resize: vertical;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.6;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(248, 250, 252, 0.5);
}

.comment-textarea::placeholder {
    color: var(--text-muted);
}

/* フォームセクション */
.form-section {
    padding: calc(var(--spacing-unit) * 6) 0;
}

/* トースト通知 */
.toast {
    position: fixed;
    top: calc(var(--spacing-unit) * 6);
    right: calc(var(--spacing-unit) * 6);
    background: white;
    color: var(--text-primary);
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 6);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-width: 320px;
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.error {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.toast.success {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

.toast.error {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: calc(var(--spacing-unit) * 4);
    }
    
    .logo {
        max-width: 160px;
    }
    
    .step {
        padding: calc(var(--spacing-unit) * 6);
    }
    
    .tag-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: calc(var(--spacing-unit) * 2);
    }
    
    .star {
        font-size: 1.75rem;
    }
    
    .step-title {
        font-size: 1rem;
        padding-left: calc(var(--spacing-unit) * 6);
    }
    
    .toast {
        right: calc(var(--spacing-unit) * 4);
        left: calc(var(--spacing-unit) * 4);
        max-width: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: calc(var(--spacing-unit) * 3);
    }
    
    .logo {
        max-width: 140px;
    }
    
    .tag-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .star {
        font-size: 1.5rem;
    }
}

/* マイクロインタラクション */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step {
    animation: slideIn 0.6s ease-out;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }
.step:nth-child(4) { animation-delay: 0.4s; }
.step:nth-child(5) { animation-delay: 0.5s; }

/* プログレスインジケーター */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--border-color);
    z-index: 1001;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #60a5fa);
    width: 0%;
    transition: width 0.3s ease;
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* フォーカス状態の改善 */
button:focus-visible,
.tag-button:focus-visible,
.comment-textarea:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ダークモード対応（将来的な拡張用） */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #ffffff;
        --secondary-color: #1e293b;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        --border-color: #334155;
    }
}