/* 墓じまい声サポ - スタイルシート */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'メイリオ', sans-serif;
    background: linear-gradient(135deg, #89b4c4 0%, #a8d5e5 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.container {
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    max-width: 600px;
    width: 90%;
    margin: 2rem;
}

h1 {
    text-align: center;
    color: #2c5f6f;
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    font-weight: 600;
}

.subtitle {
    text-align: center;
    color: #6b8e9f;
    font-size: 1rem;
    margin-bottom: 2rem;
}

h3 {
    color: #34495e;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ステータスセクション */
.status-section {
    background: #f0f7fa;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: center;
    display: none; /* 初期は非表示 */
}

.status {
    font-size: 0.95rem;
    color: #6b8e9f;
}

.status.connected {
    color: #4a9b8e;
}

.status.disconnected {
    color: #b57c7c;
}

.status.connecting {
    color: #e5a663;
}

/* メインボタン */
.main-control {
    text-align: center;
    margin: 3rem 0;
}

.main-btn {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6ab7d8 0%, #89c9e4 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 8px 25px rgba(106, 183, 216, 0.3);
}

/* チュートリアル完了後のハイライト効果 */
.main-btn.highlight {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(106, 183, 216, 0.3);
    }
    25%, 75% {
        box-shadow: 0 8px 40px rgba(106, 183, 216, 0.8), 0 0 0 15px rgba(106, 183, 216, 0.2);
    }
    50% {
        box-shadow: 0 8px 50px rgba(106, 183, 216, 1), 0 0 0 25px rgba(106, 183, 216, 0.1);
    }
}

.main-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(106, 183, 216, 0.4);
}

.main-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.main-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.main-btn .btn-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.main-btn .btn-text {
    font-size: 1.1rem;
    font-weight: 500;
}

/* ボタンの状態別スタイル */
.main-btn[data-state="connecting"] {
    background: linear-gradient(135deg, #f5c563 0%, #fcd68a 100%);
}

.main-btn[data-state="ready"] {
    background: linear-gradient(135deg, #6ab7d8 0%, #89c9e4 100%);
}

.main-btn[data-state="recording"] {
    background: linear-gradient(135deg, #ff7b7b 0%, #ff9a9a 100%);
    animation: pulse 1.5s infinite;
}

.main-btn[data-state="processing"] {
    background: linear-gradient(135deg, #9b88d3 0%, #b5a7e6 100%);
}

@keyframes pulse {
    0% {
        box-shadow: 0 8px 25px rgba(255, 123, 123, 0.4);
    }
    50% {
        box-shadow: 0 8px 40px rgba(255, 123, 123, 0.6);
    }
    100% {
        box-shadow: 0 8px 25px rgba(255, 123, 123, 0.4);
    }
}

/* 波形アニメーション */
.wave-animation {
    position: absolute;
    bottom: 20px;
    display: flex;
    gap: 4px;
}

.wave {
    width: 4px;
    height: 20px;
    background: white;
    border-radius: 2px;
    animation: wave 0.6s ease-in-out infinite;
}

.wave:nth-child(2) {
    animation-delay: 0.1s;
}

.wave:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes wave {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 35px;
    }
}

.help-text {
    margin-top: 1.5rem;
    color: #6b8e9f;
    font-size: 0.9rem;
    text-align: center;
}

/* 会話履歴 */
.transcript-section {
    margin-bottom: 2rem;
}

.transcript-section h3 {
    color: #2c5f6f;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.transcript {
    background: #fafbfc;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 1rem;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
}

.transcript-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.transcript-user {
    background: #e8f4f8;
    border-left: 4px solid #6ab7d8;
    margin-left: 20%;
}

.transcript-assistant {
    background: #f0f7fa;
    border-left: 4px solid #89c9e4;
    margin-right: 20%;
}

/* 設定セクション */
.settings-section {
    background: #f8fafb;
    border-radius: 12px;
    overflow: hidden;
}

.settings-toggle {
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
    color: #6b8e9f;
}

.settings-toggle:hover {
    background: #f0f7fa;
}

.settings-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.toggle-arrow {
    transition: transform 0.3s;
}

.settings-toggle.active .toggle-arrow {
    transform: rotate(180deg);
}

.settings-content {
    padding: 0 1.5rem 1.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c5f6f;
    font-size: 0.9rem;
}

.setting-item select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d4e2e9;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    color: #333;
    transition: border-color 0.2s;
}

.setting-item select:focus {
    outline: none;
    border-color: #6ab7d8;
}

/* チャットバブル */
.chat-bubble {
    display: flex;
    align-items: flex-end;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    max-width: 80%;
    font-size: 0.95rem;
    word-break: break-word;
}

.chat-user {
    background: #e8f4f8;
    color: #2c5f6f;
    align-self: flex-end;
    margin-left: auto;
}

.chat-assistant {
    background: #f0f7fa;
    color: #34495e;
    align-self: flex-start;
    margin-right: auto;
}

.chat-system {
    background: #f5f5f5;
    color: #7a7a7a;
    align-self: center;
    margin: 0 auto;
    font-size: 0.85rem;
}

/* レスポンシブデザイン */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .main-btn {
        width: 140px;
        height: 140px;
    }
    
    .main-btn .btn-icon {
        font-size: 2rem;
    }
    
    .main-btn .btn-text {
        font-size: 1rem;
    }
    
    .transcript-user {
        margin-left: 10%;
    }
    
    .transcript-assistant {
        margin-right: 10%;
    }
}

/* ローディングアニメーション */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #6ab7d8;
    border-radius: 50%;
    animation: loading 1.4s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    30% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

/* チュートリアルモーダル */
.tutorial-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.tutorial-modal.show {
    display: block;
}

.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.tutorial-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* プログレスバー */
.tutorial-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #e1e8ed;
    border-radius: 2px;
    margin-right: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6ab7d8 0%, #89c9e4 100%);
    border-radius: 2px;
    width: 33.33%;
    transition: width 0.3s ease;
}

.skip-btn {
    background: none;
    border: none;
    color: #6b8e9f;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    transition: color 0.2s;
}

.skip-btn:hover {
    color: #2c5f6f;
}

/* ステップコンテンツ */
.tutorial-steps {
    position: relative;
    min-height: 300px;
}

.tutorial-step {
    display: none;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.tutorial-step.active {
    display: block;
}

.step-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.step-title {
    color: #2c5f6f;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.step-description {
    color: #6b8e9f;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* ステップ2: 機能説明 */
.step-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: #f0f7fa;
    border-radius: 12px;
    transition: transform 0.2s;
}

.feature-item:hover {
    transform: translateX(5px);
}

.feature-icon {
    font-size: 2rem;
}

.feature-text {
    font-size: 1.1rem;
    color: #34495e;
    font-weight: 500;
}

/* マイクデモ */
.mic-demo {
    margin: 2rem 0;
}

.demo-button {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #6ab7d8 0%, #89c9e4 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 8px 25px rgba(106, 183, 216, 0.3);
}

.demo-button.pulse {
    animation: pulse 2s infinite;
}

.demo-text {
    color: #6b8e9f;
    font-size: 0.9rem;
}

/* ステップ3: プライバシー */
.privacy-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
    text-align: left;
}

.privacy-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafb;
    border-radius: 12px;
}

.privacy-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.privacy-content h4 {
    color: #2c5f6f;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.privacy-content p {
    color: #6b8e9f;
    font-size: 0.9rem;
    margin: 0;
}

/* ボタン */
.step-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 2rem;
    border-radius: 24px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #6ab7d8 0%, #89c9e4 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(106, 183, 216, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 183, 216, 0.4);
}

.btn-secondary {
    background: #f0f7fa;
    color: #2c5f6f;
}

.btn-secondary:hover {
    background: #e1eef3;
}

.btn-start {
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

/* ページインジケーター */
.page-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4e2e9;
    transition: all 0.3s ease;
    cursor: pointer;
}

.indicator.active {
    width: 24px;
    border-radius: 4px;
    background: linear-gradient(90deg, #6ab7d8 0%, #89c9e4 100%);
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .tutorial-content {
        padding: 1.5rem;
        max-width: 95%;
    }
    
    .step-title {
        font-size: 1.5rem;
    }
    
    .step-description {
        font-size: 1rem;
    }
    
    .feature-text {
        font-size: 1rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
}