* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    overflow-x: hidden;
}

/* ヘッダーのスタイル */
header {
    background-color: #6a3d99;
    color: white;
    padding: 1rem 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0.5rem;
}

/* ヒーローセクション */
.hero-section {
    background-image: url('backgroud.jpg');
    background-size: cover;
    background-position: center;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(106, 61, 153, 0.7) 0%, rgba(156, 39, 176, 0.7) 100%);
    z-index: 1;
    animation: gradientShift 10s infinite alternate;
}

@keyframes gradientShift {
    0% {
        background: linear-gradient(135deg, rgba(106, 61, 153, 0.7) 0%, rgba(156, 39, 176, 0.7) 100%);
    }
    50% {
        background: linear-gradient(135deg, rgba(156, 39, 176, 0.7) 0%, rgba(106, 61, 153, 0.7) 100%);
    }
    100% {
        background: linear-gradient(135deg, rgba(106, 61, 153, 0.7) 0%, rgba(156, 39, 176, 0.7) 100%);
    }
}

.hero-content {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 1.8rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    z-index: 2;
    transform: translateY(0);
    animation: bounceIn 1s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(40px);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.1) translateY(-10px);
    }
    80% {
        opacity: 1;
        transform: scale(0.89) translateY(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.hero-content h2 {
    font-size: 1.7rem;
    margin-bottom: 0.5rem;
}

/* 検索セクション */
.search-section {
    margin-bottom: 2rem;
    text-align: center;
    animation: fadeIn 1s ease 0.3s forwards;
    opacity: 0;
}

.search-section h2 {
    color: #6a3d99;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.search-section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: #6a3d99;
    animation: widthPulse 3s infinite;
}

@keyframes widthPulse {
    0% { width: 30px; }
    50% { width: 80px; }
    100% { width: 30px; }
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
    background-color: #f6f0fc;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(106, 61, 153, 0.1);
}

/* 検索グループ */
.search-group {
    position: relative;
    width: 100%;
}

.search-group input {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-group input:focus {
    border-color: #6a3d99;
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 61, 153, 0.2);
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background-color: #ddd;
    color: #333;
}

/* 検索コントロール */
.search-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.primary-btn, .secondary-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 120px;
}

.primary-btn {
    background-color: #6a3d99;
    color: white;
    box-shadow: 0 3px 10px rgba(106, 61, 153, 0.3);
    position: relative;
    overflow: hidden;
}

.primary-btn::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: 0.5s;
}

.primary-btn:hover::before {
    left: 100%;
}

.primary-btn:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 61, 153, 0.4);
}

.secondary-btn {
    background-color: #f0f0f0;
    color: #333;
}

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

/* 検索ステータス */
.search-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
}

#result-stats {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* サークル一覧 */
.club-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    opacity: 0;
    animation: fadeIn 1s ease 0.6s forwards;
}

.club-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    cursor: pointer;
    transform: translateY(0) scale(1);
    position: relative;
}

.club-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 10px 25px rgba(106, 61, 153, 0.25);
}

.club-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6a3d99, #9c27b0);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.4s ease;
}

.club-card:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.club-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.club-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.3) 100%);
}

.club-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.club-card:hover .club-image img {
    transform: scale(1.1);
}

.club-info {
    padding: 1.2rem;
}

.club-category {
    display: inline-block;
    background-color: #f0e6f7;
    color: #6a3d99;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 0.7rem;
    font-weight: bold;
}

.club-name {
    font-size: 1.3rem;
    margin-bottom: 0.7rem;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
}

/* 認証マークのスタイル */
.verification-badge {
    display: inline-flex;
    margin-left: 8px;
    position: relative;
}

.verification-badge svg {
    width: 18px;
    height: 18px;
}

.verification-badge.official {
    color: #4b9e65; /* 公認団体は緑色 */
}

.verification-badge.school {
    color: #8e44ad; /* 学校直轄団体は紫色 */
}

.verification-badge .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.verification-badge:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.club-description {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.founding-year {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.8rem;
}

.club-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 0.8rem;
}

/* モーダル関連のスタイル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 90%;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8) translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f0e6f7;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: #6a3d99;
    color: white;
    transform: rotate(90deg);
}

.modal-header {
    padding: 1.8rem 1.8rem 0.8rem;
    position: relative;
}

.modal-body {
    padding: 0 1.8rem 1.8rem;
}

.club-full-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease;
}

.club-full-image:hover {
    transform: scale(1.02);
}

.club-full-description {
    margin-bottom: 1.8rem;
    line-height: 1.7;
    color: #444;
}

.club-meta {
    background-color: #f8f8f8;
    padding: 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.8rem;
    border-left: 4px solid #6a3d99;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.club-meta:hover {
    transform: translateX(5px);
}

.club-meta-item {
    margin-bottom: 0.7rem;
    display: flex;
}

.club-meta-item:last-child {
    margin-bottom: 0;
}

.club-meta-label {
    font-weight: bold;
    width: 100px;
    flex-shrink: 0;
    color: #6a3d99;
}

.modal-body h3 {
    color: #6a3d99;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    position: relative;
    display: inline-block;
}

.modal-body h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #6a3d99;
    transition: width 0.3s ease;
}

.modal-body h3:hover::after {
    width: 100%;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #f0e6f7;
    color: #6a3d99;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(106, 61, 153, 0.2);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.5s ease;
}

.social-link:hover::before {
    transform: scale(2);
}

.social-link:hover {
    background-color: #6a3d99;
    color: white;
    transform: translateY(-3px) rotate(360deg);
}

.social-link svg {
    position: relative;
    z-index: 2;
}

.social-link-website svg {
    width: 20px;
    height: 20px;
}

/* フッター */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6a3d99, #9c27b0, #6a3d99);
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

/* 読み込み中画面 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #6a3d99;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-logo {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: pulse 2s infinite;
}

/* 画像コンテナとアニメーション */
.loading-image-container {
    width: 150px;
    height: 150px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.loading-image {
    width: 100%;
    height: 100%;
    animation: rotate 3s linear infinite;
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.loading-text {
    margin-top: 0.5rem;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    position: relative;
}

/* アニメーション関連 */
.fade-in {
    animation: fadeIn 1s ease forwards;
}

.slide-up {
    animation: slideUp 0.5s ease forwards;
}

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

/* 追加のアニメーション */
.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

/* バウンスホバーアニメーション */
.bounce-hover:hover {
    animation: bounce 0.6s ease;
}

/* パーティクル効果 */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none; /* ポインターイベントを無効にして下の要素へ透過させる */
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    top: -10px;
    animation: particleFall linear infinite;
    pointer-events: none; /* 個別のパーティクルもポインターイベントを無効に */
}

@keyframes particleFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .hero-section {
        height: 200px;
    }
    .hero-content {
        padding: 1.2rem;
    }
    .hero-content h2 {
        font-size: 1.4rem;
    }
    .container {
        padding: 1rem 1rem;
    }
    .club-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    .modal-content {
        width: 95%;
    }
}

/* トップに戻るボタン - 修正バージョン */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 100px; /* 固定幅を設定 */
    height: 100px; /* 固定高さを設定 */
    background-color: rgba(106, 61, 153, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    padding: 12px;
    box-sizing: border-box;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: rgba(106, 61, 153, 1);
    transform: translateY(-5px);
}

.back-to-top img {
    width: 100%; /* 親要素に対して100%幅 */
    height: 100%; /* 親要素に対して100%高さ */
    object-fit: contain; /* 画像のアスペクト比を維持 */
    /* filter: brightness(0) invert(1); 画像を白色に変換 */
}

.category-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.category-filters label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background-color: #f0e6f7;
    color: #6a3d99;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.category-filters input[type="checkbox"] {
    display: none;
}

.category-filters input[type="checkbox"]:checked + span {
    background-color: #6a3d99;
    color: white;
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
}


/* レスポンシブデザインの追加 */
@media (max-width: 768px) {
    .hero-section {
        height: 200px;
    }
    .hero-content {
        padding: 1.2rem;
        width: 85%;
    }
    .hero-content h2 {
        font-size: 1.4rem;
    }
    .container {
        padding: 1rem 1rem;
    }
    .club-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    .modal-content {
        width: 95%;
    }
    
    /* スマホ向けのトップに戻るボタン */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        padding: 8px;
    }
    
    /* カテゴリーフィルターの調整 */
    .category-filters {
        gap: 0.5rem;
    }
    
    .category-filters label {
        padding: 0.3rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* 検索セクションのモバイル調整 */
@media (max-width: 480px) {
    .search-form {
        padding: 1rem;
    }
    
    .search-controls {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
    }
    
    /* さらに小さい画面用のトップに戻るボタン */
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 60px;
        height: 60px;
        padding: 6px;
    }
}