/* 全体的なスタイル */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --bg-light: #f8f9fa;
    --bg-medium: #e9ecef;
    --text-dark: #343a40;
    --text-medium: #6c757d;
    --font-family: 'Noto Sans JP', sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: #f0f4f8; /* 背景色を少し柔らかく */
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.main-content {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.5s ease;
    text-align: center;
}

.hidden {
    display: none;
}

/* ヘッダーとプログレスバー */
header {
    background-color: #ffffff;
    padding: 20px 0;
    border-bottom: 1px solid #e0e6f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.progress-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-medium);
    color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2em;
    position: relative;
    transition: all 0.3s ease;
}

.progress-step.active {
    background-color: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.progress-step.active::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--primary-color);
}

.progress-step .step-label {
    position: absolute;
    top: 100%;
    margin-top: 10px;
    white-space: nowrap;
    font-size: 0.8em;
    color: var(--text-medium);
}

/* 共通要素 */
h1 {
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    color: var(--text-medium);
    margin-top: 0;
    margin-bottom: 30px;
}

.instruction {
    font-style: italic;
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 0.95em;
}

/* インスピレーション選択 */
.selection-counter {
    background-color: var(--bg-light);
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 20px;
    font-size: 1.1em;
    color: var(--text-medium);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.grid-item {
    background-color: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.grid-item.selected {
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.3);
    transform: scale(1.05);
}

.grid-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.grid-item .text {
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    color: var(--primary-color);
}

/* 振り返り */
.reflection-item {
    background-color: var(--bg-light);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.reflection-item .header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    border-bottom: 1px dashed #ced4da;
    padding-bottom: 15px;
}

.reflection-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.reflection-item .item-display-text {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1em;
}

.reflection-item label {
    display: block;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 8px;
}

.reflection-item textarea {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    min-height: 80px;
    font-size: 1em;
    resize: vertical;
    box-sizing: border-box;
}

/* 価値観の明確化 */
.value-suggestions {
    background-color: #e9f5ff;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: left;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.value-suggestions h2, .my-values h2 {
    color: var(--primary-color);
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 15px;
}

.value-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.value-item {
    background-color: #ffffff;
    border: 1px solid #a0cbed;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
}

.value-item:hover {
    background-color: #e0f2ff;
    transform: translateY(-2px);
}

.value-item.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: #0056b3;
    transform: scale(1.05);
}

.my-values {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: left;
}

#my-values-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 40px;
    border: 1px dashed #ced4da;
    padding: 10px;
    border-radius: 8px;
    background-color: #fcfcfc;
}

.added-value-tag {
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.added-value-tag:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.added-value-tag .remove-tag {
    background: none;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 3px;
    line-height: 1;
}

.add-value-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

#new-value-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
}

#add-value-button {
    background-color: var(--success-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#add-value-button:hover {
    background-color: #218838;
}

/* 未来像の描写 */
.future-vision-section {
    background-color: var(--bg-light);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: left;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}

.future-vision-section h2 {
    color: var(--primary-color);
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 10px;
}

.future-vision-section p {
    color: #555;
    font-size: 0.95em;
    margin-bottom: 15px;
}

.future-vision-section textarea {
    width: calc(100% - 20px);
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    min-height: 120px;
    font-size: 1em;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.6;
}

.future-vision-section textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

#current-values-display {
    font-weight: bold;
    color: var(--primary-color);
}

/* ビジョンサマリーとロードマップ */
.summary-section {
    background-color: var(--bg-light);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: left;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}

.summary-section h2 {
    color: var(--primary-color);
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 10px;
}

.summary-section p {
    color: #333;
    line-height: 1.6;
    margin-bottom: 15px;
}

#vision-statement {
    width: calc(100% - 20px);
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    min-height: 80px;
    font-size: 1.1em;
    resize: vertical;
    box-sizing: border-box;
}

#vision-statement:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

#roadmap-items {
    border: 1px dashed #ced4da;
    border-radius: 8px;
    padding: 15px;
    min-height: 80px;
    background-color: #fcfcfc;
    margin-bottom: 20px;
}

.roadmap-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 10px;
    font-size: 0.95em;
    color: #495057;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.roadmap-item span {
    flex-grow: 1;
    margin-right: 10px;
}

.roadmap-item .deadline {
    font-weight: bold;
    color: var(--success-color);
    margin-left: 10px;
    white-space: nowrap;
}

.roadmap-item .remove-roadmap {
    background: none;
    border: none;
    color: #dc3545;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.roadmap-item .remove-roadmap:hover {
    color: #c82333;
}

.add-roadmap-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

#new-roadmap-action, #new-roadmap-deadline {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    min-width: 150px;
}

#add-roadmap-button {
    background-color: #17a2b8;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#add-roadmap-button:hover {
    background-color: #138496;
}

/* ボタンの共通スタイル */
.next-button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.2em;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.2);
}

.next-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.next-button:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .progress-bar {
        gap: 15px;
    }

    .progress-step {
        width: 35px;
        height: 35px;
        font-size: 1em;
    }
    
    .progress-step .step-label {
        display: none;
    }
    
    .main-content {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1em;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

    .grid-item img {
        height: 120px;
    }

    .grid-item .text {
        font-size: 1em;
    }

    .add-roadmap-input {
        flex-direction: column;
    }

    #new-roadmap-action, #new-roadmap-deadline, #add-roadmap-button {
        width: 100%;
        min-width: unset;
    }
}