/**
 * 医療系アンケートシステム スタイルシート
 */

/* リセットとベース */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

/* コンテナ */
.survey-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ヘッダー */
.survey-header {
    text-align: center;
    padding: 40px 20px;
    color: white;
}

.survey-header h1 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.survey-header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 進捗バー */
.progress-container {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    height: 8px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    background: white;
    height: 100%;
    width: 0%;
    border-radius: 25px;
    transition: width 0.4s ease;
}

.progress-text {
    position: absolute;
    right: 0;
    top: -25px;
    color: white;
    font-size: 0.9em;
    font-weight: 600;
}

/* セクション */
.survey-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    animation: fadeIn 0.4s ease;
}

.survey-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.survey-section h2 {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-note {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

/* オプショングリッド（ラジオボタン） */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

.option-card {
    position: relative;
    cursor: pointer;
}

.option-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.option-card input:checked + .option-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.option-card:hover .option-content {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.option-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.option-text {
    font-size: 1.1em;
    font-weight: 500;
    text-align: center;
}

/* 縦並びオプション */
.options-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.option-card-wide {
    position: relative;
    cursor: pointer;
}

.option-card-wide input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-card-wide .option-content {
    display: block;
    padding: 18px 25px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.option-card-wide input:checked + .option-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.option-card-wide:hover .option-content {
    border-color: #667eea;
}

/* チェックボックスグリッド */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

@media (max-width: 600px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

.checkbox-card {
    position: relative;
    cursor: pointer;
}

.checkbox-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.checkbox-content::before {
    content: '';
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-card input:checked + .checkbox-content {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.checkbox-card input:checked + .checkbox-content::before {
    background: #667eea;
    border-color: #667eea;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 16px;
    background-position: center;
    background-repeat: no-repeat;
}

.checkbox-card:hover .checkbox-content {
    border-color: #667eea;
}

.checkbox-text {
    font-size: 1em;
}

/* テキストエリア */
.textarea-container {
    margin-bottom: 30px;
}

.textarea-container textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s ease;
}

.textarea-container textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* フォームグループ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #444;
}

.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* 動画コンテナ */
.video-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    aspect-ratio: 16 / 9;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.05);
}

.play-btn span:first-child {
    font-size: 2em;
}

.video-instruction {
    text-align: center;
    color: #666;
    margin-bottom: 15px;
}

/* ナビゲーションボタン */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.nav-buttons .btn:only-child {
    margin-left: auto;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 14px 35px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-next,
.btn-submit,
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-next:hover,
.btn-submit:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-prev,
.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-prev:hover,
.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* 完了ページ */
.complete-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.complete-content {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 100%;
}

.complete-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: white;
    margin: 0 auto 30px;
}

.complete-content h1 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 20px;
}

.complete-message {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.8;
}

.complete-actions {
    margin-bottom: 30px;
}

.booth-info {
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    color: #888;
}

.booth-info .small {
    font-size: 0.85em;
    margin-top: 5px;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .survey-container {
        padding: 10px;
    }

    .survey-header {
        padding: 30px 15px;
    }

    .survey-header h1 {
        font-size: 1.6em;
    }

    .survey-section {
        padding: 25px 20px;
        border-radius: 15px;
    }

    .survey-section h2 {
        font-size: 1.2em;
    }

    .option-content {
        padding: 20px 15px;
    }

    .option-icon {
        font-size: 2em;
    }

    .btn {
        padding: 12px 25px;
        font-size: 0.95em;
    }

    .complete-content {
        padding: 40px 25px;
    }

    .complete-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5em;
    }
}

/* アニメーション */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.btn-submit {
    animation: pulse 2s infinite;
}

.btn-submit:hover {
    animation: none;
}

/* その他入力欄 */
.other-input-container {
    margin-top: 20px;
    margin-bottom: 25px;
    padding: 0 5px;
}

.other-input {
    width: 100%;
    min-height: 70px;
    padding: 16px 20px;
    border: 3px solid #d0d0d0;
    border-radius: 12px;
    font-size: 18px;
    font-family: inherit;
    line-height: 1.5;
    background-color: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
    /* iPad対応: タップターゲットを大きく */
    -webkit-appearance: none;
    appearance: none;
}

.other-input:focus {
    outline: none;
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.other-input::placeholder {
    color: #999;
    font-size: 16px;
}

/* iPad/タブレット対応 */
@media (min-width: 768px) {
    .other-input {
        min-height: 80px;
        padding: 18px 24px;
        font-size: 20px;
    }
}
