/* ========================================
   CULTURE & RITUALS - STYLES (V5 - REFINED)
   ======================================== */

/* Base Container */
.content-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.content-section {
    margin-bottom: 35px;
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid #303030;
    backdrop-filter: blur(10px);
}

/* Section Headers with Gradient Accents */
.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #2d2d2d 0%, #353535 100%);
    padding: 18px 25px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    border-bottom: 2px solid #404040;
    position: relative;
    overflow: hidden;
}

.section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
    opacity: 0.8;
}

.section-header:hover { 
    background: linear-gradient(135deg, #353535 0%, #3d3d3d 100%);
    transform: translateX(2px);
}

/* Collapse Icon Animation */
.collapse-icon {
    font-size: 1.2rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-90deg);
    width: 20px;
    flex-shrink: 0;
}

.content-section.expanded .collapse-icon {
    transform: rotate(0deg);
}

/* Section Title Styling */
.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    flex-grow: 1;
    letter-spacing: 1px;
}

/* Item Count Badge */
.item-count {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* Section Content Animation */
.section-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.content-section.expanded .section-content {
    grid-template-rows: 1fr;
}

.content-wrapper {
    overflow: hidden;
    padding: 25px;
    background: linear-gradient(180deg, #1a1a1a 0%, #181818 100%);
    border-top: none;
}

/* Content Cards with Enhanced Styling */
.content-card {
    background: #252525;
    border: 1px solid #404040;
    margin-bottom: 25px;
    padding: 25px;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 4px;
    overflow: hidden;
}

.content-card:hover {
    background: #2a2a2a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.content-card:last-child { 
    margin-bottom: 0; 
}

.content-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: currentColor;
}

/* TYPE-SPECIFIC COLOR CODING */
/* Festivals: Vibrant Orange */
.section-header.type-festival::before { background: #ff851b; }
.section-header.type-festival .collapse-icon { color: #ff851b; }
.content-card.type-festival::before { background: linear-gradient(180deg, #ff851b 0%, #ff6600 100%); }

/* Cultures: Deep Teal */
.section-header.type-culture::before { background: #39CCCC; }
.section-header.type-culture .collapse-icon { color: #39CCCC; }
.content-card.type-culture::before { background: linear-gradient(180deg, #39CCCC 0%, #2eb8b8 100%); }

/* Sensory: Electric Blue */
.section-header.type-sensory::before { background: #4a9eff; }
.section-header.type-sensory .collapse-icon { color: #4a9eff; }
.content-card.type-sensory::before { background: linear-gradient(180deg, #4a9eff 0%, #3385ff 100%); }

/* Rituals: Mystic Purple */
.section-header.type-ritual::before { background: #b10dc9; }
.section-header.type-ritual .collapse-icon { color: #b10dc9; }
.content-card.type-ritual::before { background: linear-gradient(180deg, #b10dc9 0%, #9b0db3 100%); }

/* Card Title */
.card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
}

/* Card Meta Information */
.card-meta {
    font-size: 0.85rem;
    color: #808080;
    font-style: italic;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #404040;
}

/* Keyword Badges Container - 改为横向布局 */
.card-keywords {
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Individual Keyword Badge - 调整为横向显示 */
.keyword-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #2d2d2d 0%, #282828 100%);
    border: 1px solid #404040;
    font-size: 0.82rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex: 0 1 auto;
    min-width: 0;
}

.keyword-badge:hover {
    background: linear-gradient(135deg, #333333 0%, #2d2d2d 100%);
    transform: translateY(-2px);
}

/* Primary Keywords */
.keyword-badge.primary {
    border-color: #c41e3a;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.08) 0%, rgba(196, 30, 58, 0.04) 100%);
}

/* Secondary Keywords */
.keyword-badge.secondary {
    border-color: #606060;
    background: linear-gradient(135deg, rgba(96, 96, 96, 0.08) 0%, rgba(96, 96, 96, 0.04) 100%);
}

/* Keyword Label - 更紧凑 */
.key-label {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    opacity: 0.9;
}

.keyword-badge.primary .key-label { 
    color: #c41e3a; 
}

.keyword-badge.secondary .key-label { 
    color: #909090; 
}

/* Keyword Values - 单行显示 */
.key-value {
    color: #b0b0b0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 600px;
    font-size: 0.82rem;
}

/* 悬停时显示完整内容 */
.keyword-badge:hover .key-value {
    white-space: normal;
    overflow: visible;
    word-wrap: break-word;
}

/* 为不同宽度的keyword badge设置最大宽度 */
.keyword-badge.primary {
    max-width: calc(60% - 10px);
}

.keyword-badge.secondary {
    max-width: calc(40% - 10px);
}

/* 响应式设计 - 小屏幕时垂直排列 */
@media (max-width: 768px) {
    .card-keywords {
        flex-direction: column;
        gap: 10px;
    }
    
    .keyword-badge {
        max-width: 100%;
        width: 100%;
    }
    
    .keyword-badge.primary,
    .keyword-badge.secondary {
        max-width: 100%;
    }
    
    .key-value {
        max-width: calc(100% - 80px);
        white-space: normal;
        word-break: break-word;
    }
}

/* 中等屏幕优化 */
@media (min-width: 769px) and (max-width: 1200px) {
    .keyword-badge {
        font-size: 0.8rem;
    }
    
    .key-value {
        max-width: 400px;
    }
}

/* Card Description */
.card-description {
    line-height: 1.7;
    color: #b8b8b8;
}

.card-description p {
    margin: 0;
    text-align: justify;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-container {
        padding: 0 15px;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .content-card {
        padding: 18px;
    }
    
    .keyword-badge {
        flex-direction: column;
        gap: 5px;
    }
    
    .key-value {
        max-width: 100%;
    }
}

/* Loading Animation for Sections */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section.expanded .content-card {
    animation: fadeInUp 0.4s ease forwards;
    animation-delay: calc(var(--card-index) * 0.05s);
}

/* Custom Scrollbar for Content Wrapper */
.content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.content-wrapper::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.content-wrapper::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
}

.content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #505050;
}