/* カスタムスタイル */

/* 日本語フォントの最適化 */
* {
    font-feature-settings: "palt";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* スムーズなスクロール */
html {
    scroll-behavior: smooth;
}

/* カスタムグラデーション */
.gradient-bg {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #10b981 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* カードシャドウ */
.card-shadow {
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-shadow:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* プログレスバーアニメーション */
.progress-bar {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* フェードインアニメーション */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* パルスアニメーション */
.pulse-animation {
    animation: gentlePulse 3s infinite ease-in-out;
}

@keyframes gentlePulse {
    0%, 100% { 
        transform: scale(1); 
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.02); 
        filter: brightness(1.1);
    }
}

/* ボタンホバーエフェクト */
button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

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.6s;
}

button:hover::before {
    left: 100%;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .card-shadow {
        margin: 0 1rem;
    }
    
    .fade-in {
        transform: translateY(20px);
    }
    
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .gradient-bg {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .card-shadow {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    button {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* 印刷対応 */
@media print {
    .gradient-bg,
    #startScreen,
    #diagnosisScreen,
    #calculatingScreen {
        display: none !important;
    }
    
    #resultScreen {
        display: block !important;
    }
    
    .card-shadow {
        box-shadow: none;
        border: 1px solid #e5e5e5;
    }
    
    .fade-in {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

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

/* フォーカス状態の改善 */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ローディング状態 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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

/* 選択不可テキストのスタイル */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* カスタムチェックボックス・ラジオボタン */
.custom-checkbox,
.custom-radio {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-radio {
    border-radius: 50%;
}

.custom-checkbox:checked,
.custom-radio:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.custom-radio:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}