/* ==============================================
   サイドバーウィジェット用CSS
   ============================================== */

/* 共通ウィジェットアニメーション */
.widget {
    opacity: 0;
    animation: widgetFadeIn 0.6s ease-out forwards;
}

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

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

/* ===============================
   ピックアップ記事ウィジェット
   =============================== */
.pickup-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.pickup-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pickup-item a {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
}

.pickup-item a:hover {
    transform: translateX(5px);
}

.pickup-item h4 {
    margin: 0 0 8px 0;
    font-size: 1.05rem;
    line-height: 1.5;
    color: #333;
    font-weight: 600;
}

.pickup-item .meta {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* ===============================
   新着記事ウィジェット
   =============================== */
.recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.recent-list li:last-child {
    border-bottom: none;
}

.recent-list a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    transition: color 0.3s ease;
}

.recent-list a:hover {
    color: #007bff;
}

.recent-list .date {
    font-size: 0.85rem;
    color: #999;
}

.more-link {
    display: inline-block;
    margin-top: 15px;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.more-link:hover {
    transform: translateX(5px);
    text-decoration: underline;
}

/* ===============================
   人気タグウィジェット
   =============================== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag-item {
    display: inline-block;
    padding: 6px 14px;
    background-color: #f0f0f0;
    border-radius: 15px;
    text-decoration: none;
    color: #555;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.tag-item:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
    cursor: pointer;
}

/* ===============================
   共通ウィジェットコンテンツスタイル
   =============================== */
.widget-content {
    margin-top: 15px;
}

/* ピックアップ記事のホバー効果強化 */
.pickup-item:hover h4 {
    color: #007bff;
}

/* レスポンシブ調整 */
@media (max-width: 1199px) {
    .pickup-item h4 {
        font-size: 0.9rem;
    }
    
    .tag-item {
        font-size: 0.9em;
        padding: 4px 10px;
    }
}

@media (max-width: 767px) {
    .widget {
        margin-bottom: 25px;
    }
    
    .pickup-item h4 {
        font-size: 1rem;
    }
    
    .tag-cloud {
        gap: 10px;
    }
    
    .tag-item {
        font-size: 1em;
        padding: 6px 12px;
    }
}

/* ===============================
   月別アーカイブウィジェット
   =============================== */
.archive-list {
    margin-top: 10px;
}

.archive-year {
    margin-bottom: 15px;
}

.year-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background-color: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
    user-select: none;
}

.year-header:hover {
    background-color: #e9ecef;
}

.year-header i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.year-header[data-expanded="true"] i.fa-chevron-right {
    transform: rotate(90deg);
}

.month-list {
    margin: 10px 0 0 25px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 500px;
}

.month-list.collapsed {
    max-height: 0;
    margin: 0 0 0 25px;
}

.month-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px;
    text-decoration: none;
    color: #555;
    font-size: 1rem;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.month-item:hover {
    background-color: #f0f0f0;
    color: #007bff;
    transform: translateX(5px);
    cursor: pointer;
}

.month-item .count {
    font-size: 0.95rem;
    color: #999;
}

/* ===============================
   カテゴリー統計ウィジェット
   =============================== */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    transition: transform 0.2s ease;
    padding: 5px;
    margin: -5px;
    border-radius: 5px;
}

.stat-item:hover {
    transform: translateX(5px);
    background-color: #f8f9fa;
}

/* 企業別記事数のクリック可能表示 */
.company-stat-item {
    cursor: pointer;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.category-name {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.stat-count {
    font-size: 1rem;
    color: #666;
    font-weight: 600;
}

.stat-bar {
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    border-radius: 10px;
    transition: width 1s ease;
    position: relative;
    overflow: hidden;
}

/* アニメーション効果 */
.stat-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}

/* カテゴリー別の色分け */
.stat-item:nth-child(1) .stat-fill {
    background: linear-gradient(90deg, #28a745 0%, #1e7e34 100%);
}

.stat-item:nth-child(2) .stat-fill {
    background: linear-gradient(90deg, #17a2b8 0%, #117a8b 100%);
}

.stat-item:nth-child(3) .stat-fill {
    background: linear-gradient(90deg, #ffc107 0%, #e0a800 100%);
}

.stat-item:nth-child(4) .stat-fill {
    background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
}

.stat-item:nth-child(5) .stat-fill {
    background: linear-gradient(90deg, #6c757d 0%, #5a6268 100%);
}

/* ===============================
   AI関連ウィジェットアイコンの色
   =============================== */
.widget h3 i.fa-robot {
    color: #4285f4;
    margin-right: 5px;
}

.widget h3 i.fa-microchip {
    color: #34a853;
    margin-right: 5px;
}

.widget h3 i.fa-building {
    color: #ea4335;
    margin-right: 5px;
}

.widget h3 i.fa-tags {
    color: #fbbc04;
    margin-right: 5px;
}

.widget h3 i.fa-calendar-alt {
    color: #9c27b0;
    margin-right: 5px;
}

/* ===============================
   更新履歴ウィジェット
   =============================== */
.update-history-widget {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
}

.update-history-widget h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    margin: 0;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    user-select: none;
}

/* クリック可能であることを示す矢印 */
.update-history-widget h3::after {
    content: '▼';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

/* 非表示時の矢印 */
.update-history-widget.collapsed h3::after {
    transform: translateY(-50%) rotate(0deg);
}

/* ホバー時のスタイル */
.update-history-widget h3:hover {
    background: linear-gradient(135deg, #7986ec 0%, #8654b8 100%);
    transition: background 0.3s ease;
}

.update-history-widget h3 i {
    color: white !important;
}

.update-list {
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* 非表示時のスタイル */
.update-history-widget.collapsed .update-list {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* ウィジェットコンテンツのアニメーション */
.update-history-widget .widget-content {
    overflow: hidden;
    transition: all 0.3s ease;
}

.update-history-widget.collapsed .widget-content {
    padding-top: 0;
    padding-bottom: 0;
}

/* 非表示時のウィジェット自体のマージン調整 */
.update-history-widget.collapsed {
    margin-bottom: 15px;
}

.update-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.update-item:hover {
    background-color: #f8f9fa;
}

.update-item:last-child {
    border-bottom: none;
}

.update-item .update-date {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.update-item .update-info {
    margin-left: 5px;
}

.update-item .update-category {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 5px;
}

.update-item .update-content {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 3px;
    font-size: 0.95rem;
}

.update-item .update-detail {
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.5;
}

/* AI最新動向セクション */
.ai-section {
    background: rgba(66, 133, 244, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(66, 133, 244, 0.2);
}

.ai-section-title {
    color: #4285f4;
    font-size: 1.4rem;
    margin: 0 0 25px 0;
    text-align: center;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
}

.ai-section-title i {
    margin-right: 8px;
}

.ai-section .widget {
    background: white;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ai-section .widget:last-child {
    margin-bottom: 0;
}

/* =====================================
   フィルタリング機能関連
   ===================================== */

/* フィルタリング情報バー */
.filter-info {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-label {
    font-size: 14px;
    color: #333;
}

.filter-label i {
    color: #4285f4;
    margin-right: 8px;
}

.filter-label strong {
    color: #1976d2;
}

.filter-reset {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.filter-reset:hover {
    background: #d32f2f;
}

/* カテゴリーフィルター */
.category-filter {
    transition: all 0.3s;
}

.category-filter:hover {
    transform: translateX(5px);
    background: #f5f5f5;
    cursor: pointer;
}

.category-filter.active {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding-left: 12px;
}

.category-filter.active .stat-header {
    font-weight: bold;
}

/* 月別フィルター */
.month-filter {
    transition: all 0.3s;
}

.month-filter:hover {
    background: #f0f0f0;
    padding-left: 20px;
}

.month-filter.active {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: bold;
}