/* カスタム変数 */
:root {
    --primary-color: #007bff;
    --secondary-color: #00c6ff;
    --text-dark: #333;
    --bg-light: #f8f9fa;
    --shadow-light: rgba(0, 0, 0, 0.15);
    --shadow-glow: rgba(0, 123, 255, 0.5);
    --gradient-start: #007bff;
    --gradient-end: #00c6ff;
}

/* タイトル画像セクション */
.title-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    min-height: 300px;
    overflow: hidden;
    transition: transform 0.5s ease;
}

.title-image:hover {
    transform: scale(1.02); /* ホバーで微拡大 */
}

.title-image .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 123, 255, 0.3));
    animation: overlayPulse 6s infinite ease-in-out;
    z-index: 1;
    transition: background 0.5s ease;
}

.title-image:hover .overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 123, 255, 0.5)); /* ホバーで変化 */
}

.title-image h1 {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin: 0;
    position: relative;
    z-index: 2;
    animation: fadeSlideIn 1.5s ease-out forwards;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.title-image h1:hover {
    transform: scale(1.05); /* ホバーで軽く拡大 */
    text-shadow: 0 0 15px var(--shadow-glow); /* グロー効果 */
}

/* お問い合わせフォーム */
.contact-form {
    background-color: var(--bg-light);
    padding: 50px 0;
    position: relative;
    overflow: hidden;
}

.contact-form h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    animation: scaleIn 1s ease-out forwards;
    position: relative;
    transition: color 0.3s ease;
}

.contact-form h2:hover {
    color: var(--primary-color); /* ホバーで色変化 */
}

.contact-form .form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, color 0.3s ease;
}

.contact-form .form-label:hover {
    color: var(--primary-color);
    transform: translateX(5px); /* ホバーで軽くスライド */
}

.contact-form .text-danger {
    font-size: 1rem;
    font-weight: bold;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.contact-form .form-label:hover + .text-danger {
    transform: scale(1.2); /* 必須マークがホバーで拡大 */
}

/* フォーム要素 */
.contact-form .form-control,
.contact-form .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.875rem;
    background: white;
    transition: all 0.3s ease;
    animation: slideUp 0.8s ease-out forwards;
    animation-delay: calc(0.1s * var(--order));
    position: relative;
    overflow: hidden;
}

.contact-form .form-control::after,
.contact-form .form-select::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-color), 0.2), transparent);
    transition: left 0.5s ease;
}

.contact-form .form-control:hover::after,
.contact-form .form-select:hover::after {
    left: 100%; /* ホバーで光の帯が流れる */
}

.contact-form .form-control:focus,
.contact-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--shadow-glow);
    transform: scale(1.02) translateY(-2px); /* フォーカスで浮き上がり */
}

.contact-form textarea.form-control {
    min-height: 160px;
    resize: vertical;
}

/* カテゴリー選択時のアニメーション */
.contact-form .form-select {
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E") no-repeat right 0.75rem center/12px 12px;
    transition: background-color 0.3s ease;
}

.contact-form .form-select:focus {
    background-color: #f0f8ff; /* フォーカス時に薄い背景色 */
}

/* 送信ボタン */
.contact-form .btn-primary {
    padding: 0.875rem 2.5rem;
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: buttonPulse 2s infinite alternate;
}

.contact-form .btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.contact-form .btn-primary:hover::before {
    width: 300px;
    height: 300px; /* 波紋エフェクト */
}

.contact-form .btn-primary:hover,
.contact-form .btn-primary:focus {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px var(--shadow-light), 0 0 20px var(--shadow-glow);
    background: linear-gradient(90deg, var(--gradient-end), var(--gradient-start)); /* グラデーション反転 */
}

/* アニメーション定義 */
@keyframes overlayPulse {
    0%, 100% { background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 123, 255, 0.3)); }
    50% { background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 123, 255, 0.5)); }
}

@keyframes fadeSlideIn {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes buttonPulse {
    0% { box-shadow: 0 0 5px var(--primary-color); }
    100% { box-shadow: 0 0 15px var(--primary-color), 0 0 25px var(--shadow-glow); }
}

/* レスポンシブ対応 */
@media (max-width: 992px) {
    .title-image h1 { font-size: 2.75rem; }
    .contact-form h2 { font-size: 2rem; }
}

@media (max-width: 768px) {
    .contact-form { padding: 30px 0; }
    .title-image h1 { font-size: 2rem; }
    .contact-form .btn-primary { padding: 0.75rem 2rem; }
}

@media (max-width: 576px) {
    .title-image h1 { font-size: 1.75rem; }
    .contact-form .btn-primary { width: 100%; padding: 0.75rem; }
    .contact-form .form-control,
    .contact-form .form-select { font-size: 0.95rem; }
}

/* 送信時のオーバーレイ */
.submission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.submission-overlay.active {
    display: flex;
    opacity: 1;
    animation: overlayFadeIn 0.8s ease-out forwards;
}

.submission-content {
    text-align: center;
    color: white;
    position: relative;
    padding: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    box-shadow: 0 0 30px var(--shadow-glow);
    transform: scale(0);
    animation: contentPop 0.6s ease-out 0.3s forwards;
}

.submission-message {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    margin: 0;
    opacity: 0;
    animation: textFadeIn 1s ease-out 0.8s forwards;
}

/* パーティクルエフェクト */
.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: particleBurst 1.5s ease-out forwards;
}

/* アニメーション定義 */
@keyframes overlayFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes contentPop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes textFadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes particleBurst {
    0% { transform: translate(0, 0) scale(0); opacity: 1; }
    100% { transform: translate(var(--x), var(--y)) scale(1.5); opacity: 0; }
}

/* ボタンの送信中アニメーション */
.btn-primary.sending {
    background: linear-gradient(90deg, var(--gradient-end), var(--gradient-start));
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--shadow-glow);
    transition: all 0.3s ease;
}