/* やりたいこと発見アプリ - カスタムスタイル */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --danger-color: #dc3545;
}

/* グローバルスタイル */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ナビゲーション */
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* カード */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* バッジ */
.badge {
    font-weight: 500;
    padding: 0.4em 0.6em;
}

/* ボタン */
.btn {
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* アラート */
.alert {
    border-left: 4px solid;
    border-radius: 0.375rem;
}

.alert-info {
    border-left-color: var(--info-color);
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

/* プログレスバー */
.progress {
    height: 1.2rem;
    border-radius: 0.5rem;
}

/* フォーム */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* モバイル用フォーム調整 */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* フェーズ別カラー */
.phase-empathy {
    border-left: 4px solid #dc3545;
}

.phase-define {
    border-left: 4px solid #198754;
}

.phase-ideate {
    border-left: 4px solid #ffc107;
}

.phase-prototype {
    border-left: 4px solid #0dcaf0;
}

.phase-validate {
    border-left: 4px solid #6c757d;
}

/* スコア表示 */
.score-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.score-item {
    text-align: center;
    min-width: 80px;
    margin: 0.5rem;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.score-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* 星評価 */
.star-rating {
    color: #ffc107;
    font-size: 1.2rem;
}

.star-rating .bi-star {
    color: #dee2e6;
}

/* タイムライン（将来の拡張用） */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-color);
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* フッター */
footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* カスタムスクロールバー（Webkit系ブラウザ） */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ローディングスピナー */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* タッチデバイス用の調整 */
@media (hover: none) and (pointer: coarse) {
    /* タッチデバイスではhoverエフェクトを無効化 */
    .card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    /* タッチターゲットを大きくする */
    .btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }

    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* iOSのズームを防ぐ */
    }
}

/* タブレット用（768px以下） */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* スコア表示をコンパクトに */
    .score-value {
        font-size: 1.5rem;
    }

    .score-label {
        font-size: 0.75rem;
    }

    /* テーブルをレスポンシブに */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* モーダルの調整 */
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* スマホ用（576px以下） */
@media (max-width: 576px) {
    body {
        font-size: 0.9rem;
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* ナビゲーションバーの調整 */
    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }

    /* カードの余白を調整 */
    .card-body {
        padding: 1rem;
    }

    /* ボタンを全幅に */
    .btn-block-mobile {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* フォームの調整 */
    .form-control, .form-select {
        font-size: 16px; /* iOSのズームを防ぐ */
    }

    /* スコア表示をスタック */
    .score-display {
        flex-direction: column;
        padding: 0.75rem;
    }

    .score-item {
        width: 100%;
        margin: 0.5rem 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .score-item .score-label {
        text-align: left;
    }

    /* フッターのテキストサイズ */
    footer {
        font-size: 0.875rem;
        padding: 1rem 0;
    }

    /* アラートの調整 */
    .alert {
        font-size: 0.875rem;
        padding: 0.75rem;
    }

    /* モーダルの調整 */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }

    .modal-content {
        border-radius: 0.5rem;
    }

    .modal-header, .modal-footer {
        padding: 0.75rem;
    }

    .modal-body {
        padding: 1rem;
    }
}

/* 極小スマホ用（400px以下） */
@media (max-width: 400px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    .score-value {
        font-size: 1.25rem;
    }
}

/* ダークモード対応（将来の拡張用） */
@media (prefers-color-scheme: dark) {
    /* ダークモードのスタイルをここに追加 */
}
