/* ============================================
   カスタムスタイル - 中古トラック節税・投資LP
   ============================================ */

/* リセット & 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'BIZ UDMincho', serif;
    line-height: 1.8;
    color: #333;
    overflow-x: hidden;
    font-feature-settings: "palt" 1; /* プロポーショナルメトリクス */
    letter-spacing: 0.03em; /* UDフォント用に字間調整 */
}

/* スマホ・タブレット用：固定お問い合わせバーのためのpadding */
@media (max-width: 1023px) {
    body {
        padding-bottom: 100px;
    }
}

/* ヘッダー - スクロール時の背景透過防止 */
header {
    backdrop-filter: blur(10px);
}

/* ヒーローセクション - 背景画像付き */
.hero-section {
    position: relative;
    overflow: hidden;
    min-height: 600px;
}

/* 背景画像のパララックス効果（オプション） */
.hero-section .absolute.inset-0 img {
    object-position: center;
    filter: brightness(0.9) contrast(1.1);
}

/* テキスト読みやすさ向上 */
.hero-section .relative.z-10 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* オーバーレイアニメーション */
@keyframes overlayPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.6;
    }
}

.hero-section .bg-gradient-to-br {
    animation: overlayPulse 8s ease-in-out infinite;
}

/* FAQアコーディオン */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
}

.faq-question i {
    transition: transform 0.3s ease;
}

/* フォームスタイル強化 */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
select,
textarea {
    font-family: 'Noto Sans JP', sans-serif;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #FF6600;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* モーダルスクロール最適化 */
#zoomFormModal {
    backdrop-filter: blur(4px);
}

#zoomFormModal > div {
    max-height: 90vh;
    overflow-y: auto;
}

/* ヘッダー最適化 */
header {
    transition: all 0.3s ease;
}

/* UDフォント追加設定 */
/* 見出し・ボタンはUDゴシック体 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'BIZ UDPGothic', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    letter-spacing: 0.05em;
}

button,
a[class*="bg-"],
.btn {
    font-family: 'BIZ UDPGothic', 'Noto Sans JP', sans-serif;
    font-weight: 700;
}

/* 数字専用クラス（UDゴシック） */
.num {
    font-family: 'BIZ UDPGothic', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    color: #FF6600;
}

/* フォーム要素もUDゴシック */
input, select, textarea {
    font-family: 'BIZ UDPGothic', 'Noto Sans JP', sans-serif;
}

header h1 {
    min-width: 0;
}

header nav a {
    display: inline-flex;
    align-items: center;
}

/* タブレット画面でのヘッダー最適化 */
@media (min-width: 768px) and (max-width: 1023px) {
    header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    header h1 {
        font-size: 1.25rem;
    }
    
    header nav {
        gap: 0.75rem;
    }
    
    header nav a {
        font-size: 0.875rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* モバイル最適化 */
@media (max-width: 767px) {
    /* セクションのパディング削減 */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* 見出しサイズの調整 */
    h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    h3 {
        font-size: 1.125rem !important;
    }
    
    /* カードのパディング削減 */
    .bg-white {
        padding: 1rem !important;
    }
    
    /* 行間の調整 */
    p {
        line-height: 1.6 !important;
    }
    
    /* CTAボタンの最適化 */
    a[href^="tel:"] {
        display: block;
        width: 100%;
        text-align: center;
        padding: 1.25rem 1.5rem !important;
        font-size: 1.125rem !important;
    }
    
    /* 余白の最適化 */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* グリッドギャップの削減 */
    .grid {
        gap: 1rem !important;
    }
}

/* モバイル・タブレットでの1行表示最適化 */
@media (max-width: 768px) {
    .flex.justify-between {
        flex-wrap: nowrap !important;
    }
    
    .whitespace-nowrap {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* モバイル全体最適化 */
@media (max-width: 640px) {
    /* セクションのパディング削減 */
    section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* 見出しのマージン削減 */
    h2, h3 {
        margin-bottom: 0.75rem !important;
    }
    
    /* カードのパディング削減 */
    .bg-white {
        padding: 1rem !important;
    }
    
    /* テキストサイズ調整 */
    body {
        font-size: 14px;
    }
    
    /* ボタンサイズ調整 */
    a.rounded-full, button.rounded-full {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* FAQアイコンの回転アニメーション */
.faq-question i {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

/* FAQアンサーのアニメーション */
.faq-answer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 800px;
    opacity: 1;
}

/* FAQアイテムのホバーエフェクト */
.faq-item {
    transition: all 0.3s ease;
}

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

.faq-question {
    cursor: pointer;
    user-select: none;
}

/* ホバーエフェクト - カード */
.hover\:scale-105 {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover\:scale-105:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ボタンホバーエフェクト */
a, button {
    transition: all 0.3s ease;
}

/* スムーススクロール用のオフセット */
section[id] {
    scroll-margin-top: 80px;
}

/* モバイルメニュー - スムーズトランジション */
#mobileMenu {
    transition: all 0.3s ease;
}

/* ページトップボタン - フェードイン */
#backToTop {
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

#backToTop.show {
    opacity: 1;
    pointer-events: auto;
}

/* 数字強調 - グラデーションテキスト */
.text-gradient {
    background: linear-gradient(135deg, #0066CC 0%, #00AA66 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* テーブルレスポンシブ */
@media (max-width: 768px) {
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px 4px;
    }
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* アニメーション - スライドイン（左から） */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

/* アニメーション - スライドイン（右から） */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* アニメーション - パルス（強調） */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.animate-pulse-custom {
    animation: pulse 2s ease-in-out infinite;
}

/* アニメーション - シェイク（注意喚起） */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* アニメーション - バウンス（強調） */
@keyframes bounce-gentle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-bounce-gentle {
    animation: bounce-gentle 1s ease-in-out infinite;
}

/* グリッドカード - ホバー時のシャドウ強化 */
.shadow-xl {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.shadow-xl:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

/* CTA ボタン - パルスエフェクト */
.bg-accent {
    position: relative;
    overflow: hidden;
}

.bg-accent::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.bg-accent:hover::before {
    width: 300px;
    height: 300px;
}

/* モーダル - スムーズフェードイン */
.fixed.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fixed:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

/* フォーム入力 - フォーカス時のエフェクト */
input:focus,
textarea:focus {
    outline: none;
    border-color: #0066CC;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    transition: all 0.3s ease;
}

/* セクション見出し - アンダーラインアニメーション */
h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #0066CC 0%, #00AA66 100%);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* レスポンシブ調整 */
@media (max-width: 640px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .text-4xl {
        font-size: 2rem;
    }
    
    section {
        padding-top: 48px;
        padding-bottom: 48px;
    }
}

/* プリント用スタイル */
@media print {
    header,
    #backToTop,
    .fixed {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* ローディングアニメーション（オプション） */
.loading-spinner {
    border: 3px solid rgba(0, 102, 204, 0.1);
    border-radius: 50%;
    border-top: 3px solid #0066CC;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* インタラクション - ボタンクリック時のエフェクト */
button:active,
a:active {
    transform: scale(0.98);
}

/* 明朝体最適化 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: 0.05em;
}

p {
    letter-spacing: 0.02em;
}

/* 数字はゴシック体で読みやすく */
body {
    font-feature-settings: "palt" 1, "tnum" 1;
}

/* 数字を含む要素はゴシック体 */
.text-4xl, .text-3xl, .text-2xl, .text-xl, .text-lg,
[class*="font-black"], [class*="font-bold"] {
    font-variant-numeric: tabular-nums;
}

/* 価格表示・数値はゴシック体 */
span:has(> *[class*="万円"]),
div:has(> *[class*="万円"]),
.text-accent, .text-primary, .text-secondary,
[class*="text-yellow"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

/* ボタンはゴシック体で読みやすく */
button, a.bg-accent, a.bg-primary, a.bg-secondary {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0.05em;
}

/* テキスト選択時の色 */
::selection {
    background-color: #0066CC;
    color: white;
}

::-moz-selection {
    background-color: #0066CC;
    color: white;
}

/* スクロールバーカスタマイズ（Webkit） */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: #0066CC;
    border-radius: 6px;
}

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

/* アクセシビリティ - フォーカス可視化 */
a:focus,
button:focus {
    outline: 2px solid #0066CC;
    outline-offset: 2px;
}

/* 画像遅延読み込み用 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
    /* 必要に応じてダークモードスタイルを追加 */
}

/* トランジション最適化 */
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 影のバリエーション */
.shadow-soft {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.shadow-hard {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* テキストグロー効果（強調用） */
.text-glow {
    text-shadow: 0 0 10px rgba(0, 102, 204, 0.5);
}

/* カード立体効果 */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

/* グラデーションボーダー */
.gradient-border {
    border: 2px solid transparent;
    background: 
        linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #0066CC, #00AA66) border-box;
}

/* テキストアニメーション - タイピングエフェクト（オプション） */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid #0066CC;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #0066CC; }
}

/* 数値カウントアップ用（JavaScript連携） */
.count-up {
    font-variant-numeric: tabular-nums;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* 数字を含む要素を強制的にゴシック体に */
body {
    font-variant-numeric: proportional-nums;
}

/* 数字専用のゴシック体設定（Noto Sans JPを使用） */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700;900&display=swap');

/* 数字のみをゴシック体に（unicode-range使用） */
@font-face {
    font-family: 'Number Gothic';
    src: local('Noto Sans JP'), local('Hiragino Kaku Gothic ProN'), local('Arial');
    unicode-range: U+0030-0039, U+0025, U+FF05, U+FF10-FF19; /* 0-9, %, ０-９ */
    font-weight: 100 900;
}

/* 数字を含む可能性のある要素にゴシック体を適用 */
body, h1, h2, h3, h4, h5, h6, p, span, div, a, button {
    font-family: 'Number Gothic', 'Noto Serif JP', serif;
}

/* 大きな数字は確実にゴシック体 */
.text-4xl, .text-3xl, .text-2xl, .text-xl, .text-lg {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, 'Noto Serif JP', serif;
}

/* 価格表示は完全にゴシック体 */
[class*="text-accent"], [class*="text-primary"], [class*="text-secondary"],
[class*="text-yellow"], [class*="font-black"], [class*="font-bold"] {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* フローティングお問い合わせボタン - アニメーション */
@keyframes floatingPulse {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: translateY(-5px);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    }
}

.fixed.bottom-8.right-8 > a,
.fixed.bottom-8.right-8 > button {
    animation: floatingPulse 3s ease-in-out infinite;
}

/* スマホ版固定バー - スライドインアニメーション */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fixed.bottom-0.left-0.right-0 {
    animation: slideInUp 0.5s ease-out;
}

/* 固定バーのボタンアクティブ効果 */
.fixed.bottom-0 a:active,
.fixed.bottom-0 button:active {
    transform: scale(0.95);
}

/* バッジ・ラベル */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-new {
    background: linear-gradient(135deg, #FF6600 0%, #FF3300 100%);
    color: white;
}

.badge-popular {
    background: linear-gradient(135deg, #0066CC 0%, #003366 100%);
    color: white;
}

/* ツールチップ（オプション） */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #333;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip:hover::before {
    opacity: 1;
}

/* パンくずリスト（必要に応じて） */
.breadcrumb {
    display: flex;
    list-style: none;
    padding: 0;
}

.breadcrumb li + li::before {
    content: '›';
    margin: 0 8px;
    color: #666;
}

/* ステータスインジケーター */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-active {
    background: #00AA66;
    box-shadow: 0 0 10px rgba(0, 170, 102, 0.5);
}

.status-pending {
    background: #FF6600;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
}

/* プログレスバー */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0066CC 0%, #00AA66 100%);
    transition: width 0.3s ease;
}

/* リボン（角の装飾） */
.ribbon {
    position: absolute;
    top: 20px;
    right: -5px;
    background: #FF6600;
    color: white;
    padding: 8px 20px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.ribbon::before {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    border-left: 5px solid #CC5200;
    border-bottom: 5px solid transparent;
}

/* パララックス効果用（JavaScript連携） */
.parallax {
    transition: transform 0.5s cubic-bezier(0, 0, 0, 1);
}

/* フリップカード（オプション） */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* 最終調整 */
.container {
    max-width: 1280px;
}

/* アクセシビリティ - スクリーンリーダー専用テキスト */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
