/**
 * Medical Consulting LP Custom Styles
 * Tailwindの補完とカスタムスタイル
 */

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

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* セクションのデフォルト状態 */
section {
    opacity: 0;
}

section.animate-fade-in {
    opacity: 1;
}

/* スムーススクロールの設定 */
html {
    scroll-behavior: smooth;
}

/* ヘッダーの影の調整 */
header {
    transition: box-shadow 0.3s ease;
}

/* フォーカス時のアウトラインをカスタマイズ */
input:focus,
textarea:focus,
button:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* チェックボックスのカスタムスタイル */
input[type="checkbox"]:checked {
    background-color: #3B82F6;
    border-color: #3B82F6;
}

/* ボタンのホバー効果を強化 */
button,
.button {
    transition: all 0.3s ease;
}

button:hover,
.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

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

/* カードのホバー効果 */
.hover\:shadow-md:hover {
    transition: box-shadow 0.3s ease;
}

/* 画像の読み込みアニメーション */
img {
    transition: opacity 0.3s ease;
}

img:not(.loaded) {
    opacity: 0.5;
}

img.loaded {
    opacity: 1;
}

/* グラデーション背景の調整 */
.bg-gradient-to-r {
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
}

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

/* モバイル対応の調整 */
@media (max-width: 768px) {
    /* モバイルでのテキストサイズ調整 */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* モバイルでのパディング調整 */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* プリント時のスタイル */
@media print {
    header,
    footer,
    button,
    .no-print {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* アクセシビリティ: フォーカス表示の強化 */
a:focus-visible,
button:focus-visible {
    outline: 3px solid #3B82F6;
    outline-offset: 2px;
}

/* ローディング状態のスタイル */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3B82F6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* SWELLとの互換性調整 */
.medical-lp-page .l-container {
    max-width: 100% !important;
    padding: 0 !important;
}

.medical-lp-page .l-article {
    max-width: 100% !important;
}

/* Tailwindのユーティリティクラスの補完 */
.backdrop-filter {
    backdrop-filter: blur(10px);
}

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

/* カスタムトランジション */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* スクロールバーのスタイリング（Webkit系ブラウザ） */
::-webkit-scrollbar {
    width: 10px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #2563EB;
}

/* フォームのバリデーションスタイル */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #EF4444;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #10B981;
}

/* パフォーマンス最適化: GPU加速 */
.transform,
.scale,
.rotate,
.translate {
    will-change: transform;
}

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
    /* ダークモードでの調整が必要な場合はここに追加 */
}

/* 印刷最適化 */
@page {
    margin: 2cm;
}

/* ユーザー選択の制御 */
.no-select {
    user-select: none;
}

/* 画像のドラッグ防止 */
img {
    -webkit-user-drag: none;
    user-select: none;
}

/* タップハイライトの無効化（モバイル） */
* {
    -webkit-tap-highlight-color: transparent;
}