/* =====  Petoko 設計系統 - 統一色彩系統  ===== */
/* 使用全域 CSS 變數，這裡只定義頁面特定樣式 */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding-bottom: 90px;
}

/* 搜尋頂部 */
.search-header {
    background: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px var(--shadow-light);
}

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

.position-relative {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
    z-index: 1;
}

.search-box {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--bg-secondary);
    border-radius: 25px;
    background: var(--white);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.1);
}

.search-box::placeholder {
    color: var(--text-light);
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1;
}

.search-clear:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* 篩選圈圈 */
.filter-section {
    background: var(--white);
    border-bottom: 1px solid var(--bg-secondary);
    position: sticky;
    top: 70px;
    z-index: 99;
}

.filter-tabs {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 20px;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tab.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(255, 112, 67, 0.3);
}

.filter-tab:hover:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.filter-count {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.filter-tab.active .filter-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* 內容容器 */
.content-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 貼文網格 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.post-item {
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.post-item:hover {
    transform: scale(1.02);
}

.post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 1rem 0.5rem 0.5rem;
    color: var(--white);
}

.overlay-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.overlay-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.overlay-stats i {
    font-size: 0.7rem;
}

/* 影片播放器樣式 - 適用於 Explore 頁面 */
.post-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
}

.post-video-container:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.post-video-container:active {
    transform: scale(0.98);
}

.post-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* 影片覆蓋層 */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.post-video-container:hover .video-overlay {
    opacity: 1;
}

/* 影片時長顯示 */
.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 10;
}

/* 播放圖標 */
.video-play-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.video-play-icon:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* 圈圈列表 */
.circles-list {
    margin-top: 1rem;
}

.circle-menu-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.circle-menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-medium);
}

.circle-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.activity-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--white);
}

.activity-indicator.active {
    background: var(--success);
}

.activity-indicator.new {
    background: var(--warning);
}

.circle-info {
    flex: 1;
    min-width: 0;
}

.circle-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.circle-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.circle-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-badge.hot {
    background: var(--danger);
    color: var(--white);
}

.status-badge.new {
    background: var(--warning);
    color: var(--white);
}

.chevron-icon {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* 混合內容 */
.mixed-content {
    margin-top: 1rem;
}

.mixed-content .post-item {
    margin-bottom: 0.75rem;
}

.mixed-content .circle-menu-item {
    margin-bottom: 0.75rem;
}

.new-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--warning);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 排行榜內容 */
.ranking-content {
    margin-top: 1rem;
}

.ranking-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--warning);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ranking-circle .ranking-badge {
    position: static;
    background: var(--warning);
    color: var(--white);
}

/* 載入狀態指示器 */
.loading-indicator {
    text-align: center;
    padding: 2rem 1rem;
    margin: 1rem 0;
}

.loading-spinner {
    margin-bottom: 1rem;
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--primary);
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 沒有更多資料提示 */
.no-more-data {
    text-align: center;
    padding: 2rem 1rem;
    margin: 1rem 0;
    color: var(--text-light);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.no-more-icon {
    margin-bottom: 1rem;
}

.no-more-icon i {
    font-size: 2rem;
    color: var(--success);
}

/* Hover 效果 */
.no-more-data:hover {
    opacity: 1;
}

.no-more-text {
    font-size: 0.9rem;
}

/* 新載入項目動畫 */
.new-item-animation {
    animation: slideInUp 0.6s ease-out;
}

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

/* 確保新載入內容的樣式一致性 */
.post-item, .circle-menu-item {
    /* 確保基本樣式不會被覆蓋 */
    position: relative !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: transform 0.3s ease !important;
}

.post-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    display: block !important;
}

.post-video-container {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    background: #000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.post-video-container video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
}

.post-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)) !important;
    padding: 1rem 0.5rem 0.5rem !important;
    color: white !important;
}

.circle-menu-item {
    display: flex !important;
    align-items: center !important;
    padding: 1rem !important;
    background: var(--white) !important;
    border-radius: 12px !important;
    margin-bottom: 0.75rem !important;
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: 0 2px 8px var(--shadow-light) !important;
}

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

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.empty-state h6 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.start-posting-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-posting-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 112, 67, 0.3);
}

/* 響應式設計 */
@media (max-width: 480px) {
    .content-container {
        padding: 0 0.5rem;
    }
    
    .search-container {
        padding: 0 0.5rem;
    }
    
    .filter-tabs {
        padding: 0 0.5rem;
    }
    
    .posts-grid {
        gap: 0.25rem;
    }
    
    .post-item {
        border-radius: 6px;
    }
    
    .overlay-stats {
        font-size: 0.7rem;
        gap: 0.5rem;
    }
    
    .loading-indicator {
        padding: 1.5rem 0.5rem;
    }
    
    .no-more-data {
        padding: 1.5rem 0.5rem;
    }
    
    .circle-menu-item {
        padding: 0.75rem;
    }
    
    .circle-avatar {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }
}

@media (max-width: 360px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.25rem;
    }
    
    .overlay-stats {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .filter-tabs {
        gap: 0.25rem;
    }
    
    .filter-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* 確保與 Bootstrap 相容 */
.me-2 {
    margin-right: 0.5rem !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #0dcaf0 !important;
}

.text-danger {
    color: #dc3545 !important;
} 