[id] {
  /* 固定ヘッダーの高さ(60px) + 少しの余白(20px) = 80px */
  scroll-margin-top: 150px; 
}

/* 読み込みスピン演出 */
.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}
.loading-state::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #A7F3D0; /* テーマカラーに合わせる */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* タブナビゲーション */
.tab-navigation {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.tab-navigation::-webkit-scrollbar {
    height: 3px;
}

.tab-navigation::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.tab-navigation::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.5);
    border-radius: 10px;
}

.tab-button {
    flex-shrink: 0;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px 8px 0 0;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    font-size: 20px;
    flex:1;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* ジャンル別色設定 */
.tab-button.active.music {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.1));
    border-color: rgba(59, 130, 246, 0.5);
    color: #93C5FD;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.tab-button.active.programming {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
    border-color: rgba(16, 185, 129, 0.5);
    color: #A7F3D0;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.tab-button.active.game {
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.2), rgba(147, 51, 234, 0.1));
    border-color: rgba(168, 85, 247, 0.5);
    color: #DDD6FE;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}

/* 統一色の場合（コメントアウト）
.tab-button.active {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
    border-color: rgba(16, 185, 129, 0.5);
    color: #A7F3D0;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}
*/

/* タブコンテンツ */
.tab-content {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.tab-content.active {
    display: block;
}

/* プロジェクトリスト */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px 20px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    gap:16px;
    z-index: 1;
}

.project-main-content {
    display: flex;
    gap: 24px; /* 左右エリアの間の隙間 */
    align-items: flex-start; /* 上揃え */
}

.project-info {
    flex: 1; /* 残りの幅をすべて取る */
    min-width:0;
    display: flex;
    flex-direction: column;
    gap: 10px; /* 情報エリア内の各要素の隙間 */
}
.project-title, .project-meta, .project-description, .project-tech {
    margin: 0;
}
.project-actions {
    width:250px;
    flex-shrink: 0; /* 幅が縮まないようにする */
}

.project-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.8), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.project-item:hover::before {
    transform: scaleX(1.0);
}

.project-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* ジャンル別プロジェクトアイテムの色設定 */
.tab-content.music .project-item::before {
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.8), transparent);
}

.tab-content.music .project-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.tab-content.programming .project-item::before {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.8), transparent);
}

.tab-content.programming .project-item:hover {
    border-color: rgba(16, 185, 129, 0.3);
}

.tab-content.game .project-item::before {
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.8), transparent);
}

.tab-content.game .project-item:hover {
    border-color: rgba(168, 85, 247, 0.3);
}

/* 統一色の場合（コメントアウト）
.project-item::before {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.8), transparent);
}

.project-item:hover {
    border-color: rgba(16, 185, 129, 0.3);
}
*/

.project-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #E2E8F0;
    margin: 0;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85em;
    color: #94A3B8;
    margin: 0;
}

.project-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-meta span::before {
    content: '';
    width: 3px;
    height: 3px;
    background: #64748B;
    border-radius: 50%;
}

.project-description {
    color: #CBD5E1;
    line-height: 1.5;
    font-size: 0.9em;
    margin: 0;
    display: -webkit-box;
    line-clamp:2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.tech-tag {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #A7F3D0;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

/* ジャンル別技術タグの色設定 */
.tab-content.music .tech-tag {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93C5FD;
}

.tab-content.programming .tech-tag {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #A7F3D0;
}

.tab-content.game .tech-tag {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
    color: #DDD6FE;
}

/* 統一色の場合（コメントアウト）
.tech-tag {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #A7F3D0;
}
*/
.tech-tag.important-tag {
    background: rgba(250,100,100,0.3) !important;
    color: #FEF2F2 !important;
    border-color: #F87171 !important;
    font-weight: 700 !important;
    animation: pulse-red 2.5s infinite cubic-bezier(0.66, 0, 0, 1);
}
@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(248, 113, 113, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
    }
}


.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748B;
    font-style: italic;
}

.empty-state::before {
    content: '📭';
    display: block;
    font-size: 2em;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .project-main-content {
        flex-direction: column; /* 画面が狭い場合は縦並びに戻す */
        gap: 12px;
    }
    .project-actions {
        width: 100%; /* 幅を100%に */
    }
    .download-section {
        flex-direction: row; /* 横並びに戻す */
        flex-wrap: wrap; /* 折り返しを許可 */
        align-items: center;
    }
    .project-list {
        max-height: 500px;
    }

    .project-item {
        padding: 12px 16px;
    }

    .tab-button {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .project-meta {
        flex-direction: column;
        gap: 6px;
    }

    .project-links {
        flex-direction: column;
    }

    .project-link {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .project-list {
        max-height: 400px;
        padding-right: 5px;
    }

    .tab-navigation {
        margin: 0 -10px 20px -10px;
        padding: 0 10px;
        gap: 2px;
    }

    .tab-button {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .project-item {
        padding: 10px 12px;
    }

    .project-title {
        font-size: 1em;
    }

    .project-description {
        line-clamp: 3;
        -webkit-line-clamp: 3;
    }
}


/* ダウンロードセクション */

/* projects.css */

/* 詳細ボタンの親コンテナ */
.detail-section {
    margin-top: auto; /* 他の要素を押し上げて一番下に配置 */
    padding-top: 16px; /* 上の要素との間に十分な余白 */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end; /* ボタンを右寄せにする */
}

/* 詳細を見るボタン本体 */
.detail-button {
    /* サイズ感とフォントを調整 */
    padding: 10px 20px; /* ★上下10px, 左右20pxでしっかりとしたサイズに */
    font-size: 1em;     /* ★フォントサイズを通常テキストと同じくらいに */
    font-weight: 600;   /* ★少し太字にして存在感を出す */
    
    /* 基本的なスタイル */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width:100%;

    /* テーマカラーを変数で利用 */
    border: 1px solid var(--theme-color-border, rgba(16, 185, 129, 0.3));
    color: var(--theme-color-light, #A7F3D0);
}

/* ボタン内のアイコン */
.detail-button .fa-solid {
    transition: transform 0.3s ease;
}


.download-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: auto;
    padding-top: 0;
    border-top: none;
}

/* カスタムドロップダウン */
.custom-dropdown {
    position:relative;
    width: 100%;
}

.dropdown-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    height: 100%;
}
.custom-dropdown.open .dropdown-selected {
    border-radius: 6px 6px 0 0;
}
.dropdown-selected:hover {
    background: rgba(255, 255, 255, 0.12);
}

.selected-label {
    font-weight: 600;
    color: #E2E8F0;
}

.selected-note {
    font-size: 0.85em;
    color: #94A3B8;
    margin-left: 8px;
}

.dropdown-caret {
    transition: transform 0.3s ease;
}
.custom-dropdown.open .dropdown-caret {
    transform: rotate(180deg);
}

.dropdown-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1E293B; /* 背景色を濃いめに */
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 10;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
.custom-dropdown.open .dropdown-options {
    display: block;
}

.dropdown-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.dropdown-option:last-child {
    border-bottom: none;
}
.dropdown-option:hover {
    background: rgba(16, 185, 129, 0.2);
}

.option-label {
    font-weight: 500;
    color: #E2E8F0;
}
.option-note {
    display: block;
    font-size: 0.8em;
    color: #94A3B8;
    margin-top: 2px;
}

/* ダウンロードボタン */
.download-button {
    /* サイズ感とフォントを調整 */
    padding: 10px 20px; /* ★上下10px, 左右20pxでしっかりとしたサイズに */
    font-size: 1em;     /* ★フォントサイズを通常テキストと同じくらいに */
    font-weight: 600;   /* ★少し太字にして存在感を出す */


    /* 基本的なスタイル */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    background: linear-gradient(145deg, #10B981, #059669);
    color: white;
    width:100%;

    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

}
.download-button:hover {
    transform:scale(1.03);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}


/* 音楽プレーヤー */
.music-player {
    margin-top: 0;
    padding: 12px;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-button {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93C5FD;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-button:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.05);
}

.control-button:active {
    transform: scale(0.95);
}

.control-button.play-pause {
    min-width: 32px;
    font-size: 14px;
}

.time-display {
    font-size: 16px;
    color: #94A3B8;
    min-width: 80px;
    text-align: center;
}

.seek-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.seek-bar {
    flex: 1;
    position: relative;
}

.seek-bar::before {
    content: '';
    position: absolute;
    top: -8px;    /* 上に8px拡大 */
    bottom: -8px; /* 下に8px拡大 */
    left: 0;
    right: 0;
    cursor: pointer;
}
.seek-bar .seek-bar-inner {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    pointer-events: none;
}

.seek-bar-progress {
    height: 100%;
    background: linear-gradient(90deg, #1070D0, #60B0F0);
    background: linear-gradient(90deg, #00A060, #30D0A0);
    border-radius: 2px;
    width: 0%;
    position: relative;
    transition: width 0.1s ease;
}

.seek-bar-progress::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #60A5FA;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.seek-bar:hover .seek-bar-progress::after,
.seek-bar.dragging .seek-bar-progress::after {
    opacity: 1;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.volume-bar {
    width: 60px;
    position: relative;
}
.volume-bar::before {
    content: '';
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: 0;
    right: 0;
    cursor: pointer;
}
.volume-bar .volume-bar-inner {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    pointer-events: none;
}

.volume-bar-progress {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #34D399);
    border-radius: 2px;
    width: 100%;
    transition: width 0.1s ease;
}

.volume-icon {
    font-size: 12px;
    color: #94A3B8;
    min-width: 16px;
    text-align: center;
}

/* 再生中のプロジェクトアイテムのスタイル */
.project-item.playing {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.project-item.playing::before {
    transform: scaleX(1.0);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.4), rgba(59, 130, 246, 0.8), rgba(59, 130, 246, 0.4));
}

/* ドラッグ中のカーソルスタイル */
.seek-bar.dragging,
.volume-bar.dragging {
    cursor: grabbing;
}

/* キーボードの演出 */
.tab-button:focus-visible {
    outline: 2px solid #A7F3D0; /* テーマカラー */
    outline-offset: 2px;
}

.seek-bar:active,
.volume-bar:active {
    cursor: grabbing;
}

@media (max-width: 768px) {
    .music-player {
        padding: 8px;
    }
    
    .player-controls {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .seek-container {
        order: 1;
        width: 100%;
        margin-top: 4px;
    }
    
    .volume-container {
        order: 2;
    }
    
    .time-display {
        order: 3;
        min-width: 60px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .volume-bar {
        width: 40px;
    }
    
    .control-button {
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .control-button.play-pause {
        min-width: 28px;
        font-size: 12px;
    }
}