/* カテゴリーシステム統合CSS */

/* パンくずリスト */
.breadcrumb-nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin: 0 0.5rem;
    color: var(--text-light);
    font-size: 1.1em;
    font-weight: bold;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.breadcrumb-item a:hover {
    background: rgba(255, 107, 53, 0.1);
    text-decoration: none;
    transform: translateY(-1px);
}

.breadcrumb-item span[aria-current="page"] {
    color: var(--text-color);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 6px;
}

@media (max-width: 768px) {
    .breadcrumb-nav {
        padding: 0.75rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .breadcrumb-item a,
    .breadcrumb-item span[aria-current="page"] {
        padding: 0.2rem 0.4rem;
        font-size: 0.9em;
    }
    
    .breadcrumb-item:not(:last-child)::after {
        margin: 0 0.3rem;
        font-size: 1em;
    }
}

/* fixedヘッダーのためのbody調整 */
body {
    padding-top: 80px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    min-height: 100vh;
}

body.categories-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    min-height: 100vh;
}

body .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 20px 0 !important;
    position: relative;
}

/* サブカテゴリーインデックス */
#sub-category-index {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 3rem 0;
}

#sub-category-index li {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

#sub-category-index li:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

#sub-category-index li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

#sub-category-index li:hover::before {
    transform: scaleX(1);
}

#sub-category-index li a {
    display: flex;
    align-items: center;
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
}

#sub-category-index li a::after {
    content: '→';
    margin-left: auto;
    font-size: 1.2rem;
    color: var(--primary-color);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

#sub-category-index li a:hover {
    color: var(--primary-color);
}

#sub-category-index li:hover a::after {
    opacity: 1;
    transform: translateX(0);
}

/* パンくずナビ */
body .breadcrumb {
    padding: 1.5rem 0 !important;
    font-size: 0.9rem !important;
    color: var(--text-light) !important;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 12px !important;
    margin-bottom: 2rem !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ページタイトル */
.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 1rem 0 3rem 0;
    color: var(--text-color);
    position: relative;
    padding-bottom: 1rem;
    text-align: center;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* ホームページリスト */
.homepage-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin: 1rem 0;
    list-style: none;
    padding: 0;
}

/* 従来のdt/dd構造もサポート */
.homepage-list dt {
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.homepage-list dt a {
    color: var(--primary-color, #2c3e50);
    text-decoration: none;
}

.homepage-list dt a:hover {
    text-decoration: underline;
}

.homepage-list dd {
    margin: 0 0 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color, #2c3e50);
    display: flex;
    gap: 1rem;
}

.homepage-list .thumbnail {
    flex-shrink: 0;
}

.homepage-list .thumbnail img {
    border-radius: 4px;
    border: 1px solid #ddd;
}

.homepage-list .content {
    flex: 1;
}

.homepage-list .description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.homepage-list .url {
    font-size: 0.9rem;
}

.homepage-list .url a {
    color: #666;
    text-decoration: none;
    word-break: break-all;
}

.homepage-list .url a:hover {
    text-decoration: underline;
}

.homepage-item {
    background: var(--white);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
}

.homepage-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.homepage-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.homepage-thumbnail {
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    position: relative;
    overflow: hidden;
}

.homepage-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.homepage-item:hover .homepage-thumbnail img {
    transform: scale(1.05);
}

.homepage-item.no-thumbnail .homepage-thumbnail {
    display: none;
}

.homepage-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.homepage-item.no-thumbnail .homepage-content {
    height: 100%;
}

.homepage-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
}

.homepage-description {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.7;
    margin: 0.5rem 0 1.5rem 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.homepage-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
}

.homepage-url {
    font-size: 0.9rem;
    color: var(--gray-dark);
    word-break: break-all;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0.6rem 0.9rem;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.pagination a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.pagination a:hover::before {
    left: 100%;
}

.pagination a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.pagination .current {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    font-weight: 700;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
    position: relative;
}

.pagination .current::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border: 2px solid var(--primary-color);
    border-radius: 14px;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    body .container {
        padding: 6rem 1.5rem 0 !important;
    }
    
    #sub-category-index {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .homepage-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 992px) {
    .homepage-list {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    #sub-category-index {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    body .container {
        padding: 5rem 1rem 0 !important;
    }

    #sub-category-index {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 2rem 0;
    }
    
    #sub-category-index li a {
        padding: 1.5rem 1rem;
        font-size: 1rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .homepage-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 1rem 0;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin: 2rem 0;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body .container {
        padding: 4.5rem 0.75rem 0 !important;
    }
    
    .page-title {
        font-size: 1.75rem;
        margin: 0.5rem 0 2rem 0;
    }
    
    #sub-category-index li a {
        padding: 1.25rem 1rem;
        font-size: 0.95rem;
    }
    
    .homepage-content {
        padding: 1.25rem;
    }
    
    .homepage-title {
        font-size: 1.1rem;
    }
    
    .homepage-description {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
    
    .homepage-list dd {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
}


.header {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 50%, #ffa726 100%) !important;
    color: white !important;
    padding: 1.5rem 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    overflow: visible !important;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

.header .header-content {
    position: relative !important;
    z-index: 1002 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    pointer-events: auto !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    50% { transform: translateY(-20px) translateX(10px); }
}

.header .logo h1 {
    margin: 0 !important;
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    color: white !important;
}

.header .logo h1 a {
    color: white !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.header .logo h1 a:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

.header .header-nav {
    margin-top: 0 !important;
    position: relative !important;
    z-index: 1001 !important;
    pointer-events: auto !important;
    display: flex !important;
    gap: 1rem !important;
}

.header .header-nav a {
    color: white !important;
    text-decoration: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    font-weight: 500 !important;
    position: relative !important;
    z-index: 1001 !important;
    pointer-events: auto !important;
    display: inline-block !important;
}

.header .header-nav a:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* スクリーンショットローダー */
.screenshot-loader {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    background: var(--gray-light);
    border-radius: var(--border-radius);
}

.loading-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
}

.loading-placeholder::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-medium);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 1s linear infinite;
}

.screenshot-loader img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screenshot-loader.loaded img {
    opacity: 1;
}

.screenshot-loader.loaded .loading-placeholder {
    display: none;
}

.screenshot-loader.error .loading-placeholder {
    color: var(--text-light);
}

.screenshot-loader.error .loading-placeholder::after {
    display: none;
}

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

/* 追加のアニメーション効果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.homepage-item,
#sub-category-index li {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.homepage-item:nth-child(1) { animation-delay: 0.1s; }
.homepage-item:nth-child(2) { animation-delay: 0.2s; }
.homepage-item:nth-child(3) { animation-delay: 0.3s; }
.homepage-item:nth-child(4) { animation-delay: 0.4s; }
.homepage-item:nth-child(5) { animation-delay: 0.5s; }
.homepage-item:nth-child(6) { animation-delay: 0.6s; }

#sub-category-index li:nth-child(1) { animation-delay: 0.1s; }
#sub-category-index li:nth-child(2) { animation-delay: 0.15s; }
#sub-category-index li:nth-child(3) { animation-delay: 0.2s; }
#sub-category-index li:nth-child(4) { animation-delay: 0.25s; }
#sub-category-index li:nth-child(5) { animation-delay: 0.3s; }
#sub-category-index li:nth-child(6) { animation-delay: 0.35s; }

/* ページタイトルアニメーション */
.page-title {
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

/* ローディング状態の改善 */
.homepage-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.8s;
    pointer-events: none;
}

.homepage-item:hover::after {
    transform: translateX(100%);
}

/* 追加のユーティリティ */
.clear {
    clear: both;
}

.clear-after::after {
    content: "";
    display: table;
    clear: both;
}

.no-results {
    text-align: center;
    color: #666;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 1rem 0;
}

/* フッター */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}